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

Digimer lists at alteeve.ca
Thu Feb 20 21:07:08 UTC 2014


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?

Thanks!

-- 
Digimer
Papers and Projects: https://alteeve.ca/w/
What if the cure for cancer is trapped in the mind of a person without 
access to education?




More information about the Linux-cluster mailing list