Hello,
As we know, libvirt sanlock support file type storage. I wonder if it supports network storage.
I tried iSCSI, but found it didn't generate any resource file:
Version: qemu-2.10 libvirt-3.9 sanlock-3.5
1. Set configuration:
qemu.conf:
lock_manager = "sanlock"

qemu-sanlock.conf:
auto_disk_leases = 1
disk_lease_dir = "/var/lib/libvirt/sanlock"
host_id = 1
user = "sanlock"
group = "sanlock"


# systemctl restart sanlock
# systemctl restart libvirtd

2. Start a VM with iSCSI disk and check resource file
VM disk xml:
    <disk type='network' device='disk'>
      <driver name='qemu' type='raw'/>
      <source protocol='iscsi' name='iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.cb4bfb00df2f/0'>
        <host name='xx.xx.xx.xx' port='3260'/>
      </source>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>

Start VM:
# virsh start iscsi
Domain iscsi started

Check resource file:
# ls  /var/lib/libvirt/sanlock
__LIBVIRT__DISKS__

No resource file generated.

So, does libvirt sanlock only support file or block type storage?



--
Han Han
Quality Engineer
Redhat.

Email: hhan@redhat.com
Phone: +861065339333