Bug 1268832 - LVM: Unpredictable LV size when using -lX%FREE option
LVM: Unpredictable LV size when using -lX%FREE option
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2 (Show other bugs)
7.2
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: LVM and device-mapper development team
cluster-qe@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-05 08:11 EDT by Roman Bednář
Modified: 2015-10-13 08:07 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-13 08:07:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Roman Bednář 2015-10-05 08:11:29 EDT
Description of problem:
 
Combination of mirror, raid1,4,5 and stripe with -lX%FREE option gives unpredictable results.
Highest possible value is always applied to create all the needed LVs (public and private)
ending up with public logical volume of unpredictable size.
 
Version-Release number of selected component (if applicable):
lvm2-2.02.130-2.el7.x86_64
 
How reproducible:
always
 
Steps to Reproduce:
1. vgcreate vg /dev/sda
2. lvcreate -n test_lv --type mirror -l30%FREE -m 4 vg
3. lvs
4. check the size of this new LV
 
Actual results:
The size of logical volumes are reduced, resulting size for public LV is not ~30% but ~16%.
Same behaviour also applies to any other combination of legs and percentage
that would result in exceeding the limit of free volume group extents.
 
Expected results:
Users should have the public LV of the size they requested. Command should fail
when user tries to create a logical volume whose public+private LVs would exceed
the limit of free extents in volume group
 
Additional info:
the expected results are actually implemented for mirror LVs with other than 3 and 4 copies.
 
Example:
"lvcreate -n test_lv --type mirror -m 1 -l50%FREE vg"
fails with a message:
"Insufficient free space for log allocation for logical volume.
Unable to allocate extents for mirror log."
Comment 2 Jonathan Earl Brassow 2015-10-06 17:26:26 EDT
When specifying %FREE, the amount is considered to be an approximation.  So, there should not be the assumption of an exact match.  However, I see two possible valid complaints in the above:
1) The amount received is much less than the amount requested (I'd need to see the before and after pvs,vgs,lvs to be sure this is the case though).
2) legacy mirrors (i.e. --type mirror) do not function the way other targets do
Comment 3 Roman Bednář 2015-10-13 08:07:39 EDT
Closing bug. Two new BZs were created to deal with those issues.

1) https://bugzilla.redhat.com/show_bug.cgi?id=1269893

2) https://bugzilla.redhat.com/show_bug.cgi?id=1269533

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