Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 9. Building and provisioning a minimal raw image
The minimal-raw image is a pre-packaged, bootable, minimal RPM image, compressed in the xz format. The image consists of a file containing a partition layout with an existing deployed OSTree commit in it. You can build a RHEL for Edge Minimal Raw image type by using RHEL image builder and deploy the Minimal Raw image to the aarch64 and x86 architectures.
9.1. The minimal raw image build and deployment Copier lienLien copié sur presse-papiers!
Build a RHEL for Edge Minimal Raw image by using the minimal-raw image type. To boot the image, you must decompress it and copy to any bootable device, such as an SD card or a USB flash drive. You can log in to the deployed system with the user name and password that you specified in the blueprint that you used to create the RHEL for Edge Minimal Raw image.
Composing and deploying a RHEL for Edge Minimal Raw image involves the following high-level steps:
- Install and register a RHEL system
- Install RHEL image builder
- Using RHEL image builder, create a blueprint with your customizations for RHEL for Edge Minimal Raw image
- Import the RHEL for Edge blueprint in RHEL image builder
- Create a RHEL for Edge Minimal Raw image
- Download and decompress the RHEL for Edge Minimal Raw image
- Create a bootable USB drive from the decompressed Raw image
- Deploy the RHEL for Edge Minimal Raw image
9.2. Creating the blueprint for a Minimal Raw image by using RHEL image builder CLI Copier lienLien copié sur presse-papiers!
Create a blueprint, and customize it with a username and a password. You can use the resulting blueprint to create a Minimal Raw image and log in to it by using the credentials that you configured in the blueprint.
Procedure
Create a plain text file in the Tom’s Obvious, Minimal Language (TOML) format, with the following content:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - name is the name and description is the description for your blueprint.
- 0.0.1 is the version number according to the Semantic Versioning scheme.
- Modules describe the package name and matching version glob to be installed into the image, for example, the package name = "tmux" and the matching version glob is version = "2.9a". Currently there are no differences between packages and modules.
- Groups are packages groups to be installed into the image, for example the anaconda-tools group package. If you do not know the modules and groups, leave them empty.
Under
customizations.user:-
nameis the username to login to the image -
passwordis a password of your choice -
groupsare any user groups, such as "widget"
-
Import the blueprint to the RHEL image builder server:
composer-cli blueprints push <blueprint_name>.toml
# composer-cli blueprints push <blueprint_name>.tomlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check if the blueprint is available on the system:
composer-cli blueprints list
# composer-cli blueprints listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check the validity of components, versions, and their dependencies in the blueprint:
composer-cli blueprints depsolve <blueprint_name>
# composer-cli blueprints depsolve <blueprint_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
9.3. Creating a Minimal Raw image by using RHEL image builder CLI Copier lienLien copié sur presse-papiers!
Create a RHEL for Edge Minimal Raw image with the RHEL image builder command-line interface.
Prerequisites
- You created a blueprint for the RHEL for Edge Minimal Raw image.
Procedure
Build the image.
composer-cli compose start <blueprint_name> minimal-raw
# composer-cli compose start <blueprint_name> minimal-rawCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
<blueprint_name>is the RHEL for Edge blueprint name -
minimal-rawis the image type
-
Check the image compose status.
composer-cli compose status
# composer-cli compose statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow The output displays the status in the following format:
<UUID> RUNNING date <blueprint_name> blueprint-version minimal-raw
# <UUID> RUNNING date <blueprint_name> blueprint-version minimal-rawCopy to Clipboard Copied! Toggle word wrap Toggle overflow
9.4. Downloading and decompressing the Minimal Raw image Copier lienLien copié sur presse-papiers!
Download the RHEL for Edge Minimal Raw image by using RHEL image builder command-line interface, and then decompress the image to be able to boot it.
Prerequisites
- You have created a RHEL for Edge Minimal Raw image.
Procedure
Review the RHEL for Edge Minimal Raw image compose status.
composer-cli compose status
# composer-cli compose statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow The output must display the following details:
<UUID> FINISHED date <blueprint_name> <blueprint_version> minimal-raw
$ <UUID> FINISHED date <blueprint_name> <blueprint_version> minimal-rawCopy to Clipboard Copied! Toggle word wrap Toggle overflow Download the image:
composer-cli compose image <UUID>
# composer-cli compose image <UUID>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Image builder downloads the image into your working directory. The following output is an example:
3f9223c1-6ddb-4915-92fe-9e0869b8e209-raw.img.xz
3f9223c1-6ddb-4915-92fe-9e0869b8e209-raw.img.xzCopy to Clipboard Copied! Toggle word wrap Toggle overflow Decompress the image:
xz -d <UUID>-raw.img.xz
$ xz -d <UUID>-raw.img.xzCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Next
Use the decompressed bootable RHEL for Edge Minimal Raw image to create a bootable installation medium and use it as a boot device. The following documentation describes the procedure of creating an USB bootable device from an ISO image. However, the same steps apply to the RAW images, because the RAW image is equivalent to the ISO image.
See Creating a bootable USB device on Linux for more details.
9.5. Deploying the Minimal Raw image from a USB flash drive Copier lienLien copié sur presse-papiers!
After you created a bootable USB installation medium from the customized RHEL for Edge Minimal Raw image, you can continue the installation process by deploying the Minimal Raw image from the USB flash drive and booting your customized image.
Prerequisites
- You have a 8 GB USB flash drive.
- You have created a bootable installation medium from the RHEL for Edge Minimal Raw image to the USB drive.
Procedure
- Connect the USB flash drive to the computer where you want to boot your customized image.
- Power on the system.
Boot the RHEL for Edge Minimal Raw image from the USB flash drive. The boot menu shows you the following options:
Install Red Hat Enterprise Linux 9 Test this media & install Red Hat Enterprise Linux 9
Install Red Hat Enterprise Linux 9 Test this media & install Red Hat Enterprise Linux 9Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Choose Install Red Hat Enterprise Linux 9. This starts the system installation.
Verification
Boot into the image by using the username and password you configured in the blueprint.
Check the release:
cat /etc/os-release
$ cat /etc/os-releaseCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the block devices in the system:
lsblk
$ lsblkCopy to Clipboard Copied! Toggle word wrap Toggle overflow
9.6. Serving a RHEL for Edge Container image to build a RHEL for Edge Raw image Copier lienLien copié sur presse-papiers!
Create a RHEL for Edge Container image to serve it to a running container.
Prerequisites
- You have created a RHEL for Edge Minimal Raw image and downloaded it.
Procedure
Create a blueprint for the
rhel-edge-containerimage type, for example:name = "rhel-edge-container-no-users" description = "" version = "0.0.1"
name = "rhel-edge-container-no-users" description = "" version = "0.0.1"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Build a
rhel-edge-containerimage:composer-cli compose start-ostree <rhel-edge-container-no-users> rhel-edge-container
# composer-cli compose start-ostree <rhel-edge-container-no-users> rhel-edge-containerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check if the image is ready:
composer-cli compose status
# composer-cli compose statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow Download the
rhel-edge-containerimage as a.tarfile:composer-cli compose image <UUID>
# composer-cli compose image <UUID>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import the RHEL for Edge Container into Podman:
skopeo copy oci-archive:_<UUID>_-container.tar \ containers-storage:localhost/rfe-93-mirror:latest
$ skopeo copy oci-archive:_<UUID>_-container.tar \ containers-storage:localhost/rfe-93-mirror:latestCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the container and make it available by using the port 8080:
podman run -d --rm --name <rfe-93-mirror> -p 8080:8080 localhost/<rfe-93-mirror>
$ podman run -d --rm --name <rfe-93-mirror> -p 8080:8080 localhost/<rfe-93-mirror>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a blueprint for the
edge-raw-imageimage type, for example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Build a RHEL for Edge Raw image by serving the RHEL Edge Container to it:
composer-cli compose start-ostree edge-raw edge-raw-image \ --url http://10.88.0.1:8080/repo
# composer-cli compose start-ostree edge-raw edge-raw-image \ --url http://10.88.0.1:8080/repoCopy to Clipboard Copied! Toggle word wrap Toggle overflow Download the RHEL for Edge Raw image as a
.rawfile:composer-cli compose image <UUID>
# composer-cli compose image <UUID>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Decompress the RHEL for Edge Raw image:
xz --decompress <UUID>>-image.raw.xz
# xz --decompress <UUID>>-image.raw.xzCopy to Clipboard Copied! Toggle word wrap Toggle overflow