One method for migrating to an ESXi (VMware) hypervisor involves converting KVM or Xen disks using the qemu-img
disk utility, which is part of the QEMU virtualization system (download distributions here).
Conversion Command
Execute the following command with the specified parameters:
qemu-img convert -f qcow2 -O vmdk -o adapter_type=lsilogic,subformat=streamOptimized,compat6 xen-or-kvm-disk.qcow2 converted-disk.vmdk
Prerequisites:
-
The source disk must be in
qcow2
format -
The virtual machine using this disk must be powered off
Post-Conversion Steps
-
Copy the converted disk to your ESXi host
-
Use VMware's disk management utility to optimize the disk:
vmkfstools -i converted-disk.vmdk my-new-vm-disk.vmdk -d thin
Important Notes:
-
Xen Paravirtualization:
If migrating from Xen, the VM might be in paravirtualization mode, requiring a kernel replacement to run on ESXi. -
Fedora/RHEL/CentOS Migration:
These distributions store disk UUIDs ininitramfs
. If needed, regenerate it in rescue mode by executing: dracut --regenerate-all --force