Bug 998347

Summary: "lvcreate -l 100%FREE -T vg/thin-pool" returns error
Product: Red Hat Enterprise Linux 7 Reporter: Xiaowei Li <xiaoli>
Component: lvm2Assignee: Marian Csontos <mcsontos>
lvm2 sub component: Thin Provisioning QA Contact: cluster-qe <cluster-qe>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: low    
Priority: low CC: agk, bmarzins, bmr, cmarthal, dwysocha, extras-orphan, heinzm, jbrassow, jonathan, joshua, lvm-team, msnitzer, nperic, prajnoha, prockai, qcai, thornber, yanwang, zkabelac
Version: 7.0Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.115-3.el7.x86_64 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 812726
: 1003496 (view as bug list) Environment:
Last Closed: 2015-04-24 18:51:26 UTC 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:
Bug Depends On: 812726    
Bug Blocks: 1003496, 1119323    

Description Xiaowei Li 2013-08-19 05:39:29 UTC
in RHEL 7.0 lvm2-2.02.99-1.el7.x86_64

+++ This bug was initially created as a clone of Bug #812726 +++

Description of problem:
when invoking "lvcreate -l 100%FREE -T vg/thin-pool", lvm should allocate all the free PE to the thin pool ( 1 PE for metadata, others for data block ).


Version-Release number of selected component (if applicable):


How reproducible:
always

Steps:
# vgdisplay vg3
  --- Volume group ---
  VG Name               vg3
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1020.00 MiB
  PE Size               4.00 MiB
  Total PE              255
  Alloc PE / Size       0 / 0   
  Free  PE / Size       255 / 1020.00 MiB
  VG UUID               X8FHfz-ezqW-FIaW-A0Dx-uPnX-bUPl-k3Meez
   
#lvcreate -l 100%FREE -T vg3/pool
  Rounding up size to full physical extent 4.00 MiB
  Insufficient suitable allocatable extents for logical volume pool: 255 more required

Actual results:
"lvcreate -l 100%FREE -T vg3/pool" return error


Expected results:
should create 255 PE to the thin pool and 254 PE as the data block.


Additional info:

--- Additional comment from Xiaowei Li on 2012-04-16 02:01:07 EDT ---

The 100%FREE option works well to create a liner volume so should also work well to create the thin pool.

[root@laker ~]# lvcreate -l 100%FREE -n vg3/lv
  Logical volume "lv" created
[root@laker ~]# lvs vg3
  LV   VG   Attr     LSize    Pool Origin Data%  Move Log Copy%  Convert
  lv   vg3  -wi-a--- 1020.00m

--- Additional comment from Xiaowei Li on 2012-04-16 02:03:42 EDT ---

please ignore '( 1 PE for metadata, others for data block )' in 'DESCRIPTION' field.

--- Additional comment from Alasdair Kergon on 2012-04-16 11:39:09 EDT ---

Yes, we ought to fix this one.

--- Additional comment from  on 2012-09-25 18:15:37 EDT ---

Is this still an issue in F18 Alpha1?

--- Additional comment from Xiaowei Li on 2012-09-27 03:03:59 EDT ---

