Using KVM for testing multipath storage in Fedora 21

https://sharkcz.livejournal.com/12846.html

Having multipathed storage is quite common in the server world. Multipath means that a storage device is accessible for the host via multiple paths, usually via Fibre Channel links. But who has a FC array at home :-) Good thing is that this kind of setup can be tested also on your local host using a guest under KVM. I will now describe how this can be done using virt-manager.

I have started by updating my Fedora 20 system to the latest and greatest QEMU and libvirt from http://fedoraproject.org/wiki/Virtualization_Preview_Repository

then I created a empty guest

then added first disk with SCSI (virtio-scsi) type and set its serial number in “Advanced Options” pointing to a logical volume, see http://fedora.danny.cz/kvm-mpath-1.png

then I added second disk of the same type, pointing to the same logical volume (will work with disk image too) , you have to ignore the warning virt-manager gives you, and set the same serial number

as last step I updated the boot options so the guest would first boot from the disks, then from PXE

This is how the multipathed disk looks in libvirt’s XML guest description: …

/usr/bin/qemu-kvm 0001
0001
... When I booted the installation media, then I selected the detected multipathed disk as target device and left everything in defaults. After a while I got an installed system :-) [root@localhost ~]# multipath -l mpatha (0QEMU_QEMU_HARDDISK_0001) dm-0 QEMU ,QEMU HARDDISK size=20G features='0' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=0 status=active | `- 2:0:0:0 sda 8:0 active undef running `-+- policy='service-time 0' prio=0 status=enabled `- 2:0:0:1 sdb 8:16 active undef running When you are not a friend with virt-manager, then you can achieve similar result by using the following command: qemu-kvm -m 1024 -device virtio-scsi-pci,id=scsi -drive if=none,id=hda,file=foo.img,serial=0001 -device scsi-hd,drive=hda -drive if=none,id=hdb,file=foo.img,serial=0001 -device scsi-hd,drive=hdb

Updated: