Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to generate a based centos stream 9 vhd image with customized rootfs size #4030

Open
shi2wei3 opened this issue Mar 21, 2024 · 0 comments

Comments

@shi2wei3
Copy link

Describe the bug
Failed to create a LVM based centos stream 9 vhd image with customized rootfs size, however I can successfully generate a non-lvm image with the same blueprint file by just modify partitioning_mode = "raw"

Environment

  • CentOS Stream release 9
  • osbuild-composer-101-1.el9.x86_64

To Reproduce
Steps to reproduce the behavior:

  • override system repos
  • create blueprint file with customized rootfs size and lvm partition mode
name = "lvm-vhd"
version = "0.0.1"

packages = [
   { name = "cloud-init" },
   { name = "WALinuxAgent" },
   { name = "podman" },
]

[customizations]
partitioning_mode = "lvm"

[[customizations.filesystem]]
mountpoint = "/boot"
minsize = "1 GiB"

[[customizations.filesystem]]
mountpoint = "/"
minsize = "8 GiB"
  • push the blueprint and restart the service
# composer-cli blueprints push <blueprint>
# systemctl restart osbuild-composer
  • create vhd image
composer-cli compose start <blueprint> vhd

Expected behavior
vhd disk image is created successfully

Additional context
error log

Stage: org.osbuild.sfdisk
Output:
Failed to open file "/sys/fs/selinux/checkreqprot": Read-only file system
label: gpt
label-id: D209C89E-EA5E-4FBD-B161-B461CCE297E0
start="2048", size="2048", type="21686148-6449-6E6F-744E-656564454649", uuid="FAC7F1FB-3E8D-4137-A512-961DE09A5549", bootable
start="4096", size="409600", type="C12A7328-F81F-11D2-BA4B-00A0C93EC93B", uuid="68B2905B-DF3E-4FB3-80FA-49D1E773AA33"
start="413696", size="2097152", type="BC13C2FF-59E6-4262-A352-B275FD6F7172", uuid="CB07C243-BC44-4717-853E-28852021225B"
start="2510848", size="16775135", type="E6D6D379-F507-44C2-A23C-238F2A3DF928", uuid="6264D520-3FB9-423F-8AB8-7A0A8E3D3562"
{
   "partitiontable": {
      "label": "gpt",
      "id": "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
      "device": "/dev/loop0",
      "unit": "sectors",
      "firstlba": 2048,
      "lastlba": 19285982,
      "sectorsize": 512,
      "partitions": [
         {
            "node": "/dev/loop0p1",
            "start": 2048,
            "size": 2048,
            "type": "21686148-6449-6E6F-744E-656564454649",
            "uuid": "FAC7F1FB-3E8D-4137-A512-961DE09A5549"
         },{
            "node": "/dev/loop0p2",
            "start": 4096,
            "size": 409600,
            "type": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
            "uuid": "68B2905B-DF3E-4FB3-80FA-49D1E773AA33"
         },{
            "node": "/dev/loop0p3",
            "start": 413696,
            "size": 2097152,
            "type": "BC13C2FF-59E6-4262-A352-B275FD6F7172",
            "uuid": "CB07C243-BC44-4717-853E-28852021225B"
         },{
            "node": "/dev/loop0p4",
            "start": 2510848,
            "size": 16775135,
            "type": "E6D6D379-F507-44C2-A23C-238F2A3DF928",
            "uuid": "6264D520-3FB9-423F-8AB8-7A0A8E3D3562"
         }
      ]
   }
}

Stage: org.osbuild.lvm2.create
Output:
Failed to open file "/sys/fs/selinux/checkreqprot": Read-only file system
LVM2: using vg name '7f3c8715-0751-4ec9-a45a-008621117515'
  Physical volume "/dev/loop0" successfully created.
  Creating devices file /etc/lvm/devices/system.devices
  Volume group "7f3c8715-0751-4ec9-a45a-008621117515" successfully created
  Volume group "7f3c8715-0751-4ec9-a45a-008621117515" has insufficient free space (2047 extents): 2048 required.
Traceback (most recent call last):
  File "/run/osbuild/bin/org.osbuild.lvm2.create", line 110, in <module>
    ret = main(args["devices"], args["options"])
  File "/run/osbuild/bin/org.osbuild.lvm2.create", line 105, in main
    subprocess.run(cmd, encoding='utf8', check=True)
  File "/usr/lib64/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['lvcreate', '-an', '--size', '8589934592B', '-n', 'rootlv', '7f3c8715-0751-4ec9-a45a-008621117515']' returned non-zero exit status 5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant