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 1021505 - blivet reports wrong LVMVolumeGroupDevice.freeExtents
Summary: blivet reports wrong LVMVolumeGroupDevice.freeExtents
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-blivet
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: mulhern
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-21 12:25 UTC by Jan Safranek
Modified: 2021-09-03 14:12 UTC (History)
2 users (show)

Fixed In Version: python-blivet-0.61.0.4-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 14:05:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
reproducer (663 bytes, text/x-python)
2013-10-21 12:25 UTC, Jan Safranek
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0313 0 normal SHIPPED_LIVE python-blivet bug fix and enhancement update 2015-03-05 17:35:49 UTC

Description Jan Safranek 2013-10-21 12:25:52 UTC
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.

Comment 2 David Lehman 2013-10-21 15:08:10 UTC
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.

Comment 4 mulhern 2014-09-11 22:12:54 UTC
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.

Comment 5 mulhern 2014-09-12 14:09:08 UTC
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!

Comment 6 Jan Safranek 2014-09-16 07:50:05 UTC
Tested today with python-blivet-0.61.0.3-1.el7.noarch from brew, it seems to be fixed. vg.freeExtents and vg.peFree are consistent now.

Comment 9 Jan Safranek 2015-01-15 08:13:29 UTC
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.

Comment 12 errata-xmlrpc 2015-03-05 14:05:36 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-2015-0313.html


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