(In reply to comment #4)
> Is this still an issue in F18 Alpha1?

Yes, it still exists in lvm2-2.02.97-1.fc18.x86_64

Comment 1 Xiaowei Li 2013-08-19 05:40:25 UTC
track this issue in RHEL 7.0

Comment 2 Xiaowei Li 2013-08-19 06:02:46 UTC
testing result for lvm2-2.02.99-1.el7.x86_64
=== on liner pool ===

[PASS][01:23:12][dhcp12-156.nay.redhat.com]lvcreate -l 100%FREE -T tsvg/pool5
STDOUT:
  Logical volume "pool5" created
STDERR:
RETURN:0

[FAIL][01:23:13][dhcp12-156.nay.redhat.com]lvcreate -l 100%VG -T tsvg/pool1
STDOUT:
  Logical volume "lvol0" created
STDERR:  Volume group "tsvg" has insufficient free space (1274 extents): 1276 required.
RETURN:5

[FAIL][01:23:13][dhcp12-156.nay.redhat.com]lvcreate -l 100%PVS -T tsvg/pool1
STDOUT:
  Logical volume "lvol0" created
STDERR:  Volume group "tsvg" has insufficient free space (1274 extents): 1276 required.
RETURN:5

=== on stripe pool ===
[FAIL][01:24:42][dhcp12-156.nay.redhat.com]lvcreate -i2 -l 100%FREE -T tsvg/pool5
STDOUT:
  Using default stripesize 64.00 KiB
  Rounding size (801 extents) down to stripe boundary size (800 extents)
STDERR:  Insufficient suitable allocatable extents for logical volume pool5: 2 more required
RETURN:5

[FAIL][01:24:42][dhcp12-156.nay.redhat.com]lvcreate -i3 -l 100%VG -T tsvg/pool1
STDOUT:
  Using default stripesize 64.00 KiB
  Rounding size (1276 extents) down to stripe boundary size (1275 extents)
  Logical volume "lvol0" created
STDERR:  Volume group "tsvg" has insufficient free space (1274 extents): 1275 required.
RETURN:5

[FAIL][01:24:43][dhcp12-156.nay.redhat.com]lvcreate -i1 -l 100%PVS -T tsvg/pool1
STDOUT:
  Logical volume "lvol0" created
STDERR:  Volume group "tsvg" has insufficient free space (1274 extents): 1276 required.
RETURN:5

Comment 4 Xiaowei Li 2013-08-19 13:36:35 UTC
please set the dev_ack. thanks a lot.

Comment 7 Ludek Smid 2014-06-26 10:47:42 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Comment 8 Ludek Smid 2014-06-26 11:14:45 UTC
The comment above is incorrect. The correct version is bellow.
I'm sorry for any inconvenience.
---------------------------------------------------------------

This request was NOT resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you need
to escalate this bug.

Comment 11 Jonathan Earl Brassow 2015-04-09 23:22:36 UTC
Seems to be fixed already:
[root@bp-01 ~]# lvcreate -l 100%FREE -T vg/thin-pool
  Logical volume "lvol0" created
  Logical volume "thin-pool" created
[root@bp-01 ~]# devices vg
  LV                Attr       Cpy%Sync Devices
  [lvol0_pmspare]   ewi-------          /dev/sdb1(0)
  thin-pool         twi-a-tz--          thin-pool_tdata(0)
  [thin-pool_tdata] Twi-ao----          /dev/sdc1(0)
  [thin-pool_tdata] Twi-ao----          /dev/sdd1(0)
  [thin-pool_tdata] Twi-ao----          /dev/sde1(0)
  [thin-pool_tdata] Twi-ao----          /dev/sdf1(0)
  [thin-pool_tdata] Twi-ao----          /dev/sdg1(0)
  [thin-pool_tdata] Twi-ao----          /dev/sdh1(0)
  [thin-pool_tdata] Twi-ao----          /dev/sdi1(0)
  [thin-pool_tdata] Twi-ao----          /dev/sdb1(54)
  [thin-pool_tmeta] ewi-ao----          /dev/sdb1(27)
[root@bp-01 ~]# pvs
  PV         VG      Fmt  Attr PSize   PFree
  /dev/sda2  vg_bp01 lvm2 a--  465.27g    0
  /dev/sdb1  vg      lvm2 a--  836.68g    0
  /dev/sdc1  vg      lvm2 a--  836.68g    0
  /dev/sdd1  vg      lvm2 a--  836.68g    0
  /dev/sde1  vg      lvm2 a--  836.68g    0
  /dev/sdf1  vg      lvm2 a--  836.68g    0
  /dev/sdg1  vg      lvm2 a--  836.68g    0
  /dev/sdh1  vg      lvm2 a--  836.68g    0
  /dev/sdi1  vg      lvm2 a--  836.68g    0

Please confirm with rhel7.2.

Comment 12 Marian Csontos 2015-04-24 18:42:56 UTC
Works for me already on 7.1. Tried 100%{FREE,VG,PVS}. FREE with already allocated space too, PVS with and witout pvs specified on command line.

lvm2-2.02.115-3.el7.x86_64

Comment 13 Marian Csontos 2015-04-24 18:50:25 UTC
Works fine with nightly RHEL7 build. Shall it go straight to modified?