Bug 1019328
| Summary: | When using lvmetad, lvm commands do not warn about duplicate VG names | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Peter Rajnoha <prajnoha> |
| Component: | lvm2 | Assignee: | David Teigland <teigland> |
| Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.6 | CC: | agk, cmarthal, dwysocha, heinzm, jbrassow, msnitzer, prajnoha, prockai, rbednar, thornber, zkabelac |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.02.140-3.el6 | Doc Type: | Bug Fix |
| Doc Text: |
Cause:
Multiple Volume Groups with the same name were not handled consistently.
Consequence:
Warnings about the duplicate VGs were not printed when lvmetad was used.
The VG name specified by a command would not always translate to the intended VG.
Fix:
LVM always checks if the VG name specified by a command refers to more than one actual VG.
Result:
Copied from lvm(8):
When VGs with the same name exist, commands operating on all VGs will
include all of the VGs with the same name. If the ambiguous VG name is
specified on the command line, the command will produce an error. The
error states that multiple VGs exist with the specified name. To
process one of the VGs specifically, the --select option should be used
with the UUID of the intended VG: '--select vg_uuid=<uuid>'.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-05-11 01:14:55 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Peter Rajnoha
2013-10-15 13:47:25 UTC
With recent code (I'm testing 2.02.133, but it may have been even sooner), we can display duplicate LVs with lvmetad too: $ lvs -o lv_name,vg_name,vg_uuid -S 'vg_name=vg' LV VG VG UUID first vg CcjjbI-wdWn-1BcZ-vNVV-oG1f-hSFl-xuvJRQ first vg UWMB7p-o5H3-LgkU-D8nG-86Tw-efmh-ZyuDs3 second vg UWMB7p-o5H3-LgkU-D8nG-86Tw-efmh-ZyuDs3 Together with the -S|--select support, we can also address individual VGs/LVs based on their UUIDs easily. The only thing that remains is to add some warning possibly about these duplicates if we really want to make it equal to the way it works without lvmetad - maybe this is not necessary anymore if we can display duplicates. I'll take this for the backport/rebase of the existing patch to make this working. There's also some work done by David Teigland to deal with duplicates better so let's see how much of that will get into the release. This is not such a huge issue as lvmetad is not used by default in RHEL6 anyway. We've done rebase in RHEL-6.8 so we display even duplicate VG names with lvmetad now. David, I'm handing this one over to you - I'm not sure if we plan to add a warning here in addition or not even if lvmetad is used. I mean something like the "WARNING: Duplicate VG name vg: Existing Tdq09g-RJiG-z3Sa-QbCE-0Oih-D0fR-R6oiZa (created here) takes precedence over qDi0t5-L5xt-r0Cz-I7v2-gn3U-LehX-j9bQtP" that's there when lvmetad is not used. You're the expert for duplicates now. We don't pick one of the duplicates any longer, but report an error, suggesting that -S be used to select one by UUID. Here's the lvm(8) section about it:
UNIQUE NAMES
VG names should be unique. vgcreate will produce an error if the spec‐
ified VG name matches an existing VG name. However, there are cases
where different VGs with the same name can appear to LVM, e.g. after
moving disks or changing filters.
When VGs with the same name exist, commands operating on all VGs will
include all of the VGs with the same name. If the ambiguous VG name is
specified on the command line, the command will produce an error. The
error states that multiple VGs exist with the specified name. To
process one of the VGs specifically, the --select option should be used
with the UUID of the intended VG: '--select vg_uuid=<uuid>'.
An exception is if all but one of the VGs with the shared name is for‐
eign (see lvmsystemid(7).) In this case, the one VG that is not for‐
eign is assumed to be the intended VG and is processed.
OK, let's use this bz then to track change in behaviour here. The behaviour is now consistent in both lvmetad and non-lvmetad case. The vgs displays both VGs with the same name (but with different UUIDs). When trying to process such VGs, there's the message suggesting -S|--select. [root@rhel6-a ~]# vgs -o+uuid VG #PV #LV #SN Attr VSize VFree VG UUID vg 1 1 0 wz--n- 4.00g 3.99g eHZp2F-7Qdk-p6br-Z8cI-iEwi-LWIl-ScaCr4 vg 1 1 0 wz--n- 4.00g 3.99g GhDzAe-LAav-yhCu-WF4e-G1zn-FtrQ-yh15OP [root@rhel6-a ~]# lvs vg Multiple VGs found with the same name: skipping vg Use the VG UUID with --select vg_uuid=<uuid> [root@rhel6-a ~]# lvs -S vg_uuid=eHZp2F-7Qdk-p6br-Z8cI-iEwi-LWIl-ScaCr4 LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert one vg -wi------- 4.00m Note: I've filed bug #1301974 for adding -S|--select support for commands where it's still missing (e.g. lvcreate). Verified. LVM commands now warn about duplicate VG names when using lvmetad. ============================================================================ With lvmetad: # ps -ef | grep lvmetad | grep -v grep root 27997 1 0 11:39 ? 00:00:00 lvmetad # lvs vg Multiple VGs found with the same name: skipping vg Use the VG UUID with --select vg_uuid=<uuid> # vgs -o +vg_uuid VG #PV #LV #SN Attr VSize VFree VG UUID vg 1 0 0 wz--n- 10.00g 10.00g Huzpgx-Xl67-1tcP-uPCe-WW7B-PHYS-ZXY3qz vg 1 0 0 wz--n- 10.00g 10.00g 1KPonI-xn0n-kYGP-LHS1-F4mB-u6bu-8ZX1rh vg_virt269 1 2 0 wz--n- 7.71g 0 4bllWI-XP9x-hph7-QVJW-Qarl-r597-e5ybrH # lvs --select vg_uuid=Huzpgx-Xl67-1tcP-uPCe-WW7B-PHYS-ZXY3qz # echo $? 0 Without lvmetad: # ps -ef | grep lvmetad | grep -v grep # lvs vg Multiple VGs found with the same name: skipping vg Use the VG UUID with --select vg_uuid=<uuid> # vgs -o +vg_uuid VG #PV #LV #SN Attr VSize VFree VG UUID vg 1 0 0 wz--n- 10.00g 10.00g Huzpgx-Xl67-1tcP-uPCe-WW7B-PHYS-ZXY3qz vg 1 0 0 wz--n- 10.00g 10.00g 1KPonI-xn0n-kYGP-LHS1-F4mB-u6bu-8ZX1rh vg_virt270 1 2 0 wz--n- 7.71g 0 ITwaiF-TtP6-TpCn-CeB5-Vfxr-cb1j-pMSYrZ # lvs --select vg_uuid=Huzpgx-Xl67-1tcP-uPCe-WW7B-PHYS-ZXY3qz # echo $? 0 ============================================================================ Tested on: 2.6.32-616.el6.x86_64 lvm2-2.02.141-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 lvm2-libs-2.02.141-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 lvm2-cluster-2.02.141-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 udev-147-2.71.el6 BUILT: Wed Feb 10 14:07:17 CET 2016 device-mapper-1.02.115-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 device-mapper-libs-1.02.115-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 device-mapper-event-1.02.115-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 device-mapper-event-libs-1.02.115-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 device-mapper-persistent-data-0.6.2-0.1.rc1.el6 BUILT: Wed Feb 10 16:52:15 CET 2016 cmirror-2.02.141-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-0964.html |