[linux-lvm] How to implement live migration of VMs in thinlv after using lvmlockd

David Teigland teigland at redhat.com
Tue Nov 1 17:57:56 UTC 2022

On Wed, Nov 02, 2022 at 01:02:27AM +0800, Zhiyong Ye wrote:
> Hi Dave,
> Thank you for your reply!
> Does this mean that there is no way to live migrate VMs when using lvmlockd?

You could by using linear LVs, ovirt does this using sanlock directly,
since lvmlockd arrived later.

> As you describe, the granularity of thinlv's sharing/unsharing is per
> read/write IO, except that lvmlockd reinforces this limitation for the lvm
> activation command.
> Is it possible to modify the code of lvmlockd to break this limitation and
> let libvirt/qemu guarantee the mutual exclusivity of each read/write IO
> across hosts when live migration?

lvmlockd locking does not apply to the dm i/o layers.  The kind of
multi-host locking that you seem to be talking about would need to be
implemented inside dm-thin to protect on-disk data structures that it
modifies.  In reality you would need to write a new dm target with locking
and data structures designed for that kind of sharing.


More information about the linux-lvm mailing list