Image Building¶
As an Operator, you will want to build images for your image deploy process. DRP's image-deploy workflow boots a machine, streams a pre-built OS image onto the disk, and brings the machine up without running a traditional installer. This requires a pre-built image. DRP supports two paths for building these images: Packer-based image building and the DRP image-builder tooling.
Packer-Based Image Building¶
Packer is the recommended approach for building DRP-compatible OS images. Packer automates the process of booting a temporary VM, running a traditional OS installer inside it, applying configuration (packages, services, hardening), and exporting the resulting disk image.
The typical Packer workflow for DRP images:
- Packer boots a VM in a hypervisor (KVM/QEMU, VMware, AWS, etc.) using a vendor ISO
- Packer uses a kickstart/preseed/cloud-init file to automate the OS install
- Post-install provisioners (shell scripts, Ansible) configure the OS to DRP standards:
- Install and configure the DRP runner agent
- Set up cloud-init or equivalent for first-boot customization
- Remove machine-specific state (SSH host keys, hostname, machine-id)
- Packer exports the disk as a compressed image file (typically
.img.gzor.tar.gz) - The image is uploaded to the DRP provisioner file store or an S3 bucket
# Upload a built image to DRP
drpcli files upload ubuntu-22.04-drp.img.gz as files/images/ubuntu-22.04-drp.img.gz
The image-deploy bootenv and workflow then reference this image by URL, stream it to the target machine's disk during provisioning, and perform first-boot configuration via parameters and templates. See CentOS Image Build & Deployment Guide for the image-deploy workflow configuration.
DRP Image-Builder Tooling¶
RackN provides an image-builder content pack that automates the image build pipeline within DRP
itself. Rather than requiring an external Packer setup, image-builder uses DRP workflows to:
- Provision a temporary build machine using a standard DRP OS install workflow
- Apply post-install configuration tasks to produce the desired image content
- Export the disk state as a compressed image using DRP tasks
- Upload the resulting image back to the DRP file store
- Decommission the temporary build machine
This approach integrates image building into the standard DRP operational model, using the same parameters and profiles that configure production machines to configure the image. Changes to the base configuration are made in DRP profiles, and the next image build automatically picks them up.
What a Built Image Contains¶
A DRP-compatible image is a raw disk image (or partition image) that contains:
- A fully installed and configured OS
- First-boot configuration hooks (cloud-init, systemd units, or DRP-specific scripts) that apply machine-specific settings from DRP parameters (hostname, network configuration, SSH keys)
- No machine-specific state: SSH host keys,
/etc/machine-id, and similar per-machine files are absent or reset so they regenerate on first boot
The image is consumed by the image-deploy workflow, which streams the image to the machine's disk
using dd or a similar tool during a Sledgehammer-based deployment stage.