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 1070381 - LVM: Allow the use of VGUUID in place of the vgname
Summary: LVM: Allow the use of VGUUID in place of the vgname
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: LVM and device-mapper development team
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
: 1054803 (view as bug list)
Depends On:
Blocks: 782468 BrassowRHEL7Bugs
TreeView+ depends on / blocked
 
Reported: 2014-02-26 17:04 UTC by Jonathan Earl Brassow
Modified: 2021-09-08 20:30 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-04-15 14:20:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch (9.78 KB, text/plain)
2014-04-11 16:41 UTC, David Teigland
no flags Details
patch (7.71 KB, text/plain)
2014-04-11 16:43 UTC, David Teigland
no flags Details

Description Jonathan Earl Brassow 2014-02-26 17:04:20 UTC
Sometimes more than one VG can have the same name.  Allowing users to change or view VGs based on their UUID would be helpful.

Comment 2 David Teigland 2014-02-26 17:28:05 UTC
I suggest adding this to the new restructured versions of process_each where it should be simpler to do (it's already processing based on vg_name/vg_uuid pairs, and just needs to check if an arg name is actually a uuid).  I'll look at adding this the next time I rebase the toollib patch set.

Comment 4 Alasdair Kergon 2014-02-26 18:05:25 UTC
The issue is one of locking.

VG locks are based on the VG name not the UUID.

The current code gets the VG lock based on the name from the command line, then goes to get the metadata.

This change requires it to 'guess' (lookup/search for) the right VG, then once it's got what it thinks is the right VG, take the VG lock, and then confirm that the name+uuid is still correct.

Comment 5 David Teigland 2014-02-26 18:26:24 UTC
Yes, I'd forgotten about the locking implications.  In this case, processing vg uuid's would be fairly close to the way I process tags.  With tags I get the complete list of vg_name/vg_uuid pairs, and then select vgs from that list based on matching tags.  With uuid's I'd do the same but match against the uuid.
With explicit names, I do not need to get the full vg list to select from, but can go directly to processing.  So, it would be little more complicated that I'd thought, but shouldn't be too bad.

Comment 6 Peter Rajnoha 2014-02-27 09:26:35 UTC
Also bug #449832 (rawhide one) and bug #1054803 (RHEL one where 2 VGs with the same name cause problems)

Comment 7 David Teigland 2014-03-10 19:22:04 UTC
This commit takes vg uuids on the command line for commands using process_each_vg:

https://git.fedorahosted.org/cgit/lvm2.git/commit/?h=dev-dct-process-v7&id=d094861a4e2364ab6267c36ceb3a6b97a7b4eda0

If this looks good, I can do the same for commands using process_each_lv.

Comment 8 David Teigland 2014-03-12 16:44:07 UTC
A new version of the patch that handles vg's with names that are uuids.
A uuid on the command line is first matched against a vg that has a
name matching the uuid, then an attempt is made to match the uuid
with vg uuids.

Should there be a config option to enable the new matching against vg uuids?  Existing users will have vg's with uuid names.  For them, command behavior
will change when they use these names as command args.

A command like "vgs vg_name", where vg_name is a valid uuid (generated be
the user during vgcreate), will currently lock and read only the single vg.

With this patch, the same command will use a global lock, and then lock and
read all vgs.  It does this expecting that it will need to compare the uuid
arg against vg uuid's (very similar to tag comparisons.)

Alternatives to a config option would be a command option to enable the
names to be interpreted as uuids, or a special prefix before uuids, as
is done for tags.  Some existing commands accept vg uuids without these
things, so consistency with them may be an issue.

https://git.fedorahosted.org/cgit/lvm2.git/commit/?h=dev-dct-process-v8&id=64a8fb13ab49653bc4b69822c3206b5295628256

test:
https://git.fedorahosted.org/cgit/lvm2.git/commit/?h=dev-dct-process-v8&id=bc0f5684c93278c6083b50d71bb4cf8c2e7a4fb4

Comment 9 RHEL Program Management 2014-03-22 05:56:15 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 10 David Teigland 2014-04-11 16:38:47 UTC
I added a comment to bug 867376 related to using the command-line-selection syntax from that bug.  That syntax will tell us if a uuid arg is meant to
match a vg's uuid or name.  This should simplify the current patch and test.
It will also avoid the problem of uuids as names causing all vgs to be read.

Comment 11 David Teigland 2014-04-11 16:41:10 UTC
Created attachment 885490 [details]
patch

Current patch.  If will need to be updated to take advantage of new uuid selection syntax (when available), and can probably be simplified because of that.

Comment 12 David Teigland 2014-04-11 16:43:22 UTC
Created attachment 885491 [details]
patch

Test for the previous patch.  This will also need to be updated for the new uuid selection method.

Comment 13 Peter Rajnoha 2014-04-23 09:19:19 UTC
*** Bug 1054803 has been marked as a duplicate of this bug. ***

Comment 15 David Teigland 2015-04-15 14:20:27 UTC
With the new select option, we can do this with: vgs -S uuid=...


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