Building LVM whole disk image with podman fails with many different errors

Solution In Progress - Updated -

Issue

  • Building LVM whole disk image with podman fails with many different errors .

  • First of all, in rootfull podman images, we have to mount /dev:/dev in order to have /dev/loop0 available.

  • Secondly, when disk image build completes, /dev/loop0 doesn't appear to be unmounted and once the image building process, it doesn't appear to destroy those devices from the os itself.

  • If we manage to get farther, it looks like lvcreate will fail due to /dev/vol (lvm mapper) doesn't exist:

021-07-16 15:34:48.460 | INFO diskimage_builder.block_device.utils [-] Calling [sudo vgcreate vol /dev/mapper/loop0p1 --force]
2021-07-16 15:34:48.523 | DEBUG diskimage_builder.block_device.utils [-] exec_sudo:   Volume group "vol" successfully created exec_sudo /usr/lib/python3.6/site-packages/diskimage_builder/block_device/utils.py:135
2021-07-16 15:34:48.543 | INFO diskimage_builder.block_device.utils [-] Calling [sudo vgmknodes]
2021-07-16 15:34:48.610 | DEBUG diskimage_builder.block_device.level1.lvm [-] Creating lv command [['lvcreate', '--name', 'lv_root', '-l', '23%VG', 'vol']] _create /usr/lib/python3.6/site-packages/diskimage_builder/block_device/level1/lvm.py:207
2021-07-16 15:34:48.610 | INFO diskimage_builder.block_device.utils [-] Calling [sudo lvcreate --name lv_root -l 23%VG vol]
2021-07-16 15:34:48.677 | DEBUG diskimage_builder.block_device.utils [-] exec_sudo:   /dev/vol/lv_root: not found: device not cleared exec_sudo /usr/lib/python3.6/site-packages/diskimage_builder/block_device/utils.py:135
2021-07-16 15:34:48.677 | DEBUG diskimage_builder.block_device.utils [-] exec_sudo:   Aborting. Failed to wipe start of new LV. exec_sudo /usr/lib/python3.6/site-packages/diskimage_builder/block_device/utils.py:135
2021-07-16 15:34:48.719 | ERROR diskimage_builder.block_device.blockdevice [-] Create failed; rollback initiated
2021-07-16 15:34:48.720 | Traceback (most recent call last):
2021-07-16 15:34:48.720 |   File "/usr/lib/python3.6/site-packages/diskimage_builder/block_device/blockdevice.py", line 407, in cmd_create
2021-07-16 15:34:48.720 |     node.create()
2021-07-16 15:34:48.720 |   File "/usr/lib/python3.6/site-packages/diskimage_builder/block_device/level1/lvm.py", line 283, in create
2021-07-16 15:34:48.720 |     lvs._create()
2021-07-16 15:34:48.720 |   File "/usr/lib/python3.6/site-packages/diskimage_builder/block_device/level1/lvm.py", line 208, in _create
2021-07-16 15:34:48.720 |     exec_sudo(cmd)
2021-07-16 15:34:48.720 |   File "/usr/lib/python3.6/site-packages/diskimage_builder/block_device/utils.py", line 143, in exec_sudo
2021-07-16 15:34:48.720 |     raise e
2021-07-16 15:34:48.720 | diskimage_builder.block_device.exception.BlockDeviceSetupException: exec_sudo failed

Environment

  • Red Hat OpenStack Platform 16.1 (RHOSP)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In