RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 593108 - lvm agent incorrectly reports vg is in volume_list
Summary: lvm agent incorrectly reports vg is in volume_list
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: resource-agents
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On: 506587
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-17 20:30 UTC by Jonathan Earl Brassow
Modified: 2010-11-10 22:15 UTC (History)
6 users (show)

Fixed In Version: resource-agents-3.0.12-2.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 506587
Environment:
Last Closed: 2010-11-10 22:15:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to fix problem - waiting for approval flags (1.16 KB, patch)
2010-05-17 20:33 UTC, Jonathan Earl Brassow
no flags Details | Diff

Description Jonathan Earl Brassow 2010-05-17 20:30:29 UTC
+++ This bug was initially created as a clone of Bug #506587 +++

Description of problem: When using an lvm resource with a volume group name that is a substring of the nodename or another volume group, the lvm resource agent will fail to start that resource.  For example if the resource is:

  <lvm lv_name="ext3-a" name="mysql-lv" vg_name="clust">

And the volume_list is:

  volume_list = [ "VolGroup00", "@jrummy5-1-clust.ruemker.pvt" ]

Since the vg_name (clust) is a substring of the nodename, it produces this error:

# rg_test test /etc/cluster/cluster.conf start service mysql-server
Running in test mode.
Starting mysql-server...
[...]
  volume_list=["VolGroup00", "@jrummy5-1-clust.ruemker.pvt"]
  volume_list=["VolGroup00", "@jrummy5-1-clust.ruemker.pvt"]
<err>    HA LVM:  Improper setup detected
<err>    - clust found in "volume_list" in lvm.conf

This is caused by 

        if lvm dumpconfig activation/volume_list | grep "\"$OCF_RESKEY_vg_name\""; then
                ocf_log err "HA LVM:  Improper setup detected"
                ocf_log err "- $OCF_RESKEY_vg_name found in \"volume_list\" in lvm.conf"
                return $OCF_ERR_GENERIC
        fi

Since entries in the volume_list must be in quotes anyways, there is an easy way to fix this:

--- /usr/share/cluster/lvm.sh.orig	2009-06-17 16:33:21.000000000 -0400
+++ /usr/share/cluster/lvm.sh	2009-06-17 16:33:54.000000000 -0400
@@ -79,7 +79,7 @@ function ha_lvm_proper_setup_check
 	# lvm.conf:activation/volume_list; otherwise, machines
 	# will be able to activate the VG regardless of the tags
 	##
-	if lvm dumpconfig activation/volume_list | grep $OCF_RESKEY_vg_name; then
+	if lvm dumpconfig activation/volume_list | grep "\"$OCF_RESKEY_vg_name\""; then
 		ocf_log err "HA LVM:  Improper setup detected"
 		ocf_log err "- $OCF_RESKEY_vg_name found in \"volume_list\" in lvm.conf"
 		return $OCF_ERR_GENERIC

I realize this situation may be kind of rare, but I'm betting I'm not the only person who uses the word cluster or clust in both the hostnames and volume group name.  

Version-Release number of selected component (if applicable): rgmanager-2.0.46-1.el5

How reproducible: Always

Steps to Reproduce:
1. Configure an lvm resource where the volume group name is a substring of the node name that is in the volume_list in /etc/lvm/lvm.conf
2. Start the service
  
Actual results: Service fails to start

Expected results: Service starts

--- Additional comment from jruemker on 2009-06-17 16:44:47 EDT ---

Oops.  The code snippet I pasted was actually my patched version.  I meant to say This is caused by:

       if lvm dumpconfig activation/volume_list | grep
$OCF_RESKEY_vg_name; then
                ocf_log err "HA LVM:  Improper setup detected"
                ocf_log err "- $OCF_RESKEY_vg_name found in \"volume_list\" in
lvm.conf"
                return $OCF_ERR_GENERIC
        fi

--- Additional comment from jbrassow on 2010-05-14 16:14:49 EDT ---

Patch pulled in to rhel5 tree

Comment 1 Jonathan Earl Brassow 2010-05-17 20:33:21 UTC
Created attachment 414657 [details]
Patch to fix problem - waiting for approval flags

Comment 2 RHEL Program Management 2010-05-17 20:45:28 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Jonathan Earl Brassow 2010-05-18 18:23:34 UTC
commit 9494b5e95ccd681c3f60601b6e306b670c73edbd
Author: Jonathan Brassow <jbrassow>
Date:   Tue May 18 13:18:53 2010 -0500

    halvm: Fix bug 593108: lvm agent incorrectly reports vg is in volume_list

    If the name of the VG controlled by rgmanager is a substring of the name
    of the node, the HA-LVM script will complain of an improper setup.

    The fix is to also look for the associated quotes that are necessary when
    specifying strings in lvm.conf.  Thanks to John Ruemker for the patch.

Comment 5 Corey Marthaler 2010-09-16 16:19:41 UTC
Marking verified SanityOnly since ha lvm was only tested with clvmd locking in rhel6.0.

Comment 6 releng-rhel@redhat.com 2010-11-10 22:15:53 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.