Covert VMDK to Hyper-V VHD
A customer, who is a VMWare shop, gave me a VMDK file of one of their VMs for development purposes. I don’t have VMWare, but I do have Hyper-V on my dev boxes, so I needed to convert the VMDK virtual disk to a format I could connect to a Hyper-V VM.
Microsoft offers a VMWare VM conversion kit: http://www.microsoft.com/en-us/download/details.aspx?id=42497
The link above has a System Requirements section, please ensure your environment meets them before using the kit.
The kit has several pieces to help you convert a VMWare disk to a Hyper-V (or an Azure IaaS) VM compatible VHD format. There is a nice GUI wizard that will connect to the VMWare host, connect to a Hyper-V host, and convert the machine right across live.
In my case though, I just had the VMDK given to me by the customer. For this type of task, the kit has a whole set of PowerShell commands in a module. To get access to the commands in a PowerShell session, you need to import the module that defines them. Assuming the default kit install directory, you can use this command to import the module from a PowerShell command prompt:
Import-Module 'C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1'
With the module imported, several PowerShell commands are made available to perform all kinds of conversion tasks. I used the below command to convert the VMWare VMDK files to VHD. Note that you’ll need to use your own directories and file names for the –SourceLiteralPath and –Destination arguments.
ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath d:\scratch\vmx\VM-disk1.vmdk -VhdType DynamicHardDisk -VhdFormat vhdx -destination c:\vm-disk1
Something to keep in your back pocket should you ever hit this situation.
I have also heard good reports about this tool from Starwind