Bug 989174
Summary: | lvm2app lvm_vg_reduce() can delete a volume group | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | benscott | ||||||
Component: | lvm2 | Assignee: | Tony Asleson <tasleson> | ||||||
lvm2 sub component: | Python API / liblvm (RHEL6) | QA Contact: | Cluster QE <mspqa-list> | ||||||
Status: | CLOSED ERRATA | Docs Contact: | |||||||
Severity: | medium | ||||||||
Priority: | medium | CC: | agk, benscott, cmarthal, dwysocha, heinzm, jbrassow, msnitzer, nperic, prajnoha, prockai, tasleson, thornber, zkabelac | ||||||
Version: | 6.6 | ||||||||
Target Milestone: | rc | ||||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | lvm2-2.02.107-1.el6 | Doc Type: | Bug Fix | ||||||
Doc Text: |
The lvm_vg_reduce() function in the lvm2app library gains some additional validation to bring it into line with its command-line equivalent.
|
Story Points: | --- | ||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2014-10-14 08:24:34 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: | |||||||||
Attachments: |
|
Description
benscott
2013-07-28 06:41:12 UTC
I have been unable to reproduce using RHEL 6.4. I have also not been able to reproduce using the latest built from source. This was reported against RHEL6, but the driver version looks to be too new. Please clarify which version you are running. Sorry, I should have mentioned I am running Debian Sid: linux-image-3.10-1-amd64 3.10.3-1 LVM version: 2.02.98(2) (2012-10-15) Library version: 1.02.77 (2012-10-15) Driver version: 4.24.0 Tested on debian stable (wheezy) and unable to reproduce. Stable is utilizing: LVM version: 2.02.95(2) (2012-03-06) Library version: 1.02.74 (2012-03-06) Driver version: 4.22.0 I created a simple test case which iterates through all the PVs in a VG and tries to remove all of them and then writes out the changes. In all testing so far I get an error when trying to remove the PV that may be in use which is expected. My test run: + pvs PV VG Fmt Attr PSize PFree /dev/sda lvm2 a-- 8.00g 8.00g /dev/sdb lvm2 a-- 8.00g 8.00g /dev/sdc lvm2 a-- 8.00g 8.00g /dev/sdd lvm2 a-- 8.00g 8.00g /dev/sde lvm2 a-- 8.00g 8.00g /dev/sdf lvm2 a-- 8.00g 8.00g + vgcreate vgtest /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf Volume group "vgtest" successfully created + lvcreate -L100M vgtest Logical volume "lvol0" created + ./vgreducetest vgtest Physical volume /dev/sda still in use. Unable to remove physical volume '/dev/sda' from volume group 'vgtest'. Removal error Physical volume /dev/sda still in use. Unable to remove physical volume '/dev/sda' from volume group 'vgtest'. + lvs -o +devices LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert Devices lvol0 vgtest -wi-ao-- 100.00m /dev/sda(0) Not sure if/when I will have a sid system to try on. Created attachment 783007 [details]
Test to remove PVs from VG
This isn't exactly the same test as when the bug reporter is stating, but I have tried to remove and not remove the PV that the actual lv resides on and get the same behavior.
Please review my test case to and see if it re-creates what you are seeing. If not please supply a complete sample or modification so I can try to re-create. FYI: We will be adding some type of addtional debug capability to a future version to help debug these types of errors better. Thanks! I was able to get a VM updated to sid. Linux sid 3.10-1-amd64 #1 SMP Debian 3.10.3-1 (2013-07-27) x86_64 GNU/Linux LVM version: 2.02.98(2) (2012-10-15) Library version: 1.02.77 (2012-10-15) Driver version: 4.24.0 Still unable to re-create. Created attachment 784132 [details]
Test case with ability to specify a device to not remove from VG
Now I feel a little stupid. There is a bug but it isn't what I thought. The reason the volume group was disapearing is that a couple of my physical volumes were created (long ago) with --metadatacopies 0. When the group was reduced to just those pvs, it vanished. I think the libary should check for available MDA's before allowing the reduction of a group. However there is also this bug: https://bugzilla.redhat.com/show_bug.cgi?id=880395 The vgcreate and vgextend library only create a new pv label if there isn't already one on the device and there is no way to specify a new layout. In my case reusing the ancient volume label was more of a bug than a feature. Thank you, and sorry for the misleading report. command line vgreduce gives the error: Cannot remove final metadata area Obviously library should do the same thing. - If this check was missing, how many other checks are also missing? Fixed upstream, see: http://www.redhat.com/archives/lvm-devel/2013-November/msg00080.html Will be in next release (2.02.105) Acking this as other API BZs - SanityOnly. Marking Verified (SanityOnly), no major issues found yet during regression testing on the latest rpms. 2.6.32-492.el6.x86_64 lvm2-2.02.107-2.el6 BUILT: Fri Jul 11 08:47:33 CDT 2014 lvm2-libs-2.02.107-2.el6 BUILT: Fri Jul 11 08:47:33 CDT 2014 lvm2-cluster-2.02.107-2.el6 BUILT: Fri Jul 11 08:47:33 CDT 2014 udev-147-2.56.el6 BUILT: Fri Jul 11 09:53:07 CDT 2014 device-mapper-1.02.86-2.el6 BUILT: Fri Jul 11 08:47:33 CDT 2014 device-mapper-libs-1.02.86-2.el6 BUILT: Fri Jul 11 08:47:33 CDT 2014 device-mapper-event-1.02.86-2.el6 BUILT: Fri Jul 11 08:47:33 CDT 2014 device-mapper-event-libs-1.02.86-2.el6 BUILT: Fri Jul 11 08:47:33 CDT 2014 device-mapper-persistent-data-0.3.2-1.el6 BUILT: Fri Apr 4 08:43:06 CDT 2014 cmirror-2.02.107-2.el6 BUILT: Fri Jul 11 08:47:33 CDT 2014 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. http://rhn.redhat.com/errata/RHBA-2014-1387.html |