cancel
Showing results for 
Search instead for 
Did you mean: 

Clustered volume group

常有慈悲心
Regular Advisor

Clustered volume group

Today I mistaked to add cluster attribute to a VG using following command:
vgchange -c y vgname
But this is an SUSE linux system. After that, I tried to failover the package to the other node, it kept on reporting can not activate this vg, then failover failed.
Could anyone help me how to recover the attribute of this vg to normal one?
Thanks!!!
5 REPLIES
Matti_Kurkela
Honored Contributor

Re: Clustered volume group

You enabled the cluster bit on the VG, so now it would normally be necessary to have clvmd installed and running to disable it or to manipulate the VG in any way. As you probably don't have the SuSE cluster infrastructure running (e.g. you have Serviceguard instead), you must override the LVM locking to disable the cluster bit.

Try this command:

vgchange -c n vgname --config 'global {locking_type = 0}'

MK
MK
Ralph Grothe
Honored Contributor

Re: Clustered volume group

Matti, just out of curiosity, is --config an undocumented option of vgchange (which isn't mentioned in its manpage) that allows you to pass overriding vg-related lvm.conf directives in situ?

Shouldn't clvmd require a type 3 locking?

# grep -B8 ^[^#]*locking_type /etc/lvm/lvm.conf

# Type of locking to use. Defaults to local file-based locking (1).
# Turn locking off by setting to 0 (dangerous: risks metadata corruption
# if LVM2 commands get run concurrently).
# Type 2 uses the external shared library locking_library.
# Type 3 uses built-in clustered locking.
# Type 4 uses read-only locking which forbids any operations that might
# change metadata.
locking_type = 1



Since in our RHCS clusters we so far only use so called active-passive volumes aka HA LVM managed ones we actually have no use for clmvd and thus operate with type 1 locks on the cluster nodes.

# lvm dumpconfig|grep locking_type
locking_type=1
Madness, thy name is system administration
Matti_Kurkela
Honored Contributor

Re: Clustered volume group

Ralph, clvmd _provides and manages_ type 3 locking.

Without setting up a native SuSE cluster infrastructure, it is not possible to start clvmd and have it work.

When the VG is in cluster mode (after vgchange -c y) it normally requires cluster-wide locks to operate it - even for switching the cluster mode off. Type 1 locking cannot provide such a lock.

To disable accidentally-enabled cluster mode on a VG without a lot of extra work, you need to find a way to execute "vgchange -c n " while *ignoring* all lock functionality. This is what type 0 locking (= no locking at all) does.

We once had this exact problem when running Serviceguard for Linux on a RedHat system - one of our former HP-UX sysadmins assumed Serviceguard for Linux works just like Serviceguard for HP-UX and issued "vgchange -c y". Since Serviceguard does not use nor provide a DLM locking infrastructure, clvmd could not be started successfully and without it, the cluster mode could not be turned off.

At that time, we dug deeply into RedHat documentation and found the solutions listed above.

Since the LVM tools on RedHat and SuSE are based on the same source code, it's very likely the same solution is applicable to SuSE too.

If the --config option is not available, the same effect can be achieved by editing the locking_type setting in /etc/lvm/lvm.conf to 0, entering the "vgchange -c n " command and restoring the locking_type setting to normal.

MK
MK
Ralph Grothe
Honored Contributor

Re: Clustered volume group

Matti, many thanks for explaining the rationale behind your proposed action regarding the locking type.
This is an invaluable hint that I should keep in mind.
Since we also used to have a few MC/SG clusters as well on Linux, which are now phased out and migrated to RHCS because HP announced end of lifecycle for SG on Linux, and because I also only knew SG from HP-UX I most likely would have run into a similar trap as your colleague.
Luckily, for me, our Linux SG clusters are administered by someone else.
If you should require any Device Mapper/(C)LVM expertise (which I doubt there is such need for you) in the future I would advise you contact the RH DM/LVM developers around Alasdair Kergon. Last week on the Berlin LinuxTag I had the chance to meet them folks.
Madness, thy name is system administration
Emil Velez_2
Trusted Contributor

Re: Clustered volume group

On SGLX you use hosttags since SG has no interface with LVM unlike the HPUX product.
Emil Velez
Instructor Storage, Servers, HP-UX and Partner Courses
Hewlett Packard Enterprise Education Services
Ask me about training on StoreServ (3PAR) StoreOnce, StoreEasy, StoreAll, StoreVirtual, HP-UX, ServiceGuard and HPE Partner Ready Certification Training

internet: Emil.Velez@hpe.com
Linkedin: http://www.linkedin.com/in/emilvelez

HPE Master ASE Server Solutions Architect V3
HPE Master ASE Storage Solutions Architect V2
HP UNIX Certified (ASE HPUX 11iv3 Administration V1)
Certified HPE Instructor
HPE Product Certified - OneView [2016]
HP Sales Certified -Servers, Converged Systems and Services [2015]
HPE Product Certified - Converged Solutions [2017]