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 1298359 - pvs marked unallocatable do not remain that way after a backed up vgcfgrestore
Summary: pvs marked unallocatable do not remain that way after a backed up vgcfgrestore
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.2
Hardware: x86_64
OS: Linux
low
low
Target Milestone: pre-dev-freeze
: 7.3
Assignee: LVM and device-mapper development team
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-13 21:59 UTC by Corey Marthaler
Modified: 2021-09-03 12:54 UTC (History)
7 users (show)

Fixed In Version: lvm2-2.02.152-1.el7
Doc Type: Bug Fix
Doc Text:
Previously, if vgcfgrestore was called with a PV marked as unallocatable, it reset the state back to allocatable. This is now fixed and the allocatable state is correctly set during vgcfgrestore operation.
Clone Of:
Environment:
Last Closed: 2016-11-04 04:14:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1445 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2016-11-03 13:46:41 UTC

Description Corey Marthaler 2016-01-13 21:59:57 UTC
Description of problem:
[root@host-073 ~]# pvscan
  PV /dev/vda2   VG rhel_host-073   lvm2 [7.51 GiB / 40.00 MiB free]
  PV /dev/sda1   VG VG              lvm2 [12.50 GiB / 12.50 GiB free]
  PV /dev/sdb1   VG VG              lvm2 [12.50 GiB / 12.50 GiB free]
  Total: 3 [32.51 GiB] / in use: 3 [32.51 GiB] / in no VG: 0 [0   ]

[root@host-073 ~]# pvchange -x n /dev/sda1
  Physical volume "/dev/sda1" changed
  1 physical volume changed / 0 physical volumes not changed
[root@host-073 ~]# pvchange -x n /dev/sda1
  Physical volume "/dev/sda1" is already unallocatable.
  Physical volume /dev/sda1 not changed
  0 physical volumes changed / 1 physical volume not changed

[root@host-073 ~]# vgcfgbackup -f bar VG
  Volume group "VG" successfully backed up.

        physical_volumes {

                pv0 {
                        id = "1pAC4Z-iYID-7x6n-J2Wi-KMxo-qYi0-TGW6Kf"
                        device = "/dev/sda1"    # Hint only

                        status = []
                        flags = []
                        dev_size = 26218017     # 12.5017 Gigabytes
                        pe_start = 2048
                        pe_count = 3200 # 12.5 Gigabytes
                }

                pv1 {
                        id = "RUXSeH-oo0l-oddQ-8bae-o7JB-fJkx-Gl2tHI"
                        device = "/dev/sdb1"    # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 26218017     # 12.5017 Gigabytes
                        pe_start = 2048
                        pe_count = 3200 # 12.5 Gigabytes
                }
        }

[root@host-073 ~]# pvs -a -o +devices /dev/sda1 /dev/sdb1
  PV         VG   Fmt  Attr PSize  PFree  Devices
  /dev/sda1  VG   lvm2 ---  12.50g 12.50g           <--- note the loss of the 'a' attr
  /dev/sdb1  VG   lvm2 a--  12.50g 12.50g        

[root@host-073 ~]# vgcfgrestore -f bar VG
  Restored volume group VG

[root@host-073 ~]# pvs -a -o +devices /dev/sda1 /dev/sdb1
  PV         VG   Fmt  Attr PSize  PFree  Devices
  /dev/sda1  VG   lvm2 a--  12.50g 12.50g        
  /dev/sdb1  VG   lvm2 a--  12.50g 12.50g        

[root@host-073 ~]# vgcfgbackup -f bar2 VG
  Volume group "VG" successfully backed up.

        physical_volumes {

                pv0 {
                        id = "1pAC4Z-iYID-7x6n-J2Wi-KMxo-qYi0-TGW6Kf"
                        device = "/dev/sda1"    # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 26218017     # 12.5017 Gigabytes
                        pe_start = 2048
                        pe_count = 3200 # 12.5 Gigabytes
                }

                pv1 {
                        id = "RUXSeH-oo0l-oddQ-8bae-o7JB-fJkx-Gl2tHI"
                        device = "/dev/sdb1"    # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 26218017     # 12.5017 Gigabytes
                        pe_start = 2048
                        pe_count = 3200 # 12.5 Gigabytes
                }
        }



Version-Release number of selected component (if applicable):
3.10.0-327.4.4.el7.x86_64

lvm2-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
lvm2-libs-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
lvm2-cluster-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-libs-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-event-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-event-libs-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-persistent-data-0.5.5-1.el7    BUILT: Thu Aug 13 09:58:10 CDT 2015


How reproducible:
Everytime

Comment 2 Alasdair Kergon 2016-01-14 01:02:10 UTC
Apparently a bug dating back to the early days of LVM2!

Restore always sets every PV to allocatable.

Fixed by moving this code outside pv_setup and only doing it for new PVs, not when restoring backups.

https://git.fedorahosted.org/cgit/lvm2.git/patch/?id=01228b692be6850645b91811bbf30366241b036c

https://www.redhat.com/archives/lvm-devel/2016-January/msg00041.html

