Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2158619

Summary: vgimportclone fails if a PV has no metadata
Product: Red Hat Enterprise Linux 9 Reporter: David Teigland <teigland>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: Command-line tools QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, thornber, zkabelac
Version: 9.1Keywords: Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.03.17-5.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 08:23:51 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 David Teigland 2023-01-05 21:02:33 UTC
Description of problem:

If one or more PVs in a VG do not have metadata, then vgimportclone fails.

fixed in main
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c4b898a53eec39bc28b5451e7fde87945303a644

reported here https://github.com/lvmteam/lvm2/issues/103

$ vgcreate --vgmetadatacopies 2 test /dev/sda /dev/sdb /dev/sdc
  Volume group "test" successfully created

$ pvs -o+pv_mda_count,pv_mda_used_count
  PV         VG   Fmt  Attr PSize    PFree    #PMda #PMdaUse
  /dev/sda   test lvm2 a--  1020.00m 1020.00m     1        1
  /dev/sdb   test lvm2 a--  1020.00m 1020.00m     1        1
  /dev/sdc   test lvm2 a--    12.00m   12.00m     1        0

$ vgimportclone -n bar /dev/sda /dev/sdb /dev/sdc

$ vgs
  VG   #PV #LV #SN Attr   VSize   VFree
  bar    3   0   0 wz--n-   2.00g 2.00g


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 4 Corey Marthaler 2023-02-07 23:23:58 UTC
Marking Verfied:Tested in the latest rpms.


# Without Fix:
kernel-5.14.0-252.el9    BUILT: Wed Feb  1 03:30:10 PM CET 2023
lvm2-2.03.17-4.el9    BUILT: Tue Jan 10 06:40:12 PM CET 2023
lvm2-libs-2.03.17-4.el9    BUILT: Tue Jan 10 06:40:12 PM CET 2023

[root@virt-482 ~]# vgimportclone -n bar /dev/sda /dev/sdb /dev/sdc
  Devices must be from the same VG.


# With Fix:
kernel-5.14.0-231.el9    BUILT: Mon Jan  9 08:32:41 PM CET 2023
lvm2-2.03.17-5.el9    BUILT: Thu Jan 26 11:17:14 PM CET 2023
lvm2-libs-2.03.17-5.el9    BUILT: Thu Jan 26 11:17:14 PM CET 2023

[root@virt-558 ~]# pvs -o+pv_mda_count,pv_mda_used_count
  PV         VG            Fmt  Attr PSize   PFree   #PMda #PMdaUse
  /dev/sda   test          lvm2 a--  <80.00g <80.00g     1        0
  /dev/sdb   test          lvm2 a--  <80.00g <80.00g     1        1
  /dev/sdc   test          lvm2 a--  <80.00g <80.00g     1        1
  /dev/vda2  rhel_virt-558 lvm2 a--   <7.00g      0      1        1
[root@virt-558 ~]# vgimportclone -n bar /dev/sda /dev/sdb /dev/sdc
[root@virt-558 ~]# vgs
  VG            #PV #LV #SN Attr   VSize    VFree   
  bar             3   0   0 wz--n- <239.99g <239.99g

Comment 8 errata-xmlrpc 2023-05-09 08:23:51 UTC
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 (lvm2 bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2023:2544