Convert Hyper-V VM vhdx to VMware vSphere vmdk

This turned out to be pretty simple, if pretty slow. I was converting from a Hyper-V 2012 R2 VM into vSphere 5.0. The VM itself was also running Windows Server 2012 R2.

There are a few steps and points to note:

  1. Download and install StarWind Converter
  2. Make sure you have plenty of disk space – of the various vmdk formats that StarWind Converter can output, the only one that is compatible with ESXi hosts is a full fat file – so it’ll take up the full amount of space even if the original vhdx file was thin provisioned and consequently smaller.
  3. Make sure you have fast disks and network connections. I had an 850GB VM to convert and even using 10Gb networks and SSD storage it still took hours and hours.
  4. Log on to the Hyper-V VM
    1. Make a note of the drive letter used by the CD/DVD drive
    2. Make a note of what the other drive letters are too. I suggest creating a file called Drive_<driveletter>.txt in the root of each drive to ensure things have stayed the same once the vSphere VM is up and running.
    3. Power off the Hyper-V VM you want to convert to vSphere.
  5. Fire up StarWind Converter and pick the source vhdx file – I pointed it directly at the vhdx file on the Hyper-V host via a UNC path.
  6. Pick the output file format to convert to – you want to choose “VMware ESX server image”
  7. Chose the filename and location for the vmdk file – put this on a separate disk/place to the source if possible – you want to maximise data throughput and minimise disk & network contention. The naming convention in vSphere datastores is <VM Name>.vmdk for the first disk, <VM Name>_1.vmdk for the second disk etc. so it helps if you use that convention here.
  8. Kick off the conversion and wait for it to finish. This will probably take a while.
  9. Now you’ll have pairs of vmdk files: <VM Name>.vmdk and <VM Name>-flat.vmdk. The former is the descriptor file and will be about 1KB, the latter is the actual data file and will be whatever size your Hyper-V VM thought its disk was.
  10. Now you need to create an empty vSphere VM. Place it on a datastore that has sufficient capacity for your newly converted vmdk files.
    1. It doesn’t matter what size you make the initial harddisk as we’ll remove it later anyway.
    2. Configure the VM with the same amount of RAM and number of CPUs as the Hyper-V VM had.
    3. Configure the NIC type to whatever you want, personally I always use VMXnet3. Set the port group to match the VLAN that the Hyper-V VM was on.
    4. I used the default SAS disk controller.
    5. Go into Options – and change the boot setting from BIOS to EFI. The default for new VMs is BIOS, so this is especially important as otherwise the vSphere VM will not boot.
  11. Once the VM is created, edit the settings and remove the harddisk, choose the option to delete the files from disk.
  12. Open the datastore browser and select the folder where your new VM lives. Upload the converted <VM Name>.vmdk file(s) and the associated <VM Name>-flat.vmdk file(s). This will take a while. Note that the datastore browser hides a lot of files, including the “*-flat.vmdk” files.
  13. Now edit the VM settings, and add a new disk. When prompted, choose the option to add an existing disk and browse to find the <VM Name>.vmdk file. Repeat for any additional _1.vmdk, _2.vmdk etc. disks.
  14. Power the vSphere VM on. Once Windows has started, log on and open Disk Management.
    1. You’ll need to change the CD/DVD drive letter to whatever it was in the Hyper-V VM.
    2. Next bring online any other disks and they should drop in with their correct drive letters.
  15. Now install VMware tools. If you’ve used the VMXnet3 NIC this will appear after the install so you can configure it with the correct IP details before rebooting the server to complete the tools install.
  16. Remove any old Hyper-V hardware from within the VM.
  17. That’s it.

If you wanted to change the vmdk type to thin provisioned afterwards you could migrate the VM to a different datastore and change the disk type as part of the migration.

Obviously don’t power the Hyper-V VM back on again once the vSphere one is up and running.

The key points here are:

  • StarWind Converter is very handy.
  • Change the VM boot type from BIOS to EFI or it won’t boot.
  • The process is very slow due to the amount of data (probably) involved. The 800GB VM took me the best part of a (working) day to convert from powering off the Hyper-V VM and having the vSphere one up and running and back in operation.

 

This entry was posted in Hyper-V, Storage, vSphere, Windows and tagged , , , , , , , , , , , , , . Bookmark the permalink.

One Response to Convert Hyper-V VM vhdx to VMware vSphere vmdk

  1. Roderick Decker says:

    Thank you! Great and very useful post!

    I also tried qemu-img for Windows, and it works perfectly.

    It’s free, portable and it runs under CMD.

    For example, to convert VHDX to VMDK:

    qemu-img.exe convert FileSource-Image.vhdx -O vmdk FileDestination-Image.vmdk

    Extracted from: http://www.sysadmit.com/2016/08/vmware-convertir-vhdx-en-vmdk.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s