Bug 2022805

Summary: Unify the default partitioning scheme used by all non-EDGE RHEL-9 images
Product: Red Hat Enterprise Linux 9 Reporter: Tomáš Hozza <thozza>
Component: osbuild-composerAssignee: Tomáš Hozza <thozza>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.0CC: akoutsou, bfinger, elpereir, jrusz, linl, wshi, xiliang, ymao
Target Milestone: rcKeywords: Patch, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: osbuild-composer-42-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 13:30:01 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 Tomáš Hozza 2021-11-12 16:02:24 UTC
Description of problem:
During the work on porting the official RHEL-8.5 and 9.0 EC2 image definitions from kickstarts to Image Builder, it has been determined that the default partitioning scheme used by EC2 images is different compared to what has been previously used by Image Builder for all images, including EC2 images.

The EC2 image definitions were ported as they were defined in the respective kickstarts to not introduce any regressions (especially on RHEL-8). As a result, Image Builder now uses a different default partitioning scheme for EC2 RHEL images and any other types of RHEL images (for ones that use partitions).

This bug requests unification of the default partitioning scheme for all RHEL images supported by osbuild-composer on all architectures. This would affect mainly the x86_64 and aarch64 architectures and the RHEL KVM guest image and RHEL EC2 images.


The current state:
The default partitioning scheme used by RHEL KVM Guest image:
 - In general, the default partitioning scheme does not use a separate /boot partition on any of the supported architectures.
 - x86_64 architecture
   - defined in Image Builder as https://github.com/osbuild/osbuild-composer/blob/117886a75fdf2cb00ae66047792181d59818d266/internal/distro/rhel90beta/partition_tables.go#L9-L45
   - Uses GPT.
   - Uses hybrid partitioning scheme (BIOS + UEFI) without a separate /boot partition.
 - aarch64 architecture
   - defined in Image Builder as https://github.com/osbuild/osbuild-composer/blob/117886a75fdf2cb00ae66047792181d59818d266/internal/distro/rhel90beta/partition_tables.go#L46-L76
   - Uses GPT.
   - Uses UEFI partitioning scheme without a separate /boot partition.

The default partitioning scheme used by RHEL EC2 images:
 - x86_64 architecture
   - defined in Image Builder as https://github.com/osbuild/osbuild-composer/blob/117886a75fdf2cb00ae66047792181d59818d266/internal/distro/rhel90beta/partition_tables.go#L116-L139
   - Uses GPT.
   - Uses legacy (BIOS) partitioning scheme without a separate /boot partition.
 - aarch64 architecture
   - defined in Image Builder as https://github.com/osbuild/osbuild-composer/blob/117886a75fdf2cb00ae66047792181d59818d266/internal/distro/rhel90beta/partition_tables.go#L140-L182
   - Uses GPT.
   - Uses UEFI partitioning scheme with a separate /boot partition.


Proposed change:
1. Make the default partitioning scheme on all architectures for all images to use a separate /boot partition.
   - This would affect the RHEL KVM guest image.
   - This would affect the RHEL EC2 x86_64 images (the base EC2, EC2-HA, and EC2-SAP).
   - Having the separate /boot would be useful going forward once Image Builder would allow users to customize partitioning while using LVM.
2. Use a hybrid partitioning scheme (UEFI + BIOS) on all x86_64 EC2 images.
   - This would make the partitioning scheme consistent with what is being used for the RHEL KVM guest image as well as with that Image Builder uses for Azure and VMWare images.


Additional information:
 - x86_64 EC2 images produced by Image Builder with a hybrid partitioning scheme before RHEL-8.5 worked just fine in AWS. AWS documentation states that most Intel-based instances can run both UEFI and Legacy BIOS (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html).
 - A separate /boot partition is needed in case the root partition is encrypted or uses LVM.

Comment 1 Tomáš Hozza 2021-11-16 12:30:31 UTC
After a discussion within the Image Builder team, it seems impractical to have only one default partitioning scheme. My original goal was to get rid of the separate default partitioning scheme used by EC2 images, especially since the x86 image used only legacy BIOS Boot partition. We determined that EDGE images may have a special requirements, therefore we agreed to unify the default partitioning scheme only for non-EDGE images.

The sizes used for relevant partitions are currently 

- /boot/efi
  - guest image - 100 MB
  - EC2 image - 200 MB
- /boot
  - guest image - N/A
  - EC2 image - 500 MB


The RHEL-8 documentation (https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/performing_an_advanced_rhel_installation/partitioning-reference_installing-rhel-as-an-experienced-user) suggests 200 MB for /boot/efi and 1TB for /boot. There is no such documentation for RHEL-9.

The proposal that we agreed on is to use:
- /boot/efi - 200 MB
- /boot - 500 MB

Comment 2 Tomáš Hozza 2021-11-24 12:34:35 UTC
Draft PR submitted in the upstream - https://github.com/osbuild/osbuild-composer/pull/2019

Comment 8 errata-xmlrpc 2022-05-17 13:30:01 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 (new packages: osbuild-composer), 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/RHBA-2022:2522