Affected versions: Ubuntu 24.04 LTS

πŸ“– ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Instance boot is delayed or blocked while cloud-init waits indefinitely.

Environment & Reproduction

Common on VMs with metadata service reachability issues.

cloud-init status --long
systemctl status cloud-init --no-pager

Root Cause Analysis

Datasource detection or network bootstrap fails, causing module timeouts.

Quick Triage

Inspect cloud-init logs and datasource detection results.

sudo tail -n 120 /var/log/cloud-init.log
sudo tail -n 120 /var/log/cloud-init-output.log

Step-by-Step Diagnosis

Check networking, datasource config, and cloud-init stage completion.

cloud-id
cloud-init analyze show
ip r
Illustrative mockup for ubuntu-24-04-lts β€” terminal_or_shell
Diagnostic output for cloud/cloud-init-hang β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Set correct datasource list and clean/re-run cloud-init when metadata is reachable.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

sudoedit /etc/cloud/cloud.cfg.d/99-datasource.cfg
sudo cloud-init clean
sudo reboot
Illustrative mockup for ubuntu-24-04-lts β€” log_or_console
Resolution output for cloud/cloud-init-hang β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Disable cloud-init networking module when external network bootstrap is managed elsewhere.

echo 'network: {config: disabled}' | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network.cfg

Verification & Acceptance Criteria

cloud-init reaches done state and services start within expected boot window.

cloud-init status --wait
systemd-analyze blame | head

Rollback Plan

Remove custom datasource overrides and restore original cloud-init config.

sudo rm -f /etc/cloud/cloud.cfg.d/99-datasource.cfg
sudo cloud-init clean

Prevention & Hardening

Use tested cloud images and validate metadata service routing before deployment.

cloud-init schema --system

Related messages include cloud-init timeout and failed to fetch datasource metadata.

Related tutorial: View the step-by-step tutorial for Ubuntu 24.04 LTS.

View all Ubuntu 24.04 LTS tutorials on the Tutorials Hub β†’

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

cloud-init official docs and Ubuntu cloud image guides.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β€” we respond within one business day.