Description of problem ====================== I propose to create new "% options" of lvm -l,--extents option which would be used with lvm thin volumes and be relative to the thin pool the thin volume belongs to (instead of the volume group of the thin pool). Proposed options are: * %POOL would be absolute percentage of the lvm thin pool * %POOLFREE would be percentage of the remaining space in lvm thin pool For example =========== -l200%POOL would be 2 times the size of thin pool this thin volume is created in -l50%POOLFREE would be half the the size of the remaining free space in the thin pool of a thin volume lvresize -l+50%POOLFREE /dev/vg_foo/lv_thinvol would extend the virtual size of given thin volume by the number described above
Will there be any upper limit to this? Or will it behave like the current '+100%FREE' wrt thin volumes? [root@host-120 ~]# lvextend -l+10000%FREE snapper_thinp/origin Size of logical volume snapper_thinp/origin changed from 1.00 GiB (256 extents) to 12.01 TiB (3147856 extents). Logical volume origin successfully resized [root@host-120 ~]# lvextend -l+10000%FREE snapper_thinp/origin Size of logical volume snapper_thinp/origin changed from 12.01 TiB (3147856 extents) to 24.02 TiB (6295456 extents). Logical volume origin successfully resized [root@host-120 ~]# lvextend -l+10000%FREE snapper_thinp/origin Size of logical volume snapper_thinp/origin changed from 24.02 TiB (6295456 extents) to 36.02 TiB (9443056 extents). Logical volume origin successfully resized [root@host-120 ~]# lvs -a -o +devices LV VG Attr LSize Pool Origin Data% Meta% Devices POOL snapper_thinp twi---t--- 2.00g 0.02 0.98 POOL_tdata(0) [POOL_tdata] snapper_thinp Twi-ao---- 2.00g /dev/sdd1(1) [POOL_tmeta] snapper_thinp ewi-ao---- 4.00m /dev/sdf1(0) [lvol0_pmspare] snapper_thinp ewi------- 4.00m /dev/sdd1(0) origin snapper_thinp Vwi-a-t--- 36.02t POOL 0.00
Since there is no upper limit for thin volume size when you specify it's virtual size in bytes or extents, it would make more sense to have no limits there as well.
Out of curiosity, will this ever be supported for VDO either? [root@hayes-01 ~]# lvcreate --yes --type linear -n vdo_pool_808558 -L 5.1G vdo_sanity Rounding up size to full physical extent 5.10 GiB Wiping vdo signature on /dev/vdo_sanity/vdo_pool_808558. Logical volume "vdo_pool_808558" created. [root@hayes-01 ~]# lvconvert --yes --type vdo-pool -n vdo_lv -V 100%POOL vdo_sanity/vdo_pool_808558 Can't parse size argument. Invalid argument for --virtualsize: 100%POOL Error during parsing of command line. kernel-4.18.0-367.el8 BUILT: Thu Feb 10 14:33:16 CST 2022 lvm2-2.03.14-3.el8 BUILT: Tue Jan 4 14:54:16 CST 2022 lvm2-libs-2.03.14-3.el8 BUILT: Tue Jan 4 14:54:16 CST 2022