This Makefile automates the process of building cloud images for hotstack
deployments. The tasks are executed using the make utility.
- controller: A customized CentOS 9 Stream image with packages needed for
the hotstack controller node. Built using diskimage-builder (DIB) with custom
elements from the
dib/subdirectory. - microshift: A CentOS 9 Stream image with MicroShift packages installed
from GitHub releases. Built using diskimage-builder (DIB) with the
hotstack-microshiftelement. The image is intentionally unconfigured and requires cloud-init or manual setup to enable services and configure runtime settings. - blank: A minimal blank image used for virtual baremetal node disks with Redfish virtual BMC
- nat64: A NAT64 appliance image built using ci-framework for IPv6-only environments
- switch-host (experimental): A CentOS 9 Stream image with libvirt/qemu for running virtual network switches using nested virtualization
Pre-built images are available from GitHub releases. These are automatically built by CI workflows and can be downloaded instead of building locally.
# Download latest controller image
curl -L -O https://github.com/openstack-k8s-operators/hotstack/releases/download/latest-controller/controller-latest.qcow2# Download latest blank image
curl -L -O https://github.com/openstack-k8s-operators/hotstack/releases/download/latest-blank/blank-image-latest.qcow2The NAT64 appliance image is built and released in the openstack-k8s-operators-ci repository:
# Download latest NAT64 appliance image
curl -L -O https://github.com/openstack-k8s-operators/openstack-k8s-operators-ci/releases/download/latest/nat64-appliance-latest.qcow2For specific versions, see the respective releases pages:
- HotStack releases - Controller and blank images
- openstack-k8s-operators-ci releases - NAT64 appliance image
The following sections describe how to build images locally using the included Makefiles.
CONTROLLER_IMAGE_NAME: The name of the controller image file to be created (default:controller.qcow2).CONTROLLER_IMAGE_FORMAT: The desired format for the controller image (default:raw). Set toqcow2to skip conversion and keep the original DIB output format.CONTROLLER_DIB_VENV: Path to the Python virtual environment for diskimage-builder (default:~/controller-dib-venv).CONTROLLER_DIB_WORKDIR: Working directory for DIB build artifacts and cache (default:.controller-build).BLANK_IMAGE_NAME: The name of the blank image file to be created.BLANK_IMAGE_FORMAT: The format for the blank image (default:raw). Can be set toqcow2or any format supported byqemu-img.BLANK_IMAGE_SIZE: The size of the blank image file in megabytes.NAT64_IMAGE_NAME: The name of the NAT64 appliance image file.NAT64_IMAGE_FORMAT: The desired format for the NAT64 image (default:raw). Set toqcow2to keep the original format.NAT64_CIFMW_DIR: Directory where ci-framework will be cloned (default:.ci-framework).NAT64_BASEDIR: Build directory for NAT64 appliance artifacts (default:.nat64-build).SWITCH_HOST_IMAGE_URL: The URL to download the CentOS 9 Stream image for switch host.SWITCH_HOST_IMAGE_NAME: The name of the switch host image file.SWITCH_HOST_IMAGE_FORMAT: The desired format for the switch host image (default:raw). Set toqcow2to keep the original format.SWITCH_HOST_INSTALL_PACKAGES: A list of packages to install on the switch host image (includes libvirt, qemu-kvm, networking tools).FORCE10_10_IMAGE: Path to Force10 OS10 image file (zip archive likeOS10_Virtualization_10.6.0.2.74V.zip). Will be copied to/opt/force10_10/in the image. (Experimental support only)
Note: Raw format is required for cloud backends using Ceph, as Ceph cannot directly use qcow2 images for VM disks.
all: The default target that depends oncontroller,blank, andnat64.clean: A target that removes the controller, blank, and NAT64 images, as well as build artifacts.controller: Builds the controller image using diskimage-builder (DIB). Depends oncontroller_dib_setup,controller_dib_build, andcontroller_convert.controller_dib_setup: Creates a Python virtual environment and installs diskimage-builder.controller_dib_build: Builds the controller image using DIB with the configuration fromdib/controller-image.yamland the customhotstack-controllerelement fromdib/elements/.controller_convert: Converts the image to the format specified byCONTROLLER_IMAGE_FORMAT(in-place conversion ifraw).controller_clean: Removes the controller image, virtual environment, and build artifacts.
microshift: Builds the MicroShift image using diskimage-builder (DIB). Depends onmicroshift_dib_setup,microshift_dib_build, andmicroshift_convert.microshift_dib_setup: Creates a Python virtual environment and installs diskimage-builder.microshift_dib_build: Builds the MicroShift image using DIB with the configuration fromdib/microshift-image.yamland the customhotstack-microshiftelement fromdib/elements/.microshift_convert: Converts the image to the format specified byMICROSHIFT_IMAGE_FORMAT(in-place conversion ifraw).microshift_clean: Removes the MicroShift image, virtual environment, and build artifacts.
blank: A target that creates a blank image file of the specified size in the format specified byBLANK_IMAGE_FORMAT.blank_clean: A target that removes the blank image file.nat64: A target that depends onnat64_setup,nat64_build, andnat64_convert.nat64_setup: A target that clones ci-framework and sets up the molecule environment with required dependencies.nat64_build: A target that builds the NAT64 appliance image using thebuild-nat64-appliance-image.yamlplaybook and the ci-framework nat64_appliance role.nat64_convert: A target that converts the image to the format specified byNAT64_IMAGE_FORMAT(in-place conversion ifraw).nat64_clean: A target that removes the NAT64 image and build artifacts.
switch-host(experimental): A standalone target that depends onswitch-host_download,switch-host_customize, andswitch-host_convert. Not included inallorcleantargets.switch-host_download: A target that downloads the base image from the specified URL.switch-host_customize: A target that customizes the downloaded image by installing packages (libvirt, qemu, networking tools), copying helper scripts to/usr/local/bin/, installing the systemd service, and creating necessary directories.switch-host_convert: A target that converts the image to the format specified bySWITCH_HOST_IMAGE_FORMAT(in-place conversion ifraw).switch-host_clean: A target that removes the switch-host image file.
MICROSHIFT_IMAGE_NAME: The name of the MicroShift image file to be created (default:microshift.qcow2).MICROSHIFT_IMAGE_FORMAT: The desired format for the MicroShift image (default:raw). Set toqcow2to skip conversion and keep the original DIB output format.MICROSHIFT_DIB_VENV: Path to the Python virtual environment for diskimage-builder (default:~/microshift-dib-venv).MICROSHIFT_DIB_WORKDIR: Working directory for DIB build artifacts and cache (default:.microshift-build).MICROSHIFT_VERSION: MicroShift major.minor version for dependency resolution (default:4.20). This determines which OpenShift mirror repository to enable and which GitHub release to auto-discover.DIB_MICROSHIFT_RPM_ARCHIVE: Optional. Direct URL to the MicroShift RPM archive (tgz file) from a GitHub release. When not set, the latest release matchingMICROSHIFT_VERSIONis auto-discovered from themicroshift-io/microshiftGitHub releases. Example:https://github.com/microshift-io/microshift/releases/download/4.20.0_g153ff0ca9_4.20.0_okd_scos.16/microshift-rpms-x86_64.tgz
make clean-
Build the controller image (using diskimage-builder):
make controller
This will create a Python virtual environment, install diskimage-builder, build the image using the configuration from
dib/controller-image.yaml, and convert it to raw format (default). -
Upload the controller image to Glance:
openstack image create hotstack-controller \ --disk-format raw \ --file controller.qcow2
Note: To build as qcow2 without conversion:
make controller CONTROLLER_IMAGE_FORMAT=qcow2 openstack image create hotstack-controller \ --disk-format qcow2 \ --file controller.qcow2
-
Build the MicroShift image (using diskimage-builder):
The latest RPM archive for the configured version is auto-discovered from GitHub releases:
make microshift \ MICROSHIFT_VERSION=4.20 \ MICROSHIFT_IMAGE_FORMAT=raw # Optional, defaults to rawTo pin a specific release, set
DIB_MICROSHIFT_RPM_ARCHIVEexplicitly:make microshift \ DIB_MICROSHIFT_RPM_ARCHIVE=https://github.com/microshift-io/microshift/releases/download/4.20.0_g153ff0ca9_4.20.0_okd_scos.16/microshift-rpms-x86_64.tgz \ MICROSHIFT_VERSION=4.20
This will create a Python virtual environment, install diskimage-builder, build the image using the configuration from
dib/microshift-image.yaml, and convert it to raw format (default). -
Upload the MicroShift image to Glance:
openstack image create hotstack-microshift \ --disk-format raw \ --file microshift.qcow2 \ --property hw_firmware_type=uefi \ --property hw_machine_type=q35
-
See
dib/elements/hotstack-microshift/README.rstfor detailed runtime configuration instructions, including firewall setup, LVM configuration for TopoLVM, kubeconfig setup, and service enablement.
-
Create the blank image:
make blank
-
Upload the blank image to Glance:
openstack image create sushy-tools-blank-image \ --disk-format raw \ --file blank-image.qcow2 \ --property hw_firmware_type=uefi \ --property hw_machine_type=q35 \ --property os_shutdown_timeout=5
-
Build the NAT64 appliance image:
make nat64
This will:
- Clone the ci-framework repository (if not already present)
- Setup the molecule environment with required dependencies
- Run the
build-nat64-appliance-image.yamlplaybook using the nat64_appliance role - Copy the resulting image to
nat64-appliance.qcow2
-
Upload the NAT64 appliance image to Glance:
openstack image create nat64-appliance \ --disk-format raw \ --file nat64-appliance.qcow2 \ --property hw_firmware_type=uefi \ --property hw_machine_type=q35
Note: The NAT64 image build process requires the ci-framework and its dependencies. The build artifacts are stored in
.nat64-build, the ci-framework clone is stored in.ci-framework, and a Python virtual environment is created at~/test-python. All of these can be cleaned up withmake nat64_clean.
-
Build the switch-host image:
make switch-host
Or with vendor switch images pre-installed:
make switch-host \ FORCE10_10_IMAGE=/path/to/OS10_Virtualization_10.6.0.2.74V.zip
This will:
- Download CentOS 9 Stream image
- Install libvirt, qemu-kvm, and networking tools
- Copy helper scripts to
/usr/local/bin/ - Install systemd service for managing nested switch VMs
- Create directories for each switch model under
/opt/ - Copy any provided vendor switch images to their respective directories
-
Upload the switch-host image to Glance:
openstack image create hotstack-switch-host \ --disk-format raw \ --file switch-host.qcow2 \ --property hw_firmware_type=uefi \ --property hw_machine_type=q35
See
switch-host-scripts/README.mdfor details on switch image requirements and configuration.