How to Migrate a Linux VM from VMware ESXi 8 to SolusVM2 (KVM) with LVM: Step-by-Step Using QCOW2 and Troubleshooting Dracut/LVM Boot Errors


Migrating a Linux VM from ESXi 8 to SolusVM2 (KVM) can involve a few tricky steps, especially if your guest system uses LVM for storage. This blog post demonstrates the full migration workflow using demo filenames, and covers how to resolve common boot issues like dracut-initqueue timeouts related to missing LVM volumes.
1. Understanding the ESXi VM Disk Files
In your ESXi VM folder, you’ll typically see files such as:
demo-vm_1.vmdk
(small descriptor file)demo-vm_1-flat.vmdk
(large disk data file)
For migration, you only need the matching descriptor and flat file for the active disk.
2. Preparing the Migration
Step 1: Copy VMDK Files to a Linux Machine
First, transfer the disk files from your ESXi server to a local Linux system using SCP/NFS:
scp root@esxi-host:/vmfs/volumes/.../demo-vm_1.vmdk /tmp/
scp root@esxi-host:/vmfs/volumes/.../demo-vm_1-flat.vmdk /tmp/
The descriptor (
demo-vm_1.vmdk
) must reference thedemo-vm_1-flat.vmdk
file and both should be in the same directory for conversion.
Step 2: Convert VMDK to QCOW2 Format
SolusVM2 (KVM) works best with QCOW2 disk images. Use qemu-img
to convert:
sudo apt update
sudo apt install qemu-utils
cd /tmp
qemu-img convert -f vmdk -O qcow2 demo-vm_1.vmdk demo-vm_1.qcow2
The resulting demo-vm_1.qcow2
contains your VM’s disk, ready for import.
3. Importing to SolusVM2
Step 3: Upload QCOW2 Image to SolusVM2 Node
Transfer your QCOW2 disk to the KVM node’s image directory:
scp demo-vm_1.qcow2 root@solusvm-kvm-node:/var/lib/libvirt/images/
Step 4: Create the VM in SolusVM2
Log in to the SolusVM2 admin panel.
Create a new KVM VM, setting CPU, RAM, and Network as needed.
For disk, select “use existing image” if available, or create a VM with a blank disk and replace that disk file with your
demo-vm_1.qcow2
via SSH.Ensure the disk file ownership is correct (e.g.,
chown qemu:qemu demo-vm_1.qcow2
).
4. Troubleshooting Dracut Initqueue Timeout (LVM Boot Issues)
The Problem
After migration, you may encounter errors like:
dracut-initqueue: timeout, still waiting for following initqueue hooks: /dev/mapper/demo-root /dev/demo-vg/swap
This means the initramfs (dracut) cannot find the root and swap LVM volumes.
Step 5: Recovery Workflow
A. Boot into Rescue Mode
If you’re dropped into a
dracut:/#
shell, you can start recovery directly.Otherwise, boot from a rescue ISO (CentOS, AlmaLinux, Rocky, Fedora, etc.)
B. Check Disk Detection
lsblk
fdisk -l
If the disk isn’t detected, try changing the VM’s disk controller (Virtio, SATA, SCSI) in SolusVM2.
C. Scan and Activate LVM Volumes
vgscan
lvscan
vgchange -ay
If /dev/mapper/demo-root
and /dev/demo-vg/swap
appear, your volumes are present.
D. Inspect and Fix /etc/fstab and GRUB
Mount your root volume:
mount /dev/demo-vg/root /mnt
cat /mnt/etc/fstab
Ensure device names or UUIDs match the actual LVM devices (
blkid
helps).Update
/etc/fstab
if needed.
E. Rebuild Initramfs
Chroot into your root volume and rebuild the initramfs for new hardware config:
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
dracut --force
exit
umount /mnt/{dev,proc,sys}
umount /mnt
F. Update GRUB Bootloader (Optional)
chroot /mnt
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-install /dev/vda # or your disk device
exit
G. Reboot and Test
Reboot the VM. If boot fails, repeat the checks above.
5. Tips and Common Pitfalls
Disk Not Detected? Change SolusVM2 disk bus to Virtio, SATA, or SCSI.
LVM Names Changed? Check with
vgs
andlvs
and update/etc/fstab
.UUID Mismatch? Use
blkid
to verify and fix/etc/fstab
.LVM Not Activating? Force scan or review
/etc/lvm/lvm.conf
.
6. Conclusion
Migrating a Linux VM from ESXi to SolusVM2 using QCOW2 is a reliable process if you prepare disk files properly and understand storage layers. The most common post-migration issue is dracut failing to find your LVM root volume—address this by scanning/activating LVM, rebuilding initramfs, and verifying disk controller compatibility.
Follow these steps for a seamless migration and fast recovery from boot issues!
Questions, comments, or troubleshooting tips? Add them below!
Subscribe to my newsletter
Read articles from KUMAR BISHOJIT directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
