Using VirtualBox to springboard VMs to OCI – Let’s All Go to the Cloud

Using VirtualBox to springboard VMs to OCI
Working 9 to 5 with workloads?
One common factor in a number of these recipes is moving workloads from one environment to another. Working between different hypervisor types (e.g., VMware, KVM, and Xen) is done using common formats, such as the Open Virtualization Format/Open Virtualization Appliance (OVF/OVA). Essentially, this puts components into a centrally understandable format that most virtualization host environments can understand. Images are transferable and interchangeable between virtualization formats. In this case, there are a few more puzzle pieces that need to be in place, such as network, storage, and a limitation on the number of attached drives.
Imagine a world where any workload (be it application- or database-based) can stay with you throughout the project life cycle, and be transferable between different virtualization farms, or CSPs. You can carry these created environments with you throughout your environments.
VirtualBox resides on your system as a host and is classified as a “type 2” hypervisor, allowing you to host multiple guest machines on your host environment. Your host environment, VirtualBox, has every aspect of a virtual farm that one would expect from a larger enterprise product, just broken down into much smaller and simpler parts. The compute and memory aspects are carved out from your host environment (your computer). The storage components are comprised of parts of your local hard drive, or external storage environments such as an externally attached NVMe drives. Lastly, the network is made up of bridge components, which are virtual networks that sit above your physical interfaces.
What comes first, the VM or the OS?
Every evolution begins with a foundation. Before we can even consider migrating a VM from VirtualBox to OCI, we must prepare that VM for migration. In the case of VirtualBox, there are just a couple of prework items to complete before you build a VM to migrate to a cloud environment, such as OCI. We’ll walk through these prerequisites throughout this recipe. The following diagram describes the stages of configuring, installing, and migrating a VM to a CSP.

Figure 13.26 – VM configuration stages
Getting ready
Preparing the OS isn’t any different from setting the foundation before building a house. I find it easier to initially configure the OS on the VirtualBox user interface configuration, then ssh after you bring up networking and have established communication, meaning you have connectivity into the virtual machine.
There are five stages in preparing a VM image to be imported into OCI as an image. These are as follows:

  1. Interface names: This involves standardization to ensure interface names are recognized by the host environment. This is translatable to how the host system implements networking.
  2. Interface configuration: Here, we confirm there are no MAC addresses shown, among other pre-configuration tasks. Duplicate MAC addresses lead to extra complexity, making this a key point in configuration.
  3. GRUB(2) configuration: This involves preparing the kernel.
  4. Serial console configuration: This step is pretty much the number-one error on import and use. Without it, your OCI environment will fail on import, or the VM will not boot.
  5. Rebooting the OS; that is, restarting your machine.
    The following diagram walks through the configuration stages of the OS from boot to reboot:

Figure 13.27 – OS configuration stages