[linux-lvm] Is cLVM necessary when accessing different logical volumes on a shared iSCSI target?

Christian Schröder cs at deriva.de
Wed Jul 3 13:07:58 UTC 2013


Hi Matthew,
thank a lot for your helpful comments. Unfortunately, it seems that I did not describe in enough
detail what I want to achieve ...

 >> and it is always visible, but unavailable to the other client.
 >> So far, everything seems to work fine. Now my question is: Is this setup
 >> sufficient or do I need cLVM?
 > You don't need cLVM just as long as you never screw up. It's been a while since I played with just such a setup but,
 >
 > 1) edit lvm.conf and disable all metadata caching

I have searched the lvm documentation, but could not find anything about metadata caching.
I did find some notes about the the Metadata Daemon (lvmetad), but it does not seem to be used by default.
Could you give me a hint which setting should be used to disable caching?

 > 2) edit lvm.conf and set the locking style to '4' and set wait_for_locks=0

The clients have a local volume group besides the shared one. Setting the locking style to 4 prevents
modification of this local volume group, too, so it does not seem to be an option.

 > The main complication is with (de)activating LV and assigning it to the other host. I forget what happens if you do an 'lvchange -ay ' on a common LV and the other host has already done so. In any event you'll want to make sure all LVs are NOT automatically activated (default) on bootup.

Each LV is statically assigned to one single host. I do not plan to detach a LV from one host and assign
it to the other. I simply want to give the same (large) volume group to both hosts so each of them can
create its own (private) LVs in it.

 > The best option is to implement your own locking module (ie. repurpose the negotiation/handshake/quorum code from eg. CARP) and your locking module just checks to see if "am I master? T or F" and punts if not. More than a handful of hosts and I would spend the energy getting cLVM working. Though it took me way longer than it should have to get things to stop hanging for all eternity (kernel messages about stalled threads and what not) and for it to behave correctly even if I willy-nilly power-reset the boxes.

As I tried to describe above, the hosts do not behave as master or slave. That's why I would not actually
talk about a cluster. Instead, the iSCSI target should behave like some kind of network storage (like,
let's say, NetApp) that provides a huge disk (i.e. volume group) in which the clients can create their LVs
without any further dependencies between each other.
Is this possible with or without cLVM?

Regards,
Christian

-- 
Deriva GmbH                         Tel.: +49 551 489500-42
Financial IT and Consulting         Fax:  +49 551 489500-91
Hans-Böckler-Straße 2                  http://www.deriva.de
D-37079 Göttingen

Amtsgericht Göttingen | HRB 3240
Geschäftsführer: Dirk Baule, Christian Schröder
Deriva CA Certificate: http://www.deriva.de/deriva-ca.cer




More information about the linux-lvm mailing list