Virtualization is a great way to extend the utilization of hardware one's organization.Most of the companies today has virtualize their environment with VMware, HYPERV or other product. But what happened if for your reasons must convert your VMware Environment in HYPER-V or a specific task required to convert only one VMware client in HYPERV ?Previous month i face an issue that required to convert my Domain Controller from VMware to HYPER-V. The reason was that i didn't have a VMware Lab in different network to copy my Domain Controller but already i have configure a HYPERV Server as Test Environment. So i decide to convert my VMware Client in HYPER-V. I start my research and i found the Microsoft Virtual Converter tool.
<< I am not here to say that Microsoft is better than any other converting tool. But it's true that i prefer to work with tools from the same Company rather than a third company. If my task was to convert a HYPER-V client to VMware i will try to found a tool from VMware first. >>
If you want to read and learn more details for MVMC (Microsoft Virtual Machine Converter) you can open the Convert Linux Server to HYPER-V from ESX Server that i wrote after this article and describe how can convert a Linux Server to HYPER-V from MVMC Console.
Let's start step by step to explain how can do it.
- Download the Microsoft Virtual Machine Converter from
- Start the installation and follow the wizard with the default options.
- When finish the installation you can start the Application but today we will use Powershell Script to convert a VM from VMware in HYPER-V.
The reason is that we not proceed with the migration of all VMware Environment (ESX) but will convert only one VM.With a GUI Environment of Microsoft Virtual Machine Converter you can proceed only if you have vCenter Server,ESX or ESXI.So you can't convert on that way this time but we can proceeded with CLI to convert virtual hard disk and create the new VM.
How to Convert VMware(vmdk) to HYPER-V Disk(vhd)
- Restore your Virtual Machine from a Backup or Shutdown your VMWARE Client and copy the VM in different location.
It prefers to copy in the Server that you will use for HYPER-V.
- Open a Powershell as an Administrator
- Import the MVMC module with the following command.
Import-Module "C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1"
- Prepare the source path with vmdk disk of VMware and the destination path.
- Be carefull because if you download the full VM from Vmware it will create 2 vmdk files. Once with "-flat.vmdk" that has the size of the disk and one with ".vmdk" which is 1-2 kb. When you type the ConvertTo-MvmcVirtualHardDisk command to start the conversion use the path of the disk with ".vmdk" extension. Don't confuse it.
- If will use the path with file "-flat.vmdk" will get an error
ConvertTo-MvmcVirtualHardDisk : No suitable drive was found at path .........
- So Type the Command to start the convertion
ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath "C:\Users\user\Documents\temp\vm\pgdc.vmdk" -DestinationLiteralPath "C:\Users\Public\Documents\Hyper-V\Virtual hard disks\pgdc" -VhdType DynamicHardDisk -VhdFormat Vhd.
- Following is the standard command that you can use
SourceLiteralPath = It is the path with the vmdk file.
DestinationLiteralPath = It is the path for the new vhd disk..
VhdType =You can use FixedHarddisk OR DynamicHarddisk.
VhdFormat = the format of disk vhd or vhdx.
- Base on the size of VM it will take the necessary time to finish.
- When conversion complete you will get an output as follow.
Attach the converted VHD file in HYPER-V
If the conversion completed successful it's time to attach the converted vhd in HYPER-V.
Probably you are working in Lab Environment to test the VM. But in Lab Environment you are free to do lot of changes for improvements
- After finish the conversion open the Destination path and you will see a new file with the vhdx extension .
- Open the HYPER-V Manager
- Go in the right Pane Actions and click New - - >Virtual Machine
- You will open a new a Wizard to follow the steps.
- In the first Screen just click Next.
- Specify the Virtual Machine Name like Windows 7 or VM1. This is your decision.
If you want to store Virtual Machine in different Partition you must check in Store virtual machine in a different location.
For my Virtual Machines i have create a different partition in my Disk. So when create a new Virtual Machine i change the Default Path.
- Click Next.
- In this step leave the default options and click Next.
- Here assign the memory that you want to take Virtual Machine from your Physical PC. Be careful to give RAM that can support your Physical Machine. Do your calculations, type the number and Click Next.
- Click in Drop Down List and select the New Virtual Switch or Not Connection if you don't have LAN or you don't want to connect your Virtual Machine in LAN.
- Select Use an existing virtual hard disk. Click Browse and select the converted virtual hard disk.
- Click Next.
- Click Finish.
- Double click in New Virtual Machine.
- Click in Power on Button to Start.
- It will take more time to boot only for the first time.
- After finish successful the Migration from Esxi it's time to check if Integration Services are up to Date.
- What is Integration Services and where can find it? Read the Manage HYPER-V Integration Services to answer your questions and use HYPER-V as Professional.
We converted a VMware Client into HYPER-V.
Now it's time to take a look in Best Practices for Physical Servers hosting HYPER-V Roles and Security Recommendations for Hyper-v Host Servers to avoid downtimes and secure HYPER-V Hosts.
I hope to find interesting my article. Read and enjoy !!
Don't hesitate to do any comment her in Google+ or Facebook or send me an email in email@example.com. I will be there to discuss it.
Have a nice weekend!!