Migrating an ESXi Host to HyperV w/ Microsoft Virtual Machine Converter
I’ve been doing these a lot lately. Converting clients from ESXi free to HyperV on Server 2012 R2. This post is a bit unfair, as ESXi free is well, free, and Server 2012 R2 is $800. You could easily spend many, many thousands for ESX Standard/Essentials/Enterprise/etc.
This process uses the Microsoft Virtual Machine Converter freebie Powershell modules making for an ultra-fast conversion between VMDK to VHD.
Reasons we are converting hosts from ESXi free to Hyper V.
- We take over IT from another MSP, who does a lazy and incompetent job that I get to clean up for my client.
- The ESXi hosts I usually see often have a poorly configured RAID. RAID5 for 8 disks for a SMB client too many times to count. Wiping it anyways affords this opportunity.
- Replacing PERC cards, (PERC310 – the worst RAID card I’ve ever used, not fit for a low-end-desktop).
- AD/FS/DHCP/DNS/Exchange/SQL all-in-one why not? Separation of roles for the client.
- A 2012 R2 Standard license includes one HyperV host license, and TWO Server 2012 R2 Standard VM licenses. Since we are buying 2012 R2 for VMs to use under ESXi anyways, we already *paid for* a full-featured hypervisor, may as well use it.
- More power, ESXi limits each VM to 8 vCPUs, while HyperV has no vCPU core limits. Older ESXi (<5.1) had a 32GB RAM limit.
- Windows, I get a GUI with powershell, and don’t have to suffer through unclear and useless VMWare documentation and their awful esx-cli. If I need it minimal, just run Server Core.
- Easy, easy, easy clustering and failover.
- Inability to access the ESXi API for third-party apps with ESXi free. Generally an issue for backup software that isn’t provided by VMWare (Veeam), or making virtual-standbys (AppAssure).
- Easier to make changes. We had to restrict ourselves to the old ESXi v8 hardware to easily make changes, any version higher and you have to use the web-editor or vCenter to make changes. Not fun to undo for a small business who can justifying buying vCenter.
- Simpler remote-access. Able to use HyperV Manager, RDP in, or use an agent to directly access the HyperV host, no need for vSphere or vCenter. HyperV Host can have its own DNS to reach out to the internet if all the VMs need to be off.
The down and dirty, the process.
HAVE-A-BACKUP, Extract the VMDKs
We take a NAS on-site and make a share. As the vSphere storage download/file-browser utility can’t resume a download, can randomly crap out, and is slow, I install a FTP service via Putty and then use FileZilla to copy out ALL VMDK files. Just switching from the vpxclient.exe VSphere app to FileZilla changes transfer rates from 35MBps to 90MBps. Confirm you don’t have any running VMWare snapshots.
#Enable SSH via vSphere Client
ESXi Host > Configuration > Security Profile > Services > Properties > SSH > Start
#Putty in to the ESXi host
#FTP in (FileZilla) your standard login, (usually root/password), and download the root folder containing all your files to the NAS (or USB 3.0 HDD), though we really only need the VMDKs.
$In the worst case, you can use the Datastore browser and try to download the VMDKs. Veeam's FastSCP is now built into their, no-joke, 1.2GB Veeam Backup installer that is pure bloatware.
When you are absolutely 100% sure you’ve got a full copy of ALL VMDKs, a backup, and your license keys written down.
Wipe the RAID
On a Dell Server, hit Ctrl+R on boot prompt to jump into the PERC RAID manager.
How you arrange your RAID virtual disks and spindles depends on the purpose of the server. SQL and RDS servers generally go RAID10. For a single simple DC and file-server, RAID6 is fine.
For this SMB client with only 600GB of data, with 5x 1TB HDDs and two VMS (SQL and DC/FS). We are going: RAID10 (4x) + 1x Global Hotspare.
RAID Virtual Hard Disks will be 100GB for HyperV host and its ISOs, then the remaining storage in another ~1.9TB disk for VMs.
Install Server 2012 R2, add HyperV Role, set a static IP/DNS, start Windows Updates.
Copy back your VMDKs to the HyperV Host.
Install Microsoft Virtual Machine Converter 3.0+. (https://www.microsoft.com/en-us/download/details.aspx?id=42497)
Here is the problem. MVMC is more meant for moving VMs with Microsoft System Center, and despite its name can make converting VMs very painful. However, the GUI is just a front-end for the installed-modules. Some simple code, and you will see a conversion run at the max speed your disks can handle 🙂
A big gotcha!
There are TWO .VMDK files that you need.
The flat contains the data, the lesser file (usually 1KB) is the acting drive, that is a descriptor for the real data file. Run your command on the lesser file.
#If you've got anything below Win8/2012, use VHD. Win8/2012+ use VHDX.
#For converting standalone VMWare VMDKs into HyperV VHDs
#Powershell as Administrator
import-module ""C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1""
#Some Switch Options:
-vhdformat vhdx (Needed for disks bigger than 2TB)
-vhdtype FixedHardDisk (also called Thick Provisioning in VMWare)
-vhdtype DynamicHardDisk (also called Thin Provisioning)
convertto-mvmcvirtualharddisk -sourceliteralpath "E:\HYPERV\VHD\machinename.local.vmdk" -destinationliteralpath "E:\HYPERV\VHD\" -vhdformat vhd -vhdtype DynamicHardDisk
Once it’s going, you’ll get a pretty powershell progress bar to slowly watch.
Within HyperV Manager, create a new VM, pick the matching specs (vCPUs, RAM, NIC, etc), and add an already existing disk. The disk you just created!
Go ahead and boot the VM, expect a license-verification or re-activation as the virtual hardware just changed.
It is not uncommon for the *first* boot sequence to be very slow, especially for Exchange servers. You could just see a black screen in the HyperV Console for the VM. The VM is basically waiting for timeouts on some services before continuing, generally no longer than 15-20 nail-biting minutes. After boot, run the integration services disk to install your new virtual-hardware, then reboot the VMs. After you get through your the reboot and activation, your VMs should be happy and healthy.