Bug 1196430 - vgcreate --physicalextentsize does not do a range check
Summary: vgcreate --physicalextentsize does not do a range check
Keywords:
Status: NEW
Alias: None
Product: LVM and device-mapper
Classification: Community
Component: lvm2
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: Fedora
: ---
Assignee: LVM Team
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-25 23:55 UTC by Tony Asleson
Modified: 2023-08-10 15:40 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:
rule-engine: lvm-technical-solution?
rule-engine: lvm-test-coverage?


Attachments (Terms of Use)

Description Tony Asleson 2015-02-25 23:55:46 UTC
Description of problem:

When using the --physicalextentsize option to vgcreate it is possible to create a vg that is unusable.

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

Don't think this is specific to any version, but this is what I was running:

# lvm version
LVM version:     2.02.116(2) (2015-01-30)
Library version: 1.02.93 (2015-01-30)
Driver version:  4.28.0


How reproducible:

Every time

Steps to Reproduce:

Create a vg with a PE size that is > than the total size of the PVs that comprise the VG.

# pvs
  ...
  /dev/sdg           lvm2 ---   18.00g  18.00g
  /dev/sdh           lvm2 ---   18.00g  18.00g


# vgcreate --physicalextentsize 1T pe_size_test /dev/sdg /dev/sdh ; echo $?
  Volume group "pe_size_test" successfully created
0

# vgs -o vg_extent_size,vg_name,vg_extent_count,vg_size pe_size_test
  Ext   VG           #Ext VSize
  1.00t pe_size_test    0    0


Actual results:

The vg is created but shows no available space and you are unable to create a LV from it.

# pvs -S "vg_name='pe_size_test'"
  PV         VG           Fmt  Attr PSize  PFree
  /dev/sdg   pe_size_test lvm2 a--  18.00g    0 
  /dev/sdh   pe_size_test lvm2 a--  18.00g    0 

# vgs pe_size_test
  VG           #PV #LV #SN Attr   VSize VFree
  pe_size_test   2   0   0 wz--n-    0     0

# lvcreate -L 100m pe_size_test ; echo $?
  Rounding up size to full physical extent 1.00 TiB
  Volume group "pe_size_test" has insufficient free space (0 extents): 1 required.
5

Expected results:

The vgcreate command should ideally fail if the PE size is out of range with a non-zero exit code and a useful error message.

Additional info:

Man page states:

"If the volume group metadata uses lvm2 format those restrictions do not apply, but having a large number  of extents  will slow down the tools but have no impact on I/O performance to the logical volume.  The smallest PE is 1KiB"

The smallest appears to be 512B from usage and at the moment the largest is unbound.  The man page should be updated to correct size ranges or limitations when the additional checks are added.

Comment 1 Corey Marthaler 2015-02-26 00:28:03 UTC
This was talked about in bug 1100514.

Comment 2 Peter Rajnoha 2015-09-23 12:45:27 UTC
As for the upper bound for the extent size - it's true that we could possibly do a check during vgcreate - we could check the list of PVs and see if we're able to do any sane allocation with the extent size specified given the disks we're using. However, the VG can still be extented later on with a PV that would make the allocation possible (in your example above, the vgextend with a PV that has 1t would do it).

So it's questionable whether limiting the extent size during vgcreate is the right choice here. Maybe we could just print a warning instead with a question? Something like "With the PVs given, it won't be possible to allocate any LVs. Do you want to continue with vgcreate? Y/N" Something like that...

Comment 3 Alasdair Kergon 2015-09-23 13:12:01 UTC
People might want a PV just for metadata, not for data, so there is no longer a requirement for every PV to hold at least one PE.

Comment 4 Fedora End Of Life 2015-11-04 10:27:14 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Jan Kurik 2016-02-24 15:40:54 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 6 Fedora End Of Life 2017-07-25 18:50:48 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 7 Fedora End Of Life 2018-05-03 09:08:25 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 8 Zdenek Kabelac 2018-05-03 09:20:19 UTC
Hmm not yet fixed, taking it myself.


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