Skip to content

image: add IMDS support in initrd - #320

Merged
martinpitt merged 3 commits into
mainfrom
initrd-imds
Oct 16, 2026
Merged

martinpitt merged 3 commits into
mainfrom
initrd-imds

Conversation

@martinpitt

Copy link
Copy Markdown
Member

This makes built images work in cloud environments for passing credentials/configuration via IMDS, and keeps initrds consistent between all output formats.

systemd's IMDS generator enables the imds and networkd units only on a hwdb-matched cloud, so there is no runtime impact in other environments. It still grows the disk footprint by a bit, measurements for the uncompressed boot-demo initrd:

Fedora: 93.5 MB → 101.4 MB (+8.5%)
Debian: 103.2 MB → 111.7 MB (+8.2%)
Arch: unchanged, its systemd already ships both

@martinpitt martinpitt mentioned this pull request Oct 16, 2026
2 tasks done
This makes built images work in cloud environments for passing
credentials/configuration via IMDS, and keeps initrds consistent between
all output formats.

systemd's IMDS generator enables the imds and networkd units only on a
hwdb-matched cloud, so there is no runtime impact in other environments.
It still grows the disk footprint by a bit, measurements for the
uncompressed boot-demo initrd:

  Fedora: 93.5 MB → 101.4 MB (+8.5%)
  Debian: 103.2 MB → 111.7 MB (+8.2%)
  Arch:   unchanged, its systemd already ships both

Signed-off-by: Martin Pitt <martin@amutable.com>

@daandemeyer daandemeyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is OK, networking is basic enough that we should just add it to the initrd by default.

@martinpitt

Copy link
Copy Markdown
Member Author

@daandemeyer one more commit coming, I'm just running CI in between to get the arm64 checksums

Necessary for IMDS/networkd to reach the service on AWS. It adds 90 KB
to the boot-demo UKI.

Clouds with `virtio_net` are covered already (Hetzner, Oracle VMs,
Scaleway, Tencent, Alibaba and Vultr). Azure and GCP's gVNIC types need
other drivers. We'll add them later when tine can build images for them.

Signed-off-by: Martin Pitt <martin@amutable.com>
@martinpitt
martinpitt marked this pull request as ready for review October 16, 2026 12:00
@martinpitt

Copy link
Copy Markdown
Member Author

@daandemeyer third commit (udev rule) is in now. Still needs one more round of arm64 checksums, but that's trivial.

@martinpitt martinpitt added the update-reproducibility accept new image digests label Oct 16, 2026
EBS volumes are NVMe devices whose I/O can stall for longer than the
kernel's 30 s timeout, which then fails the root file system. AWS
recommends `nvme_core.io_timeout` on the kernel command line, but that
also changes the timeout of every NVMe disk on real hardware. So ship
the udev rule of `amazon-ec2-utils` instead, which matches only EBS
volumes.

Signed-off-by: Martin Pitt <martin@amutable.com>
@github-actions github-actions Bot removed the update-reproducibility accept new image digests label Oct 16, 2026
@martinpitt
martinpitt merged commit 43de0ae into main Oct 16, 2026
2 checks passed
@martinpitt
martinpitt deleted the initrd-imds branch October 16, 2026 13:31
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