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:
- Download and install StarWind Converter
- 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.
- 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.
- Log on to the Hyper-V VM
- Make a note of the drive letter used by the CD/DVD drive
- 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.
- Power off the Hyper-V VM you want to convert to vSphere.
- 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.
- Pick the output file format to convert to – you want to choose “VMware ESX server image”
- 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.
- Kick off the conversion and wait for it to finish. This will probably take a while.
- 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.
- Now you need to create an empty vSphere VM. Place it on a datastore that has sufficient capacity for your newly converted vmdk files.
- It doesn’t matter what size you make the initial harddisk as we’ll remove it later anyway.
- Configure the VM with the same amount of RAM and number of CPUs as the Hyper-V VM had.
- 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.
- I used the default SAS disk controller.
- 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.
- Once the VM is created, edit the settings and remove the harddisk, choose the option to delete the files from disk.
- 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.
- 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.
- Power the vSphere VM on. Once Windows has started, log on and open Disk Management.
- You’ll need to change the CD/DVD drive letter to whatever it was in the Hyper-V VM.
- Next bring online any other disks and they should drop in with their correct drive letters.
- 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.
- Remove any old Hyper-V hardware from within the VM.
- 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.