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 928890 - ocf:redhat:lvm.sh does not allow tagged lvm with multiple lvs on one vg
Summary: ocf:redhat:lvm.sh does not allow tagged lvm with multiple lvs on one vg
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: resource-agents
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: David Vossel
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 883874 1080147
TreeView+ depends on / blocked
 
Reported: 2013-03-28 16:55 UTC by michal novacek
Modified: 2015-08-24 06:35 UTC (History)
5 users (show)

Fixed In Version: resource-agents-3.9.5-5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 11:10:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description michal novacek 2013-03-28 16:55:13 UTC
Description of problem:
It is not possible to make ocf:redhat:lvm.sh agent activate lv that is not the
only lv on vg. This seems to be limitation of lvm.sh script because it is
possible to have several lvs on one vg tagged and activated on different nodes
manually. Make difference between tagging by vg and by lv does not make much
sense then when only one lv is allowed per vg.

Version-Release number of selected component (if applicable):
rhel-7.0-alpha3
resource-agents-3.9.5-4.el7.i686

How reproducible: always

Steps to Reproduce:
1. have running pacemaker+corosync cluster
2. export OCF_RESKEY_vg_name=ha-vg
3. export OCF_RESKEY_lv_name=ha-lv-0
4. export OCF_FUNCTIONS_DIR=/usr/lib/ocf/lib/heartbeat
5. /usr/lib/ocf/resource.d/redhat/lvm.sh start

Actual results:
Failed agent because of several lvs on vg.

Expected results:
Activated lv in vg and running resource.

Additional info:

$ vgdisplay ha-vg
  --- Volume group ---
  VG Name               ha-vg
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  51
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               10.00 GiB
  PE Size               4.00 MiB
  Total PE              2559
  Alloc PE / Size       2532 / 9.89 GiB
  Free  PE / Size       27 / 108.00 MiB
  VG UUID               x9cVDB-3uit-UdrK-fnBk-GLRm-Dw3E-5bdb82


$ lvdisplay ha-vg | grep 'LV Path'
  LV Path                /dev/ha-vg/ha-lv-0
  LV Path                /dev/ha-vg/ha-lv-1
  LV Path                /dev/ha-vg/ha-lv-2

$ env | grep OCF
OCF_RESKEY_vg_name=ha-vg
OCF_RESKEY_lv_name=ha-lv-0
OCF_FUNCTIONS_DIR=/usr/lib/ocf/lib/heartbeat
$ /usr/lib/ocf/resource.d/redhat/lvm.sh start
volume_list=["rhel", "@bb-node01"]
<err>    HA LVM requires Only one logical volume per volume group.
<err>    There are currently 3 logical volumes in ha-vg
<err>    Failing HA LVM start of ha-vg/ha-lv-0

Comment 3 David Vossel 2013-04-03 19:20:24 UTC
Jonathan,

Looking at the agent, this situation appears to be by design. Can you comment on why this limitation exists please.

-- Vossel

Comment 4 David Vossel 2013-04-05 22:25:18 UTC
I researched this a bit. It looks like this limitation is just for the tagging use-case.  When clvm is used I believe this works like you would expect it to.

I think this limitation is set in place to make it difficult to potentially activate a volume group in two places (which would happen if vg had multiple lv being activated on different nodes) when clvm is not in use.

-- Vossel

Comment 5 David Vossel 2013-04-11 21:36:43 UTC
I've talked to Jonathan Brassow about this and here is our conclusion to why this limitation exists.

With exclusive activation using tags, the only safe way to activate a logical volume without cLVM is to guarantee both the volume group and all the logical volumes in that volume group are activated on a single node.

This means we can only safely allow activation by logical volume (using tags) if that logical volume is the only one in the volume group. Otherwise we run the risk of parallel activation of two logical volumes in the same volume group occurring on separate nodes, which could corrupt the volume group metadata.

I agree that the limitations is weird. Right now I'm in the process of merging the redhat lvm.sh agent with the heartbeat LVM agent.  Since activating my lv offers us nothing we can't do with activating by vg when tags are in use, I am going to disable activation by logical volumes for non-cluster volume groups.

So, moving forward.

Activation by LV = only clustered volume groups.  This will be documented and enforced after the lvm.sh merger into the heartbeat provider.

We can leave this issue open until I finish the lvm.sh merger into the heartbeat provider, or close it. Whatever makes the most sense for you all.

-- Vossel

Comment 6 michal novacek 2013-05-22 12:00:33 UTC
Makes sense to me. Let's keep the bug open until lvm.sh is merged.

Comment 7 David Vossel 2013-06-18 18:03:36 UTC
Activation by logical volume will not be supported in the new pacemaker heartbeat:LVM agent.  The LVM agent's use-cases for activation by volume group are already complex.  The inclusion of activation by logical volume imposed additional complications and limitations on the user that we neither want to document or support.  These limitations where not well understood when the logical volume feature existed in the rgmanager agent until later on.  Now that we have a chance to break compatibility, this option will not be carried over.

-- info on exclusive activation copied from 960555 --

The heartbeat:LVM agent now performs exclusive activation with tags for rhel7 instead of redhat:lvm.sh. This new agent works slightly different than the rgmanager one.

For exclusive activation to work, the 'exclusive' option must be set to true, and the 'volume_list' in lvm.conf must be defined.  The resource agent doesn't care what the volume_list is defined to as long as the special cluster tag "@pacemaker" and the volume group are not present in the list.  volume_list=[] would even work as a minimal config.

Volume groups are exclusively activated by having the the '@pacemaker' tag added to them by the resource agent.  On activation, the 'volume_list' is overridden by the resource agent to allow volume groups with the '@pacemaker' tag to be enabled. Outside of the resource agent, the volume_list defined in lvm.conf that does _NOT_ container '@pacemaker' or the volume group prevents the volume group from being activated outside of the cluster control. 

The upstream patch below is related to this issue.
https://github.com/ClusterLabs/resource-agents/commit/d7274446d79757d436b972892f00339fc28da13e

Comment 8 michal novacek 2013-11-13 13:46:45 UTC
ocf:redhat:lvm.sh has been replaced with ocf:heartbeat:LVM  which implements what is in an initial report correctly. 

ocf:redhat:LVM from resource-agents-3.9.5-18 has been tested.

Comment 9 Ludek Smid 2014-06-13 11:10:17 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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