Bug 593108 - lvm agent incorrectly reports vg is in volume_list
lvm agent incorrectly reports vg is in volume_list
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: resource-agents (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Jonathan Earl Brassow
Cluster QE
:
Depends On: 506587
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-17 16:30 EDT by Jonathan Earl Brassow
Modified: 2010-11-10 17:15 EST (History)
6 users (show)

See Also:
Fixed In Version: resource-agents-3.0.12-2.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 506587
Environment:
Last Closed: 2010-11-10 17:15:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Jonathan Earl Brassow 2010-05-17 16:30:29 EDT
+++ 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@redhat.com 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@redhat.com on 2010-05-14 16:14:49 EDT ---

Patch pulled in to rhel5 tree
Comment 1 Jonathan Earl Brassow 2010-05-17 16:33:21 EDT
Created attachment 414657 [details]
Patch to fix problem - waiting for approval flags
Comment 2 RHEL Product and Program Management 2010-05-17 16:45:28 EDT
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 14:23:34 EDT
commit 9494b5e95ccd681c3f60601b6e306b670c73edbd
Author: Jonathan Brassow <jbrassow@redhat.com>
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 12:19:41 EDT
Marking verified SanityOnly since ha lvm was only tested with clvmd locking in rhel6.0.
Comment 6 releng-rhel@redhat.com 2010-11-10 17:15:53 EST
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.