[Linux-cluster] Creating clustered LVM snapshots, locking and exclusivity

Vladislav Bogdanov bubble at hoster-ok.com
Fri Feb 21 10:25:58 UTC 2014


21.02.2014 00:07, Digimer wrote:
> Hi all,
>   I want to get clustered LV snapshotting working. I was under the
> impression it was simply a matter of disabling the LV on the other node
> (2-node cluster here). However, this fails because of locking issues.
>   I can change the peer node's LV to 'inactive' with (confirmed with
> lvscan):
> [root at an-c05n01 ~]# lvchange -aln /dev/an-c05n02_vg0/vm01-rhel2_0
> [root at an-c05n01 ~]# lvscan
>   inactive          '/dev/an-c05n02_vg0/vm01-rhel2_0' [50.00 GiB] inherit
>   But I still can't create snapshot on the other node running the VM:
> [root at an-c05n02 ~]# lvcreate -L 25GiB --snapshot -n
> vm01-rhel2_0_snapshot /dev/an-c05n02_vg0/vm01-rhel2_0
>   vm01-rhel2_0 must be active exclusively to create snapshot
> So I try to set it exclusive:
> [root at an-c05n02 ~]# lvchange -aey /dev/an-c05n02_vg0/vm01-rhel2_0
>   Error locking on node an-c05n02.alteeve.ca: Device or resource busy
> If I stop the VM running on the LV, then I can set the exclusive lock,
> boot the VM and later create the snapshot fine:
> [root at an-c05n02 ~]# lvcreate -L 25GiB --snapshot -n
> vm01-rhel2_0_snapshot /dev/an-c05n02_vg0/vm01-rhel2_0
>   Logical volume "vm01-rhel2_0_snapshot" created
> But then later, I can't remove the exclusive value, so I can't re-active
> the LV after deleting the snapshot. I have to shut the VM down again in
> order to remove the exclusive flag.
> I'm assuming it's possible to snapshot clustered LVs while they're in
> use, without stopping what is using them twice... Can someone help
> clarify what the magical incantation is?

First patch from this series should

I support that for myself and have that reworked and ported to .102, so
please contact me if you need newer patches (iirc they have some fixes
as well).

As you see, I tried to push that into upstream LVM, but I'm strongly
disagree with some points I got in replies from core LVM devs, so I wash
my hands.


More information about the Linux-cluster mailing list