Bug 918328

Summary: [RFE] Add an option to lvcreate to specify a tolerance in extents
Product: [Community] LVM and device-mapper Reporter: David Lehman <dlehman>
Component: lvm2Assignee: LVM Team <lvm-team>
lvm2 sub component: Changing Logical Volumes QA Contact: cluster-qe <cluster-qe>
Status: NEW --- Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, amulhern, bmarzins, bmr, dwysocha, heinzm, jbrassow, jonathan, lvm-team, prajnoha, zkabelac
Version: 2.02.166Keywords: FutureFeature
Target Milestone: ---Flags: rule-engine: lvm-technical-solution?
rule-engine: lvm-test-coverage?
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:

Description David Lehman 2013-03-05 22:25:45 UTC
Description of problem:
Blivet (anaconda, historically) does a fair amount of lvm calculation, which occasionally ends up being off by an extent. It would be nicer for all involved if it were possible for blivet/anaconda to tell lvm "It's okay if you are short by as many as 2 extents, so don't fail in that event."

Version-Release number of selected component (if applicable):
lvm2-2.02.98-4.fc18

How reproducible:
Always

Steps to Reproduce:
1. try to create a new lv with one extent more than is available
2.
3.
  
Actual results:
lvcreate prints an error and fails

Expected results:
lvcreate, passed this new option, allows variance within the specified tolerance and successfully creates the volume with as close to the requested size as possible.

Additional info:
Maybe something along the lines of --tolerance with semantics like the --extents option.

Comment 1 Zdenek Kabelac 2013-03-07 08:31:14 UTC
How about specifying size with  '~'

lvcreate -L~10M
lvcreate -l~20

With semantic - 'anything up to 10M - or up to 20 extents'
so allocation of 1..20 extents would be success, but 0 failure.

Or do we need to 'fail' if there would be i.e. only 15 extents ?
(the opposite direction -L10M has the meaning 'not less then 10M')

Comment 2 David Lehman 2013-03-07 16:19:19 UTC
A defined tolerance would be slightly preferable but the proposal from comment 1 would most likely be adequate for our purposes.

Comment 3 David Lehman 2013-09-18 15:50:18 UTC
When might this get into a build of lvm2? I am on the verge of having to add yet another hack to anaconda/blivet to handle this, but it would be much nicer if that wasn't necessary.

Comment 4 mulhern 2016-05-02 18:42:37 UTC
It is possible that the --total-size option idea of bz#1314770 would take care of some of the problem.