Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-76508

[Epic]: Ansible storage role 'grow_to_fill' option on LVM pools always failing with LVM resize failure due to miscalculation of free extents. [rhel-10]

    • [Epic]: Ansible storage role 'grow_to_fill' option on LVM pools always failing with LVM resize failure due to miscalculation of free extents. [rhel-10]
    • Moderate
    • Red Hat Ansible Automation Platform, Red Hat Ansible Collections for Runtimes, Red Hat Enterprise Linux
    • 0% To Do, 50% In Progress, 50% Done
    • rhel-sst-system-roles
    • False
    • Hide

      None

      Show
      None
    • Yes
    • Dev ack
    • Bug Fix
    • Hide

      The issues with the PV grow feature: the code doesn't correctly set the `grow_to_fill` property for blivet and uses VG size instead of the underlying block device size for the target size for the resize action. I've fixed these and adjusted tests to actually check the PV size after resize without allowing for difference bigger than 4 MiB (one physical extent for metadata and padding) and to cover the customer issue (resizing both the PV format and LV).
      Show
      The issues with the PV grow feature: the code doesn't correctly set the `grow_to_fill` property for blivet and uses VG size instead of the underlying block device size for the target size for the resize action. I've fixed these and adjusted tests to actually check the PV size after resize without allowing for difference bigger than 4 MiB (one physical extent for metadata and padding) and to cover the customer issue (resizing both the PV format and LV).
    • Proposed

      This is a clone of issue RHEL-73244 to use for version rhel-10.0

      Original description:

      What were you trying to do that didn't work?

      Resize a logical volume to use the remaining free space in volume group.
       

        What were you trying to do that didn't work?

      Customer has been troubleshooting the use of this library in the "ansible linux-system-roles" collection, and have traced an issue with the resizing capabilities to what I believe to be a size calculation bug in blivet. I searched the issues and didn't see anything related, so I'm opening this here.

      Note: I first encountered this bug while trying to use blivet to resize a logical volume (after resizing the underlying disk) but have been able to reproduce the issue by simply calling the LVMLogicalVolumeDevice.resize() method even when there is no extra space available.

      Customer as been troubleshooting the use of this library in the ansible linux-system-roles collection and has traced an issue with the resizing capabilities to what they believe to be a size calculation bug in blivet. The customer has searched the issues and didn't see anything related, so they've opened a case with us, and an upstream BZ.

      "LVM resize fails with calculation error - pv metadata unaccounted for #1320"

      https://github.com/storaged-project/blivet/issues/1320

      Note: Customer first encountered this bug while trying to use blivet to resize a logical volume (after resizing the underlying disk) but have been able to reproduce the issue by simply calling the LVMLogicalVolumeDevice.resize() method even when there is no extra space available.

       

      What is the impact of this issue to you?

      Customer is able to work-around the issue in the LVM CLI using `lvextend`.

      Please provide the package NVR for which the bug is seen:

      blivet-data-3.6.0-17.el9.noarch                             Fri Nov 22 09:56:23 2024
      libblockdev-lvm-2.28-10.el9.x86_64                          Fri Nov 22 09:56:23 2024
      lvm2-2.03.24-2.el9.x86_64                                   Sun Nov 17 06:56:02 2024
      lvm2-libs-2.03.24-2.el9.x86_64                              Sun Nov 17 06:55:36 2024
      python3-blivet-3.6.0-17.el9.noarch                          Fri Nov 22 09:56:26 2024

      How reproducible is this bug?:

      Easily reproducible using the following steps below.

      Steps to reproduce:

       1.) Build a fresh rhel server with one spare disk (in my case scsi controller 0, channel 1)

       2.) Apply the vars I shared in my first post (replace /dev/disk/by-scsi/0_0_1_0 with /dev/sdb or other compatible udev path)

       3.) Run the ansible storage role once to create the lvm pool/volume

       4.) Run the ansible storage role again with grow_to_fill: true and it fails with the message stated.

      Expected results:

      Expect that when using the Ansible role to resize the logical volume, that given there are adequate free extents available, the volume will be successfully resized without error/issue.

      Actual results:

      Failed to commit changes to disk: Process reported exit code 5: Insufficient free space: <n> extents needed, but only <n-1> extents available

              rmeggins@redhat.com Richard Megginson
              rmeggins@redhat.com Richard Megginson
              Richard Megginson Richard Megginson
              David Jez David Jez
              Jaroslav Klech Jaroslav Klech
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: