Skip to contentSkip to conversation

is LVM cluster-aware?

linux-lvm Tomasz Chmielewski 2 participants 3 messages Jan 24, 2008 – Jan 25, 2008

lore
Share & tools
lore
#0 lore raw

Is LVM cluster-aware? Of course it's not, but... Will I loose data if I have a LVM physical volume replicated on two machines with DRBD, and I want to access two separate logical volumes on different machines?

Machine_1
\ /--Logical_volume_1
DRBD-LVM2-PV
/ \--Logical_volume_2
Machine_2

On Machine_1 I only want to read/write to Logical_volume_1. On Machine_2 I only want to read/write to Logical_volume_2.

I don't want to add/remove/rename/resize/etc. any volumes - just access them on separate machines.

Perhaps the answer is: yes, you will loose your data, but I wanted to be sure ;)

Are there any workarounds to that (with just two volumes it's simple - don't use LVM; but let's suppose there are many logical volumes)?

Signature · 2 lines
Tomasz Chmielewski
http://wpkg.org
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Tomasz Chmielewski

Is LVM cluster-aware? Of course it's not, but... Will I loose data if I have a LVM physical volume replicated on two machines with DRBD, and I want to access two separate logical volumes on different machines?

LVM2 supports clustering with several generations of Red Hat cluster (RHEL4 cman, RHEL5 openais with dlm or gulm locking) via the clvmd deamon. Once a volume group is marked as clustered & the infrastructure is set up, the tools automatically lock and unlock LVM resources across the cluster. This prevents a tool running on one node from interfering with another tool running at the same time on a different node.

If you need it to work with another clustering environment you'll need to make code changes - see the code in daemons/clvmd/ for the existing cluster types.

Quoted 2 lines

I don't want to add/remove/rename/resize/etc. any volumes - just access them on separate machines.

As long as you never try to update the LVM metadata from two nodes at the same time (e.g. add/remove/rename/resize etc. running on two nodes simultaneously) then this is fine, but there is no automatic prevention of this situation.

If/when you do need to make changes, you'll want to make sure the VG you are working with is only active on one node.

See various threads on this mailing list & linux-cluster for further discussion of clvmd and using LVM in a clustered environment without it.

Regards,
Bryn.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFHmMsK6YSQoMYUY94RAiXoAJ9TAFF1QbQa6bK0aycb9udk5XvXiwCffQce T4mLoq+DEPWqOA2DODXVcuU=
=VzSD
-----END PGP SIGNATURE-----

#2 lore raw
Quoted 7 lines · Bryn M. Reeves
Quoted 2 lines

I don't want to add/remove/rename/resize/etc. any volumes - just access them on separate machines.

As long as you never try to update the LVM metadata from two nodes at the same time (e.g. add/remove/rename/resize etc. running on two nodes simultaneously) then this is fine, but there is no automatic prevention of this situation.

Thanks for the tips on clvmd and pointing to linux-cluster list archive - I'm about to dig into it.

Are you 100% sure LVM metadata is not updated when I don't add/remove/rename/resize/etc. any volumes?

I.e., won't lvs or pvs commands write or update some timestamps, for example?

Signature · 2 lines
Tomasz Chmielewski
http://wpkg.org