The GUI wizard offered by Microsoft Virtual Machine Converter can easily perform conversions, but the tool also...
provides the necessary PowerShell cmdlets to perform VMDK to VHDX conversions from the command line.
There are several reasons you might want to convert a VMware VM to a Hyper-V VM. One of the most common reasons is if you're in the process of migrating your whole environment from VMware vSphere to Microsoft Hyper-V. Or you might have opted to use Azure cloud services and now you want to move VMware workloads to the Azure IaaS cloud.
VMware VMs aren't supported by Azure, so you must convert VMDK to VHDX files. Follow the steps below to convert them.
Step 1: Download Microsoft Virtual Machine Converter (MVMC) 3.0, then install it.
Step 2: Open a PowerShell window and change the directory to C:\Program Files\Microsoft Virtual Machine Converter. Next, import the PowerShell module that ships with MVMC by executing the command below:
Once you import the module, you have several PowerShell cmdlets that can perform all kinds of conversions, including changing the generation of the converted VMDK files.
Step 3: Now that you have imported the MVMC PowerShell module, execute the ConvertTo-MvmcVirtualHardDisk PowerShell cmdlet.
Let's assume you have a VMDK file that needs to be converted to be usable with Hyper-V, and the VMDK resides in C:\Temp\VMX folder. To convert the VMDK to VHDX, use the PowerShell command below:
ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath C:\Temp\VMX\OSDisk.VMDK -VHDType DynamicHardDisk -VHDFormat VHDX -Destination C:\Temp\VHDX\OSDisk
As you can see, you're telling the command that the VMDK file needs to be converted to VHDX by adding the -VHDFormat parameter. The resulting file is saved under C:\Temp\VHDX as OSDisk.VHDX. There is no need to add the .VHDX extension after the new file name.
VM conversion might fail due to several issues. MVMC generates a log file by the name of MVMC.LOG that is available under the C:\Temp folder. If the conversion fails, open the log file and look for error or warning strings.
Dig Deeper on P2V, V2V and V2P migration
Related Q&A from Nirmal Sharma
There isn't a set number of virtual processors you should configure for a Hyper-V VM, but there are steps you can take to ensure your workloads ... Continue Reading
VHD File Set -- a file format new to Windows Server 2016 -- is helpful for IT administrators using guest clusters. Get up to speed on the basics and ... Continue Reading
Save time by using PowerShell commands to reconnect your VMs to a new Hyper-V virtual switch. Different commands can access single VMs or many VMs ... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.