Skip to main content

On This Page

VMware to KVM Migration: Solving Disk Conversion and Driver Mismatches

2 min read
Share

These articles are AI-generated summaries. Please check the original sources for full details.

VMware to KVM migration guide — common pitfalls and how to avoid them

Python-T Point outlines a systematic approach to hypervisor migration focusing on disk format transformation and driver compatibility. Success depends on understanding why a 40GB virtual disk panics when its device major number shifts from SCSI to virtio-blk.

Why This Matters

Migration often fails not due to tool absence but because of subtle differences in emulated hardware layers, such as VMware’s BIOS/SCSI defaults versus KVM’s UEFI/virtio preferences. Misalignment leads to unbootable systems where the initramfs lacks the necessary modules to mount the root filesystem on a new bus type, resulting in a VFS mount failure.

Key Insights

  • qemu-img handles VMDK to QCOW2 conversion, allowing an 8GB used disk to consume only ~8.2GB space on a 40GB virtual volume through sparse allocation.
  • Stream-optimized VMDK files exported via OVF require re-serialization into a flat format using qemu-img before they can be successfully converted to QCOW2.
  • Paravirtualized networking via virtio-net reduces CPU overhead by approximately 30 percent compared to emulated NICs like the e1000.
  • Disk throughput can increase by 40 percent when switching from IDE/SATA controllers to the virtio-blk bus.
  • Kernel panics occur because Linux maps SCSI controllers to major device 8 (sda) while virtio-blk uses major device 252 (vda).

Working Examples

Standard conversion from VMware VMDK to KVM QCOW2 format.

qemu-img convert -f vmdk -O qcow2 /path/to/vm-disk.vmdk /path/to/vm-disk.qcow2

Libvirt domain XML configuration for a virtio-based disk.

<disk type='file' device='disk'>\n  <driver name='qemu' type='qcow2'/>\n  <source file='/var/lib/libvirt/images/vm-disk.qcow2'/>\n  <target dev='vda' bus='virtio'/>\n</disk>

Chroot rescue sequence to rebuild initramfs with virtio support.

mount /dev/vda1 /mnt\nmount --bind /dev /mnt/dev\nmount --bind /proc /mnt/proc\nmount --bind /sys /mnt/sys\nchroot /mnt\nupdate-initramfs -u

Practical Applications

  • System Recovery: Using a live ISO to chroot into a migrated VM to rebuild initramfs and update GRUB root device paths when the kernel cannot find /dev/vda.
  • Performance Optimization: Configuring virtio drivers to achieve 40 percent better disk throughput and 30 percent lower CPU overhead compared to emulated hardware.
  • Network Consistency: Pinning MAC addresses in the Libvirt XML to prevent network configuration failure in RHEL-based systems that bind ifcfg scripts to hardware IDs.

References:

Continue reading

Next article

How Abstracting GPU Selection Reduced AI Compute Costs from $5,000 to Pennies

Related Content