Migrating Windows VMs from VMware to OpenStack

The process of migrating a virtual machine running Microsoft Windows from VMware to Mirantis OpenStack Express is very similar to migrating from Amazon Web Services, with a few changes we’ll point out. Most notably, if you don’t have Administrator access, you still have options for performing an export rather than starting from scratch.

Configure RDP

To permit the ability to remote desktop into the Windows Virtual Machine, you need to allow remote connections to connect to the Virtual Machine. Microsoft only supports Remote Desktop Connections on the following following versions of Windows:

Windows XP Professional edition

Windows Vista Business, Ultimate, or Enterprise edition

Windows 7 Professional, Ultimate, or Enterprise edition

Windows Server editions

On the existing Windows Virtual Machine, follow the following steps to enable Remote Desktop Connection:

Open System Information by clicking the Start button , right-clicking Computer, and then clicking Properties.

In the left pane, click Remote settings. If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.

Note: If your Virtual Machine was created in VMWare Workstation or VMware Fusion, it’s possible you don’t have a single *-flat.vmdk that you need and instead have multiple VMDK files that make up the single disk:

If this is the case, you will require the Virtual Disk Development Kit from VMware. See Appendix B for installation and usage of the toolkit to merge the multiple VMDK files into a single flat VMDK.

After downloading the VMDK image from the datastore, you need to place it on a Linux system to utilize the qemu-img tools to convert it to the appropriate QCOW2 format. You can create a Linux Virtual Machine and install the qemu-img package or you can utilize the Controller Node of your OpenStack environment. See the Navigating Mirantis OpenStack Express section of this document for obtaining access to the Controller Node of Mirantis OpenStack Express and uploading the VMDK image.

NOTE: If your VMDK is a large file, ensure that there is at least 2.5x the space available on your Controller Node before uploading it to the controller node.

Upload the VMDK file to the Controller Node (or optionally a VM that has both the qemu-img) to the mirantis user home directory.

SSH in as the mirantis user and convert the VMDK to a QCOW2 format by issuing the following command:

If you had administrator access to this Windows Virtual Machine, you are ready to upload your image to OpenStack as detailed in the uploading image to OpenStack section of this document. If you did not have Administrator access to this Windows Virtual Machine, you must proceed with the steps in the next section.

Inject the VirtIO drivers

Even though you installed the VirtIO drivers on the original virtual machine, you will need to inject them into the QCOW2 image before trying to launch the image on OpenStack. You’ll do this using a program called guestfish on a Linux machine. Follow these steps:

If you are running guestfish on the Controller Node, you need to execute the following line so that guestfish knows where to locate qemu-kvm binary:

export LIBGUESTFS_QEMU=$(rpm -ql qemu-kvm | grep qemu-kvm$)

Upload the following files to the same location that you stored the VMDK file in the previous section:

At this point you are ready to upload your image to OpenStack. Since you’re already logged into the Controller Node, utilize the CLI to perform the upload as detailed in the upload images section.

Launch the new instance

At this point, you have a new Windows-based image that you can use to launch a new instance on OpenStack. You can accomplish this through the command-line or the OpenStack Horizon dashboard; we’ll use Horizon in this example. Follow these steps to launch the new image:

Log into the Horizon dashboard using the credentials from the Mirantis OpenStack Express dashboard or the Fuel control plane.

Navigate to Projects -> Instances.

Click the +Launch Instance button.

Enter the necessary information about your new instance. Make sure to specify your new image as the image for your new instance.

Click Access & Security and specify a keyfile, or create a new one.

Click Networking and drag one of the Available networks up to Selected Networks.