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.
Created attachment 814560[details]
reproducer
Description of problem:
Let's consider this setup:
$ vgcreate test /dev/sdb1
$ lvcreate -l 2 -n 00 test
$ vgdisplay
--- Volume group ---
VG Name test
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 92.00 MiB
PE Size 4.00 MiB
Total PE 23
Alloc PE / Size 2 / 8.00 MiB
Free PE / Size 21 / 84.00 MiB
VG UUID NJA1Qr-yf3e-7WVU-5bHj-Q3mZ-1yEL-5FMQXr
So, 2 extents are used, 21 extents are free. But blivet reports 23 free extents:
LVMVolumeGroupDevice instance (0x2925590) --
...
format args = [] originalFormat = None target = None dmUuid = None free = 84.0 PE Size = 4.0 PE Count = 23
PE Free = 21 PV Count = 1
^^^^
LV Names = ['00'] modified = False
extents = 23.0 free space = 92
free extents = 23.0 reserved percent = 0 reserved space = 0
^^^^^
vg.freeExtents = 23
vg.peFree = 21
OpenLMI has used freeExtents so far, is there some API change and should we switch to peFree?
In the reproducer debug logs I can see LVMLogicalVolumeDevice printed once with parent LVMVolumeGroupDevice.free extents = 21.0 and once with free extents = 23.0; something has changed it in the meantime.
Version-Release number of selected component:
python-blivet-0.18.7-1.el7.noarch
(python-blivet-0.18.6-1.el7.noarch works fine)
This bug applies also to rawhide.
peFree is taken directly from lvm and does not get updated without a reset.
freeExtents is blivet doing its best to guess how many extents are free based on what it knows about how lvm uses space in the vg. Normally if this number is wrong it is showing too few free extents, so this is puzzling.
I'll take a look at the reproducer.
So, peFree is set during discovery from udev info, and not used anywhere, AFAICT.
freeExtents is just freeSpace/peSize rounded to the nearest whole number. 100 to 1 freeSpace is the culprit, since peSize really ought not to move around much. To get this right, free space should be less than 88 but it is at least 92 and probably no more. Just looking at probabilities, it seems unlikely that the vg.size is too big, more likely that the things subtracted from it are too small.
Could you verify that this is still occurring?
I ran a test in current rhel7 and the free extents calculated by blivet for the vg matched those reported by vgdisplay.
If you can still reproduce it can you give more specifics about /dev/sdb1 and include logs?
Thanks!
I checked with python-blivet-0.61.0.20-1.el7.noarch that peFree and freeExtents are the same on my system. They get different when an LV is created (as comment #2 says, this is expected) and they get the same after blivet.reset().
So, from OpenLMI point of view, the bug is fixed.
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-2015-0313.html
Created attachment 814560 [details] reproducer Description of problem: Let's consider this setup: $ vgcreate test /dev/sdb1 $ lvcreate -l 2 -n 00 test $ vgdisplay --- Volume group --- VG Name test System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 4 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 92.00 MiB PE Size 4.00 MiB Total PE 23 Alloc PE / Size 2 / 8.00 MiB Free PE / Size 21 / 84.00 MiB VG UUID NJA1Qr-yf3e-7WVU-5bHj-Q3mZ-1yEL-5FMQXr So, 2 extents are used, 21 extents are free. But blivet reports 23 free extents: LVMVolumeGroupDevice instance (0x2925590) -- ... format args = [] originalFormat = None target = None dmUuid = None free = 84.0 PE Size = 4.0 PE Count = 23 PE Free = 21 PV Count = 1 ^^^^ LV Names = ['00'] modified = False extents = 23.0 free space = 92 free extents = 23.0 reserved percent = 0 reserved space = 0 ^^^^^ vg.freeExtents = 23 vg.peFree = 21 OpenLMI has used freeExtents so far, is there some API change and should we switch to peFree? In the reproducer debug logs I can see LVMLogicalVolumeDevice printed once with parent LVMVolumeGroupDevice.free extents = 21.0 and once with free extents = 23.0; something has changed it in the meantime. Version-Release number of selected component: python-blivet-0.18.7-1.el7.noarch (python-blivet-0.18.6-1.el7.noarch works fine) This bug applies also to rawhide.