Migrating from IDE to VIRTIO disk for existing disk

Latest response

For migrating existing disk devices from IDE to VIRTIO, after changing xml file from hda to vda as below guest OS (RHEL5) is not booting, getting as "No VolGroups found" and kernel panic

<disk type='file' device='disk'>
   <source file='/var/lib/libvirt/images/disk1.img'/>
   <target dev='vda' bus='virtio'/>
</disk>


Virtualization: KVM

Guest OS: RHEL5 disk configured with LVM

Host OS: RHEL 6.3

Responses

You have to have the virtio driver in the guest initrd image for it to boot properly.

 

Change it to hda in the xml file, boot the guest and recreate initrd image by including virtio driver in it. Use that initrd image to boot the guest.

While libvirt is not exactly RHEV, this is not a hard question. You need to boot the VM using an attached LiveCD or RHEL rescue ISO, and update grub and fstab to use virtio disks instead of ide. 

 

IDE disks are seen by the guest as /dev/hdX while virtio as /dev/vdX

Thanks for your reply..

 

Could you please let us know the steps to recreate initrd image?

Add below line to /etc/modprob.conf of the guest.

 

alias scsi_hostadapter2 virtio_blk

 

Recreate initrd image using "mkinitrd -v -f /boot/initrd.img `uname -r`"

 

Edit /boot/grub/grub.conf and create a new boot entry using the above initrd image.