- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: How to determine if a VG has cluster bit set?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2008 09:03 AM
тАО02-20-2008 09:03 AM
How to determine if a VG has cluster bit set?
I need to check this in the configuration
block of a plugin script I write.
Unfortunately, this part of the script is
run with lowered privileges after they have
been dropped even when started as root.
As a workaround I first thought to parse the package control scripts by collecting them over a glob similar to
@pkg_ctls = glob '/etc/cmcluster/*/*.cntl';
But then I realized that for some strange reason they were not readable by others so that
parsing them would fail.
The same is true for /etc/lvmtab,
and reading /etc/mnttab would only yield open VGs on the current cluster node but not cluster wide.
Any other ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2008 09:29 AM
тАО02-20-2008 09:29 AM
Re: How to determine if a VG has cluster bit set?
Not a very great idea, but /sbin/vgdisplay is accessible for everybody. So a vgdisplay on a vg activated in exclusive mode (that is with cluster bit set) should output the information ?
Hope this help
Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2008 09:38 AM
тАО02-20-2008 09:38 AM
Re: How to determine if a VG has cluster bit set?
yes, I could parse for exclusive from
/usr/sbin/vgdisplay 2>/dev/null|grep -E 'VG (Name|Status)'
But this would only catch those currently active on the executing host.
This would catch about a third of the cluster VGs at least.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2008 10:20 AM
тАО02-20-2008 10:20 AM
Re: How to determine if a VG has cluster bit set?
perhaps a two-step strategy could help:
1) You could export relevant information for non-privileged users in your control script to a file (readable by the lower-privileged user, residing on the active node).
- Every time a cluster change is done, this information would be refreshed.
- You could export some raw information only
2
The real processing/formatting of the output data could be done later by other scripts, reading this file and by a non-privileged user.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2008 10:23 AM
тАО02-20-2008 10:23 AM
Re: How to determine if a VG has cluster bit set?
would show that - but it shows all vg's....
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2008 10:25 AM
тАО02-20-2008 10:25 AM
Re: How to determine if a VG has cluster bit set?
An other idea, but I have no HP-UX box with MCSG to test it : with proper security rules configured in the cluster, I think there is a way to use commands like cmgetconf. I don't remember exactly how output looks like but I guess the VG configured in the cluster file will be shown ?
Bonne soir├Г┬йe :-)
Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2008 11:27 AM
тАО02-20-2008 11:27 AM
Re: How to determine if a VG has cluster bit set?
Cheers,
Wout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2008 12:36 AM
тАО02-21-2008 12:36 AM
Re: How to determine if a VG has cluster bit set?
Wouter,
unfortunately the error message for hit inactive VGs doesn't indicate the reason for their inactive state on this node
(e.g. because they might be active, exclusive on another cluster node).
Thus, it could also be that the listed VGs on stderr are ordinary non cluster shared VGs
that are for whatever reason elsewise inactive.
$ /usr/sbin/vgdisplay >/dev/null
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg25".
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg31".
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg32".
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg33".
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg34".
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg35".
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg36".
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg37".
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg38".
Eric,
yes, newer SG releases offer access control policies so that members of the least privileged USER_ROLE MONITOR could run cmgetconf (and other non-intrusive cm* commands).
However, we still have some clusters that are pre-releases that lack this feature (ok sudo, is always an option)
But even if, the cmgetconf command blocks far too long (for a monitoring process) because the cluster scan may take that long.
Therefore I would prefer a mere read of the cluster config binary through cmviewconf.
But then the only VG related info that cmviewconf dumps refers to the VG that contains the lock PV.
# cmviewconf|grep -i vg
first lock vg name: /dev/vg37
second lock vg name: (not configured)
Peter,
yes I think I will finally do something similar to what you have suggested.
Or elevate permissions on cluster package control script files to read to be able to parse the LV array assignments therein,
under the assumption that these files are in sync over all cluster nodes.
Does anyone know of a hack how to read the LVM meta data from the raw devs directly to arrive at the cluster bit?
I know this is possible with dd on Linux LVM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2008 12:50 AM
тАО02-21-2008 12:50 AM
Re: How to determine if a VG has cluster bit set?
You can try to activate inactive VG with standard "-a y". If it has cluster bit set, you will have an explicit error message.
Of course you can try to dump lvm structure with dd. I tried to find some informations relative to lvm structure under /usr/include but found nothing. Maybe someone knows ?
But in both cases you need root privileges : you must be root to use vgchange and disk special files are owned by root.
Eric