How to share ‘a disk’ to more than one VM using libvirt.? Or What ‘sharable’ flag do in libvirt ?

Libvirt provides support for ‘sharing a disk with mulitple VMs’, even virt-manager utililty has the support for it. How-ever there is a common misunderstanding that, once you enable ‘sharable’ it is done and you can concurrently write data to it. Please note that, the <shareable/> flag tells libvirt that the disk will be *concurrently*
accessed by multiple VMs. This means that the hypervisor will not try to
take an exclusive lock on the disk, that all I/O caching is disabled,
and any SELinux labelling allows use by all VMs.


If you are marking a disk as <sharable/> you need to know what you
are doing in the guest OS. You would typically use a cluster filesystem
on the disk like GFS or OCFS. Attempts to use a normal FS like ext3 ( which is not a cluster aware FS) can corrupt your data

Leave a Reply

Your email address will not be published. Required fields are marked *