Comment 3 Mike McCune 2016-03-28 22:58:03 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 5 Corey Marthaler 2016-08-29 22:48:52 UTC
Fix verified in the latest rpms.

3.10.0-497.el7.x86_64

lvm2-2.02.164-3.el7    BUILT: Wed Aug 24 05:20:41 CDT 2016
lvm2-libs-2.02.164-3.el7    BUILT: Wed Aug 24 05:20:41 CDT 2016
lvm2-cluster-2.02.164-3.el7    BUILT: Wed Aug 24 05:20:41 CDT 2016
device-mapper-1.02.133-3.el7    BUILT: Wed Aug 24 05:20:41 CDT 2016
device-mapper-libs-1.02.133-3.el7    BUILT: Wed Aug 24 05:20:41 CDT 2016
device-mapper-event-1.02.133-3.el7    BUILT: Wed Aug 24 05:20:41 CDT 2016
device-mapper-event-libs-1.02.133-3.el7    BUILT: Wed Aug 24 05:20:41 CDT 2016
device-mapper-persistent-data-0.6.3-1.el7    BUILT: Fri Jul 22 05:29:13 CDT 2016
cmirror-2.02.164-3.el7    BUILT: Wed Aug 24 05:20:41 CDT 2016




[root@host-116 ~]# vgcreate VG /dev/sd[ab]1                                                                                                                                      
  Volume group "VG" successfully created                                                                                                                                            
                                                                                                                                                                                         
[root@host-116 ~]# pvscan                                                                                                                                                                
  PV /dev/vda2   VG rhel_host-116   lvm2 [7.00 GiB / 0    free]                                                                                                                             
  PV /dev/sda1   VG VG              lvm2 [9.99 GiB / 9.99 GiB free]                                                                                                                            
  PV /dev/sdb1   VG VG              lvm2 [9.99 GiB / 9.99 GiB free]                                                                                                                             
  Total: 3 [26.98 GiB] / in use: 3 [26.98 GiB] / in no VG: 0 [0   ]                                                                                                                               
                                                                                                                                                                                                   
[root@host-116 ~]# pvchange -x n /dev/sda1                                                                                                                                                          
  Physical volume "/dev/sda1" changed
  1 physical volume changed / 0 physical volumes not changed

[root@host-116 ~]# pvchange -x n /dev/sda1
  Physical volume "/dev/sda1" is already unallocatable.
  Physical volume /dev/sda1 not changed
  0 physical volumes changed / 1 physical volume not changed

[root@host-116 ~]# vgcfgbackup -f bar VG
  Volume group "VG" successfully backed up.

        physical_volumes {

                pv0 {
                        id = "gnOCVA-YeaN-Wgjw-8g97-sX3c-bcBy-icE1yR"
                        device = "/dev/sda1"    # Hint only

                        status = []
                        flags = []
                        dev_size = 20964762     # 9.99678 Gigabytes
                        pe_start = 2048
                        pe_count = 2558 # 9.99219 Gigabytes
                }

                pv1 {
                        id = "Dz3aCf-2mRT-dwLv-9Bqg-8xw6-2xcf-Tktvsx"
                        device = "/dev/sdb1"    # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 20964762     # 9.99678 Gigabytes
                        pe_start = 2048
                        pe_count = 2558 # 9.99219 Gigabytes
                }


[root@host-116 ~]# pvs -a -o +devices /dev/sda1 /dev/sdb1
  PV         VG Fmt  Attr PSize PFree Devices
  /dev/sda1  VG lvm2 u--  9.99g 9.99g        
  /dev/sdb1  VG lvm2 a--  9.99g 9.99g        

[root@host-116 ~]# vgcfgrestore -f bar VG
  Restored volume group VG

[root@host-116 ~]# pvs -a -o +devices /dev/sda1 /dev/sdb1
  PV         VG Fmt  Attr PSize PFree Devices
  /dev/sda1  VG lvm2 u--  9.99g 9.99g           <-- * Still unallocatable *
  /dev/sdb1  VG lvm2 a--  9.99g 9.99g        

[root@host-116 ~]# vgcfgbackup -f bar2 VG
  Volume group "VG" successfully backed up.

        physical_volumes {

                pv0 {
                        id = "gnOCVA-YeaN-Wgjw-8g97-sX3c-bcBy-icE1yR"
                        device = "/dev/sda1"    # Hint only

                        status = []             <-- * Still unallocatable *
                        flags = []
                        dev_size = 20964762     # 9.99678 Gigabytes
                        pe_start = 2048
                        pe_count = 2558 # 9.99219 Gigabytes
                }

                pv1 {
                        id = "Dz3aCf-2mRT-dwLv-9Bqg-8xw6-2xcf-Tktvsx"
                        device = "/dev/sdb1"    # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 20964762     # 9.99678 Gigabytes
                        pe_start = 2048
                        pe_count = 2558 # 9.99219 Gigabytes
                }
        }

Comment 7 errata-xmlrpc 2016-11-04 04:14:19 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, 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-1445.html


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