Stop cloud-init from stalling your boot when network discovery goes sideways
Technical Briefing | 8/5/2026
You have probably seen it. A fresh node boots up, the console sits at a blank cursor for exactly two minutes, and then your SSH key finally appears. It’s that classic cloud-init timeout where the metadata service is unreachable or the DHCP lease is taking its sweet time. On immutable systems like bootc, you don’t always have a shell to hop into while it hangs, and debugging this in a production cluster environment is a nightmare.
Why local metadata beats waiting for a network handshake
Cloud-init is often configured to look for every possible data source by default. If your environment isn’t AWS or Azure, it’s still burning cycles checking for them anyway. If you are building immutable images for your own bare metal or KVM infra, stop letting cloud-init probe the entire universe. Explicitly defining your datasource is the best way to keep your boot times predictable.
echo 'datasource_list: [NoCloud, None]' > /etc/cloud/cloud.cfg.d/99-custom-datasource.cfg
- The NoCloud source checks for a local seed ISO or partition immediately without network IO
- Setting the list to None disables the recursive search that causes the 120-second hang
- Doing this inside your bootc image creation stage prevents the delay from ever appearing in prod
When systemd timers fight your boot sequence
Sometimes the hang isn’t the network itself but how cloud-init hooks into systemd. If your immutable OS image has a heavy initrd, cloud-init might be waiting for a specific interface that hasn’t finished its link negotiation. If you are using network-online.target, be aware that it only verifies that an IP exists, not that your metadata endpoint is actually responsive. Check your journal logs for cloud-init-local.service failures specifically; that’s usually where the boot-time block lives.
Don’t just set a higher timeout and call it a day. If your node needs to wait two minutes to find its identity, your provisioning orchestration is brittle. Force the configuration local and keep your boot path clean, because nobody wants to debug why a node took an eternity just to pull its hostname.
