Bug 2141738

Summary: Image builder fails with Volume group "XXX" has insufficient free space (975 extents): 977 required.
Product: Red Hat Enterprise Linux 8 Reporter: jcastran
Component: osbuild-composerAssignee: Image Builder team <osbuilders>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: high    
Version: 8.7CC: atodorov, obudai, sbarcomb, thozza
Target Milestone: rcKeywords: Patch, Reproducer, Triaged
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: osbuild-composer-69-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-16 08:27:17 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 jcastran 2022-11-10 16:35:30 UTC
Description of problem:
Locally hosted Image builder is miscalculating the size of the Volume Group needed resulting in not enough extents for an image to be built.

Version-Release number of selected component (if applicable):
osbuild-composer-62-3.el8_7.x86_64

How reproducible:
Everytime

Steps to Reproduce:
1. Use blueprint attached
2. composer-cli compose start BLUEPRINT vmdk
3.

Actual results:
LVM2: using vg name '7ace2e05-f05a-4b0e-9c2c-ca16e32dfd89'
  Physical volume "/dev/loop0" successfully created.
  Volume group "7ace2e05-f05a-4b0e-9c2c-ca16e32dfd89" successfully created
  Rounding up size to full physical extent 29.80 GiB
  WARNING: Logical volume 7ace2e05-f05a-4b0e-9c2c-ca16e32dfd89/rootlv not zeroed.
  Logical volume "rootlv" created.
  Rounding up size to full physical extent <3.82 GiB
  WARNING: Logical volume 7ace2e05-f05a-4b0e-9c2c-ca16e32dfd89/varlv not zeroed.
  Logical volume "varlv" created.
  Rounding up size to full physical extent <3.82 GiB
  WARNING: Logical volume 7ace2e05-f05a-4b0e-9c2c-ca16e32dfd89/var_loglv not zeroed.
  Logical volume "var_loglv" created.
  Rounding up size to full physical extent <3.82 GiB
  WARNING: Logical volume 7ace2e05-f05a-4b0e-9c2c-ca16e32dfd89/var_tmplv not zeroed.
  Logical volume "var_tmplv" created.
  Rounding up size to full physical extent <3.82 GiB
  Volume group "7ace2e05-f05a-4b0e-9c2c-ca16e32dfd89" has insufficient free space (975 extents): 977 required.
Traceback (most recent call last):
  File "/run/osbuild/bin/org.osbuild.lvm2.create", line 112, in <module>
    ret = main(args["devices"], args["options"])
  File "/run/osbuild/bin/org.osbuild.lvm2.create", line 107, in main
    subprocess.run(cmd, encoding='utf-8', check=True)
  File "/usr/lib64/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['lvcreate', '-an', '--size', '4096786432B', '-n', 'var_log_auditlv', '7ace2e05-f05a-4b0e-9c2c-ca16e32dfd89']' returned non-zero exit status 5.

Additional info:
This did not fail on console.redhat.com/insights/ where I specified size by MB, not bytes

Comment 2 Tomáš Hozza 2022-11-11 10:12:03 UTC
Thanks for the report.

I was able to reproduce the issue using the attached blueprint...

Comment 4 Ondřej Budai 2022-11-14 09:36:43 UTC
Image Builder on RHEL also supports different units than bytes:

[[customizations.filesystem]]
mountpoint = "/"
size = "32 GiB"

[[customizations.filesystem]]
mountpoint = "/var"
size = "4 GiB"

[[customizations.filesystem]]
mountpoint = "/var/log"
size = "4 GiB"

[[customizations.filesystem]]
mountpoint = "/var/tmp"
size = "4 GiB"

[[customizations.filesystem]]
mountpoint = "/var/log/audit"
size = "4 GiB"

Composer has some issues with rounding extents, so this should help. Can you try that?

Comment 5 Christian Kellner 2022-11-18 18:36:03 UTC
PR #3137 is merged upstream.

Comment 8 Tomáš Hozza 2022-12-13 17:21:47 UTC
Fixed in osbuild-composer-69-1.el8

Comment 13 Alexander Todorov 2023-02-14 14:22:43 UTC
# rpm -q osbuild-composer 
osbuild-composer-46.1-1.el8.x86_64

# composer-cli compose start RHEL8-VMWare-CIS vmdk
Compose b538a417-e0ee-41ce-9247-0230a8b3f8fb added to the queue

# composer-cli compose status 
b538a417-e0ee-41ce-9247-0230a8b3f8fb FAILED   Tue Feb 14 08:58:00 2023 RHEL8-VMWare-CIS 0.0.1 vmdk  

Traceback from comment #0 confirmed.



After upgrade:

# rpm -q osbuild-composer
osbuild-composer-73-1.el8.x86_64

# composer-cli compose start RHEL8-VMWare-CIS vmdk
Compose 9670ce16-46e8-4d46-b6f1-60954b77dea8 added to the queue

# composer-cli compose status
9670ce16-46e8-4d46-b6f1-60954b77dea8 FINISHED Tue Feb 14 09:22:09 2023 RHEL8-VMWare-CIS 0.0.1 vmdk             48384000000

Comment 15 errata-xmlrpc 2023-05-16 08:27:17 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 (Moderate: Image Builder security, 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/RHSA-2023:2780