Skip to content

ephemeral: Add Ignition config injection support#232

Merged
cgwalters merged 1 commit intomainfrom
add-ignition-support
Mar 30, 2026
Merged

ephemeral: Add Ignition config injection support#232
cgwalters merged 1 commit intomainfrom
add-ignition-support

Conversation

@gursewak1997
Copy link
Copy Markdown
Collaborator

@gursewak1997 gursewak1997 commented Mar 20, 2026

Add support for injecting Ignition configuration files into ephemeral
VMs via QEMU's fw_cfg mechanism (x86_64/aarch64) and virtio-blk
(s390x/ppc64le). This enables first-boot provisioning for bootc-based
systems that use Ignition.

Implementation:

  • Architecture-specific config delivery per FCOS docs:
    • x86_64/aarch64: fw_cfg at opt/com.coreos/config
    • s390x/ppc64le: virtio-blk with serial 'ignition', readonly
  • Runtime architecture detection for correct method
  • Image validation via labels (coreos.ignition or com.coreos.osname)
  • Added readonly support for virtio-blk devices
  • Added ignition.platform.id=qemu kernel argument when config specified
  • Path validation with existence, type, and readability checks
  • Brief error messages with man page reference

Testing:

  • 5 comprehensive integration tests:
    • fw_cfg accessibility verification
    • Invalid path rejection
    • Directory rejection
    • Unsupported image detection
    • Kernel argument presence validation
  • All tests pass with FCOS image verification

Documentation:

  • Comprehensive man page section with working Ignition v3.3.0 example
  • SSH key injection and file creation demo
  • Architecture-specific delivery notes
  • Links to upstream Ignition and bootc documentation
  • Important notes about ephemeral boot behavior

The config is successfully passed to the guest (verified via
/sys/firmware/qemu_fw_cfg/ and /proc/cmdline). Ignition will process
it on first boot. For ephemeral testing with pre-built FCOS images,
Ignition skips as expected (subsequent boot behavior).

Useful for custom bootc images with Ignition (see bootc initramfs
docs) and future to-disk workflows.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for injecting Ignition configuration files into ephemeral VMs. The implementation correctly handles different injection methods for various architectures (fw_cfg for x86_64/aarch64 and virtio-blk for s390x/ppc64le). The changes include updates to QEMU configuration, command-line options, and logic to detect Ignition support in images.

My review includes a couple of suggestions to improve code clarity, reduce duplication, and enhance performance. Specifically, I've recommended refactoring the virtio-blk device addition methods for better maintainability and optimizing the Ignition support check to be more efficient.

@gursewak1997 gursewak1997 force-pushed the add-ignition-support branch 2 times, most recently from e74f5fd to 7be5f96 Compare March 20, 2026 23:05
Copy link
Copy Markdown
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

I think we really want an integration test for this. Did you test it with the fcos image? I have a suspicion that it may require an ignition.platform.id=qemu karg to be injected too.

And per discussion...some basic docs would be good, I think an example in the man page for ephemeral run is probably enough with a small concrete example?

Also, while starting with ephemeral is fine...we probably want libvirt support too.

(And yeah right now it definitely stinks to have direct qemu for ephemeral vs libvirt)

));
}

cmd.args([
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What might be less cumbersome here is to pass it as an environment variable? Then we don't need to juggle paths across the mount, we just read it in here, and the code inside can just check for the env var.

@gursewak1997 gursewak1997 force-pushed the add-ignition-support branch 2 times, most recently from 86e645a to 1b5eebe Compare March 24, 2026 22:40
Copy link
Copy Markdown
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! I just have mostly nits


// Check for coreos.ignition label (future convention)
if let Some(ignition_value) = labels.get("coreos.ignition") {
if ignition_value == "1" {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm actually...what would make a lot of sense is for the image to include the version of ignition in that label. So let's change this to just accept any value for that?

cc @spresti any opinions?

@gursewak1997 gursewak1997 force-pushed the add-ignition-support branch 2 times, most recently from 6fa38b5 to 6d48b55 Compare March 27, 2026 20:01
Add support for injecting Ignition configuration files into ephemeral
VMs via QEMU's fw_cfg mechanism (x86_64/aarch64) and virtio-blk
(s390x/ppc64le). This enables first-boot provisioning for bootc-based
systems that use Ignition.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: gursewak1997 <gursmangat@gmail.com>
@gursewak1997 gursewak1997 force-pushed the add-ignition-support branch from 6d48b55 to 1ac8a32 Compare March 27, 2026 20:01
@cgwalters cgwalters merged commit 5404561 into main Mar 30, 2026
19 checks passed
@gursewak1997 gursewak1997 deleted the add-ignition-support branch March 30, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants