Red Hat Bugzilla – Bug 1268832
LVM: Unpredictable LV size when using -lX%FREE option
Last modified: 2015-10-13 08:07:39 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):
Steps to Reproduce:
1. vgcreate vg /dev/sda
2. lvcreate -n test_lv --type mirror -l30%FREE -m 4 vg
4. check the size of this new LV
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.
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
the expected results are actually implemented for mirror LVs with other than 3 and 4 copies.
"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."
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
Closing bug. Two new BZs were created to deal with those issues.