Prepare a MAAS-Compatible CoreOS Image
Red Hat Enterprise Linux CoreOS (RHCOS) and the related CentOS Stream CoreOS (SCOS) are incompatible with the standard MAAS/Curtin deployment process out of the box. MAAS deploys machines using a two-stage boot process in which Curtin writes and validates the target OS disk image. Curtin expects a traditional Linux root filesystem layout, including:
- a
/curtindirectory cloud-initas the machine configuration tool- a standard filesystem structure
None of these are provided natively by RHCOS or SCOS, as both are immutable OSTree-based operating systems. In addition, they use Ignition for machine configuration rather than cloud-init.
To work around this, the MAAS-compatible CoreOS image build process appends a minimal Ubuntu root filesystem as an extra partition to the official CoreOS raw image. This allows Curtin validation to pass, while Curtin hooks persist the real Ignition configuration for the CoreOS variant, which is applied on first boot.
This guide walks you through importing a MAAS-compatible CoreOS image into your MAAS environment. This image is required before you can deploy OpenShift workload clusters on MAAS using HyperShift. You can choose between the two options described in the following table.
| Option | Requirements | Usage |
|---|---|---|
| Option 1 - Use the Pre-Built Docker Image | Docker, MAAS credentials | You want to use the published SCOS version with minimal effort. |
| Option 2 - Build Your Own Image | Linux build host with root, MAAS CLI | You need a specific RHCOS version or want to customize the image. |
Option 1 - Use the Pre-Built Docker Image
The pre-built Docker image bundles a MAAS-ready SCOS image and the MAAS CLI. Use this option to import the published SCOS version with minimal effort.
Prerequisites
-
A host with Docker installed.
- The host must have network access to your MAAS server endpoint to import the image successfully.
-
A MAAS server endpoint and API key. Refer to the MAAS API Keys documentation for guidance on obtaining your API key.
Enablement
-
Log in to the host where Docker is installed and has access to your MAAS server endpoint.
-
Use the following command to pull the pre-built Docker image.
Last update: May 31, 2026
Export image variableexport IMAGE=us-docker.pkg.dev/palette-images/third-party/scos-maas:v10.0.20250628-0Pull the Docker imagedocker pull $IMAGE -
Set your MAAS credentials as environment variables. Replace
<https://your-maas-server/MAAS>and<maas-api-key>with your MAAS server endpoint and API key, respectively.Set MAAS credentialsexport MAAS_ENDPOINT="<https://your-maas-server/MAAS>"
export MAAS_API_KEY="<maas-api-key>" -
Use the following command to import the SCOS image into MAAS.
- Replace
<image-name>with a descriptive name for the image as it will appear in the MAAS boot resources list. - Replace
<operating-system>with the OS name to associate with the image in MAAS. - Replace
<release-version>with the OS version to associate with the image in MAAS.
Templatedocker run --rm \
--env MAAS_ENDPOINT="$MAAS_ENDPOINT" \
--env MAAS_API_KEY="$MAAS_API_KEY" \
$IMAGE \
/image.raw.gz <image-name> <operating-system> <release-version>The
/image.raw.gzargument refers to the SCOS image path inside the container and should not be changed.Exampledocker run --rm \
--env MAAS_ENDPOINT="$MAAS_ENDPOINT" \
--env MAAS_API_KEY="$MAAS_API_KEY" \
$IMAGE \
/image.raw.gz scos-10.0 scos 10.0.20250628-0Once the command completes, the image will appear in the MAAS boot resources list under the Custom or Other category. Partition cleanup is handled automatically during deployment; no manual disk management is required.
- Replace
Validate
- MAAS UI
- MAAS CLI
-
Log in to your MAAS server web interface.
-
From the left sidebar, navigate to Images.
-
Locate the image under the Custom or Other category and verify it appears with the name you specified during import. The name appears under the Release Title column. For example,
scos-10.0. -
Confirm the image status is Synced.
Use the following command to list all boot resources and confirm your image is present. Replace <image-name> with the
name of the image you specified during import. For example, scos-10.0.
maas default boot-resources read | grep "<image-name>"
If the image was imported successfully, the command returns a JSON entry containing the image name. No output indicates the image was not found.
Option 2 - Build Your Own Image
Prerequisites
-
A Linux build host with the following tools installed:
debootstraprsynclosetup(util-linux)sgdisk(gdisk)kpartxpartprobeudevadmmkfs.ext4e2labelgzip/gunzip- root privileges (
sudo)
-
The MAAS CLI (
maas-cli) installed on your build host. -
A MAAS server endpoint and API key. Refer to the MAAS API Keys documentation for guidance on obtaining your API key.
-
The RHCOS image build scripts, available at the following URL.
Last update: May 3, 2026
http://software.spectrocloud.com/rhcos-maas-image-builder/v4.8.c-v2/rhcos-maas-image.tgzDownload and extract the archive before proceeding. The archive contains the following files and scripts used in this guide.
build-rootfs.sh
create-maas-image.sh
import-maas-image.sh
curtin/curtin-hooks
curtin/deploy-ignition-config -
The official RHCOS raw image for your target OpenShift version, downloaded from the Red Hat mirror.
Example RHCOS image URLhttps://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.20/4.20.13/rhcos-4.20.13-x86_64-metal.x86_64.raw.gzSave the file on your build host and note the path for use in the Enablement steps.
Example RHCOS image path~/images/rhcos-4.20.13-x86_64-metal.x86_64.raw.gz
Enablement
-
Log in to your MAAS build host and navigate to the directory where you extracted the RHCOS image build scripts.
-
Use the following command to build the minimal Ubuntu root filesystem. This creates the fake root filesystem used for Curtin validation.
sudo ./build-rootfs.sh ./ubuntu2404-rootfsThe script executes
debootstrapfor Ubuntu 24.04 (Noble), installscloud-init,netplan.io,python3-cffi, andpython3-ply, cleans apt caches, and outputs the root filesystem directory to./ubuntu2404-rootfs/. This directory is copied into the extra partition in the next step. -
Use the following command to create the MAAS-ready RHCOS image. This appends a new partition (p5) to the RHCOS raw image and injects the Ubuntu root filesystem directory and Curtin hooks.
- Replace
<path-to-rhcos-raw-image>with the path to your RHCOS raw image downloaded in the prerequisites step.
Templatesudo ./create-maas-image.sh \
./ubuntu2404-rootfs \
<path-to-rhcos-raw-image>Examplesudo ./create-maas-image.sh \
./ubuntu2404-rootfs \
./images/rhcos-4.20.13-x86_64-metal.x86_64.raw.gzClick to view the script operations
- Decompresses the raw image.
- Extends the disk size by 512 MB.
- Attaches a loop device with a partition scan.
- Relocates the GPT backup header.
- Creates a new partition p5 after p4.
- Formats p5 as ext4.
- Copies the Ubuntu root filesystem directory into p5.
- Copies the Curtin scripts into
/curtin. - Compresses the new raw image to
*-with-ubuntu.raw.gz.
The resulting partition layout is as follows:
Partition Contents p3 RHCOS boot p4 RHCOS root p5 Ubuntu fake root filesystem (Curtin validation + hooks) The original input image remains unchanged and the output image is saved alongside the original input image.
Example output image path./images/rhcos-4.20.13-x86_64-metal.x86_64-with-ubuntu.raw.gz - Replace
-
Set your MAAS credentials as environment variables. Replace
<https://your-maas-server/MAAS>and<maas-api-key>with your MAAS server endpoint and API key, respectively.Set MAAS credentialsexport MAAS_ENDPOINT="<https://your-maas-server/MAAS>"
export MAAS_API_KEY="<maas-api-key>"warningKeep your MAAS OAuth credentials secure. Do not add credentials to the deploy scripts. Using environment variables allows the deploy scripts to read credentials securely without exposing them in code or logs.
-
Use the following command to import the new image into MAAS.
- Replace
<maas-ready-rhcos-image-filepath>with the path to the new RHCOS image created in the previous step. - Replace
<image-name>with a descriptive name for the image as it will appear in the MAAS boot resources list. - Replace
<operating-system>with the OS name to associate with the image in MAAS. - Replace
<release-version>with the OS version to associate with the image in MAAS.
Template./import-maas-image.sh \
<maas-ready-rhcos-image-filepath> \
<image-name> \
<operating-system> \
<release-version>Example./import-maas-image.sh \
./images/rhcos-4.20.13-x86_64-metal.x86_64-with-ubuntu.raw.gz \
rhcos-4.20.13-with-ubuntu \
openshift \
4.20.13The script logs into MAAS using the
defaultprofile, uploads the image as addgzresource, and triggers a boot-resources import. The image will then appear in the MAAS boot resources list. Partition cleanup is handled automatically during deployment, no manual disk management is required. - Replace
Validate
- MAAS UI
- MAAS CLI
-
Log in to your MAAS server web interface.
-
From the left sidebar, navigate to Images.
-
Locate the image and verify it appears with the name you specified during import. The name appears under the Release Title column. For example,
rhcos-4.20.13-with-ubuntu.The image may appear in the Other category if the image metadata does not match any existing categories.
-
Confirm the image status is Synced.
Use the following command to list all boot resources and confirm your image is present. Replace <image-name> with the
name of the image you specified during import. For example, rhcos-4.20.13-with-ubuntu.
maas default boot-resources read | grep "<image-name>"
If the image was imported successfully, the command returns a JSON entry containing the image name. No output indicates the image was not found.
Next Steps
Now that the MAAS-compatible CoreOS image is imported, you can proceed to create the HyperShift host cluster that will run the OpenShift control plane components.