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

composer generates OCI images with customized boot partition as partition 4 instead of 3

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-10.1
    • osbuild
    • None
    • None
    • Important
    • image-builder
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

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

      When building an OCI image while specifying a /boot partition in the blueprint, the /boot partition gets configured as Partition 4 instead of partition 3:

      # parted /dev/nbd0 print
      Model: Unknown (unknown)
      Disk /dev/nbd0: 5586MB
      Sector size (logical/physical): 512B/512B
      Partition Table: gpt
      Disk Flags: 
      
      Number  Start   End     Size    File system  Name  Flags
       1      1049kB  2097kB  1049kB                     bios_grub
       2      2097kB  212MB   210MB   fat16              boot, esp
       4      212MB   2359MB  2147MB  xfs                bls_boot
       3      2359MB  5586MB  3226MB                     lvm
      

      This leads to Cloud providers to enlarge /boot instead of /, and breaks osbuild design (OSBuild - General principles) webpage:

      The partition that contains the root filesystem, whether this is a plain formatted partition, an LVM Volume Group, or a Btrfs partition, is always last in the partition table layout when it is automatically added. For Disk customizations the user-defined order is respected.
      

      What is the impact of this issue to you?

      Can't generate an image with /boot partition.

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

      python3-osbuild-158-1.el10.noarch
      osbuild-selinux-158-1.el10.noarch
      osbuild-158-1.el10.noarch
      osbuild-depsolve-dnf-158-1.el10.noarch
      osbuild-composer-core-149-4.el10_1.x86_64
      osbuild-luks2-158-1.el10.noarch
      osbuild-lvm2-158-1.el10.noarch
      osbuild-ostree-158-1.el10.noarch
      osbuild-composer-worker-149-4.el10_1.x86_64
      osbuild-composer-149-4.el10_1.x86_64

      How reproducible is this bug?

      Always

      Steps to reproduce

      1. Create a basic blueprint with /boot customization
        name = "TEST_MINIMAL_10_WITH_BOOT"
        description = "RHEL10"
        distro = "rhel-10.1"
        
        [[customizations.filesystem]]
        mountpoint = "/boot"
        size = "2048MiB"
        
      2. Push the blueprint and generate an OCI image
        # composer-cli blueprints push test_minimal_10_with_boot.toml 
        # composer-cli compose start TEST_MINIMAL_10_WITH_BOOT oci
        # composer-cli compose image <ID>
        
      3. Check the partitioning
        # modprobe nbd
        # qemu-nbd -c /dev/nbd0 ./<ID>.qcow2
        # fdisk -l /dev/nbd0
        

      Expected results

      Proper ordering (root as partition 4):

      Device        Start      End Sectors  Size Type
      /dev/nbd0p1    2048     4095    2048    1M BIOS boot
      /dev/nbd0p2    4096   413695  409600  200M EFI System
      /dev/nbd0p3  413696  4607999 4194304    2G Linux extended boot
      /dev/nbd0p4 4608000 10909662 6301663    3G Linux LVM
      

      Actual results

      Wrong ordering:

      Device        Start      End Sectors  Size Type
      /dev/nbd0p1    2048     4095    2048    1M BIOS boot
      /dev/nbd0p2    4096   413695  409600  200M EFI System
      /dev/nbd0p3 4608000 10909662 6301663    3G Linux LVM
      /dev/nbd0p4  413696  4607999 4194304    2G Linux extended boot
      
      Partition table entries are not in disk order.
      

              osbuilders Osbuilders Bot Account
              rhn-support-rmetrich Renaud Métrich
              Osbuilders Bot Account Osbuilders Bot Account
              Release Test Team Release Test Team
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: