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

Boot process is slow because cloud-init waits for unavailable metadata sources.

Environment & Reproduction

Common on cloned VMs moved across environments.

systemd-analyze blame | head
cloud-init status --long
systemctl status cloud-init

Root Cause Analysis

Datasource probing timeout occurs when expected metadata endpoints are absent.

Quick Triage

Inspect cloud-init logs for datasource retries.

sudo tail -n 150 /var/log/cloud-init.log
sudo tail -n 150 /var/log/cloud-init-output.log
cloud-id

Step-by-Step Diagnosis

Review current datasource configuration and timings.

grep -RIn 'datasource' /etc/cloud/cloud.cfg /etc/cloud/cloud.cfg.d
cloud-init analyze show 2>/dev/null || true
cloud-init query ds 2>/dev/null || true
Illustrative mockup for ubuntu-24-04-lts β€” terminal_or_shell
Analyzing cloud-init stages β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Define valid datasource list for your platform and clean stale state.

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

sudo tee /etc/cloud/cloud.cfg.d/99_datasource.cfg >/dev/null <<'EOF'
datasource_list: [ NoCloud, None ]
EOF
sudo cloud-init clean --logs
sudo reboot
Illustrative mockup for ubuntu-24-04-lts β€” log_or_config
Restricting datasource list for faster boot β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Disable cloud-init networking if managed externally.

sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg >/dev/null <<'EOF'
network: {config: disabled}
EOF

Verification & Acceptance Criteria

Boot no longer stalls on datasource probing.

systemd-analyze blame | head
cloud-init status --long
cloud-init analyze show 2>/dev/null || true

Rollback Plan

Remove override files and rebuild cloud-init state if needed.

sudo rm -f /etc/cloud/cloud.cfg.d/99_datasource.cfg /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
sudo cloud-init clean --logs

Prevention & Hardening

Standardize datasource config in image pipelines by platform.

ls -1 /etc/cloud/cloud.cfg.d
cloud-init --version

Often overlaps with netplan race conditions on first boot.

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

Ubuntu cloud-init datasource and boot optimization docs.

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.