Before start I would like to point out that if this is a Linux VM you are doing, then because there will be a complete hardware change you may end up with unbootable clone, which can be fixed. This did not happen to me though, but in the end of this article I will also point those things out as potential issues.
So let us begin:
1. Export the VM from the Hyper-V host
For those of you familiar with Hyper-V the export feature on the VM comes in really handy, and after it finishes you are left with the VM to import. Among the files you can find the VHD hard disk file and that is all you need to proceed further. We can use that VHD and convert it to VMDK disk file which is the VMware disk format.
You can use any software to converted the disk from VHD to VMDK. The software which I used was called StarWind V2V Converter.
2. Convert the VHD disk to VMDK disk type:
Use the StarWind converter or something else of your choice to convert the disk to VMDK. We will use that VMDK to create our VM.
3. Upload the disk type to the vSphere Datastore
This is pretty much straightforward. After the upload is finished we can begin with creating our VM.
4. Recreate the VM in the vSphere
This is something that you should be careful with. Because this is a Linux VM in question we have to be careful to match the hardware on the first start.
Check and verify the settings with the original VM from the Hyper-V. Make sure that you match the number of CPUs. I would recommend to match the number of Network Cards as well.
Now recreate the VM with those same settings. After the initial boot you can add more CPU sockets and other hardware.
Remove the original disk and select the Existing Hard Disk option and select the VMDK disk you previously uploaded.
5. Power on the VM
After you power on the VM if the power on is successful and the VM boots successfully then you are done. In many cases you may end up without network connection on the VM. If that is the case than just create a new ifcfg-ethX file in /etc/sysconfig/network-scripts with your desired settings.
Alternatively there are two boot related potential problems that can occur at this time.
If you are experiencing boot problems than read on:
Boot problem 1 - Unable to power on the VM in the vSphere client
Depending on the settings that you've chose during the conversion of the VHD to VMDK you may end up with a VMDK that is for VMware Workstation rather then for ESXi. When you attempt to power on that VM you will end up with an error message:
Failed to open disk scsi0:0: Unsupported or invalid disk type 7. Ensure that the disk has been imported.
In that case follow this guide on the VMware KB (KB 1028943) which tells you how to convert the VMDK from VMware Workstation type to ESXi type.
Basically you can use either the ESXi command line or VMware Converter to do that. I would recommended using the ESXi CLI commands but if you are afraid of the CLI than you may use the VMware Converter as well.
This is what I would do, and it would be supper easy and fast:
WARNING: The bellow procedure will clone the existing disk. Make sure that you have enough space on the datastore or if you are short on space you may end up filling all of the space.
# cd /vmfs/volumes/f614ea11-a1d75394/VMCentos
/# vmfs/volumes/f614ea11-a1d75394/VMCentos # vmkfstools -i vmcentos.vmdk vmcentos-new.vmdk
Destination disk format: Thin
Cloning disk 'vmcentos.vmdk'...
Clone: 100% done.
Boot problem 2 - The VM Powers on successfully and begins the booting process but suddenly halts with a kernel panic error
Use this article to do that:
CentOS Tip and Tricks | Creating a New Initial RAM Disk
It is recommended that if you are doing this you use the exact same installation disk, for the exact same Linux version.