sharkcz (sharkcz) wrote,

Using KVM for testing multipath storage in Fedora 21

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

  • 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

  • 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:
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/Linux/kvm-tmp'/>
      <target dev='sda' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/Linux/kvm-tmp'/>
      <target dev='sdb' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>

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
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


  • Multi-arch solution for scanning

    You might know that I am using a Power9-based Talos II system running Fedora as my primary workstation not only for my job's duties. One of the few…

  • Why it's useful to use a deskop on ppc64le

    I want provide a short example what I've met in the past weeks when dog-fooding a ppc64le Fedora desktop environment on my OpenPOWER based Talos…

  • How to debug weird build issues

    When working on a secondary arch Fedora like s390x, we witness interesting build issues sometimes. Like a sudden test failure in e2fsprogs in…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded