Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2151601

Summary: lvextend should display warning when attempting to over provision
Product: Red Hat Enterprise Linux 9 Reporter: Chris Mackowski <cmackows>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: Thin Provisioning QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, thornber, zkabelac
Version: 9.2Keywords: Regression, Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.03.17-4.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 08:23:51 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:

Description Chris Mackowski 2022-12-07 15:40:22 UTC
lvextend should display warning when attempting to over provision and the auto extend threshold is set to 100. 
Reference bz 1189221 

# RHEL9.2:

kernel-5.14.0-201.kpq1.el9    BUILT: Wed Nov 23 07:13:08 AM CST 2022
lvm2-2.03.17-2.el9    BUILT: Wed Nov 30 02:56:30 AM CST 2022

        # Example
        # Using 70% autoextend threshold and 20% autoextend size, when a 1G
        # thin pool exceeds 700M, it is extended to 1.2G, and when it exceeds
        # 840M, it is extended to 1.44G:
        # thin_pool_autoextend_threshold = 70
        #
        # This configuration option has an automatic default value.
        # thin_pool_autoextend_threshold = 100

[root@hayes-02 ~]# lvmconfig --typeconfig default activation/thin_pool_autoextend_threshold
# thin_pool_autoextend_threshold=100
[root@hayes-02 ~]# lvmconfig --typeconfig full activation/thin_pool_autoextend_threshold
thin_pool_autoextend_threshold=100


[root@hayes-02 ~]# lvextend -L +250M snapper_thinp/extend_snap
  Rounding size to boundary between physical extents: 252.00 MiB.
  Size of logical volume snapper_thinp/extend_snap changed from 90.92 TiB (23835129 extents) to 90.92 TiB (23835192 extents).
  Logical volume snapper_thinp/extend_snap successfully resized.
[root@hayes-02 ~]# lvextend -l+1000%FREE snapper_thinp/extend_snap
  Size of logical volume snapper_thinp/extend_snap changed from 90.92 TiB (23835192 extents) to <181.85 TiB (47670002 extents).
  Logical volume snapper_thinp/extend_snap successfully resized.


For example with RHEL 8.8 we see the expected warning message:
# RHEL8.8:

kernel-4.18.0-440.el8    BUILT: Tue Nov 22 14:01:37 CST 2022
lvm2-2.03.14-7.el8    BUILT: Tue Nov 29 07:49:15 CST 2022

        # Example
        # Using 70% autoextend threshold and 20% autoextend size, when a 1G
        # thin pool exceeds 700M, it is extended to 1.2G, and when it exceeds
        # 840M, it is extended to 1.44G:
        # thin_pool_autoextend_threshold = 70
        #
        # This configuration option has an automatic default value.
        # thin_pool_autoextend_threshold = 100


[root@hayes-01 ~]# lvextend -L +250M snapper_thinp/extend_snap
  Rounding size to boundary between physical extents: 252.00 MiB.
  Size of logical volume snapper_thinp/extend_snap changed from 1.00 GiB (256 extents) to <1.25 GiB (319 extents).
  WARNING: Sum of all thin volume sizes (<3.25 GiB) exceeds the size of thin pool snapper_thinp/POOL (2.00 GiB).
  WARNING: You have not turned on protection against thin pools running out of space.
  WARNING: Set activation/thin_pool_autoextend_threshold below 100 to trigger automatic extension of thin pools before they get full.
  Logical volume snapper_thinp/extend_snap successfully resized.

[root@hayes-01 ~]# lvextend -l+1000%FREE snapper_thinp/extend_snap
  Size of logical volume snapper_thinp/extend_snap changed from <72.75 TiB (19069689 extents) to <145.49 TiB (38139059 extents).
  WARNING: Sum of all thin volume sizes (145.49 TiB) exceeds the size of thin pool snapper_thinp/POOL and the size of whole volume group (<7.28 TiB).
  WARNING: You have not turned on protection against thin pools running out of space.
  WARNING: Set activation/thin_pool_autoextend_threshold below 100 to trigger automatic extension of thin pools before they get full.
  Logical volume snapper_thinp/extend_snap successfully resized.

Comment 2 David Teigland 2022-12-15 16:04:34 UTC
This is a result of 18722dfdf4d3 lvresize: restructure code
which mistakenly moved the overprovisioning check from lv_is_thin_type to lv_is_thin_pool so it no longer applied to thin LVs, so warning messages could be missed when extending thin lvs.

fix in main branch
https://sourceware.org/git/?p=lvm2.git;a=commit;h=4baef0f93f608403b6f2db445e7bf1e80f8f3ee6

Comment 8 errata-xmlrpc 2023-05-09 08:23:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (lvm2 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2544