This guide outlines the process for migrating a virtual machine (VM) from Microsoft Hyper-V to an OpenStack environment.
- Certified Guest Operating Systems in Red Hat OpenStack Platform
- virtio-win drivers installation guide
- Cloudbase cloud-init for Windows page
- Windows Instances Cloud Init Guide
- Access to the Hyper-V environment and the OpenStack environment.
- Installation of
virtio-win
drivers on the Windows VM for KVM compatibility. - Tools for VM conversion (like
qemu-img
).
- Prep-work for the VM in Hyper-V
- Export the VM Disk from Hyper-V
- Convert the VM Disk to a Compatible Format
- Upload the Converted Image to OpenStack
- Create a New Instance in OpenStack Using the Uploaded Image
- Select the default options for the driver components and select YES when the unsigned driver prompt appears. Please see the unsigned public repo information available here: https://github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md#virtio-win-driver-signatures
- This configures the user that cloudbase-init will install and use. The purpose of this account is to create control linkage between OpenStack and the windows instance to provide first-time-boot configuration "as required".
- If the VM is going to be used as a general purpose template for subsequent VMs then both sysprep and shutdown after installation should be selected. If the vm is just being migrated as-is then both can be left unchecked.
- In Hyper-V Manager, right-click the VM and select "Export."
- Choose a location to save the exported files.
- Provide Unix team the source.vhdx for conversion
- Alternatively:
- To export VM via PowerShell, type the command below:
Export-VM -Name \<vm name\> -Path \<path\>
-
Use
qemu-img
or similar tool to convert the VM disk to a RAW format.qemu-img convert -p source.vhdx -O raw destination.raw
-
Use the OpenStack CLI or Horizon dashboard to upload the RAW image.
openstack image create "VM_Name" --file destination.raw --disk-format raw --container-format bare --public
-
Launch a new instance in OpenStack using the uploaded image.
openstack server create --image VM_Name --flavor b1.medium --network private_network VM_Instance_Name
- For details on Windows guest bootstrap and cloud-init, see the Windows Instances Cloud Init Guide.
- After migration, verify the functionality of the VM in the OpenStack environment.
openstack server show VM_NAME
- Ensure
virtio
drivers and cloudbase-init are correctly installed for proper functionality.