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

Initial instance boot is delayed for minutes, postponing service readiness.

Environment & Reproduction

Typical on cloned images where cloud-init waits for unavailable datasource metadata.

systemd-analyze blame | head -n 20

Root Cause Analysis

cloud-init datasource detection retries and timeout behavior delay boot targets.

Quick Triage

Review cloud-init status and stage timings.

cloud-init status --long
cloud-init analyze show

Step-by-Step Diagnosis

Inspect cloud-init logs and datasource detection paths.

sudo tail -n 150 /var/log/cloud-init.log
sudo tail -n 150 /var/log/cloud-init-output.log
Illustrative mockup for ubuntu-24-04-lts β€” cloud_init_diag
cloud-init stage timing and datasource wait issues β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Set correct datasource configuration and clean cloud-init state for the image.

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

sudo cloud-init clean --logs
sudo systemctl restart cloud-init-local cloud-init
cloud-init status --wait
Illustrative mockup for ubuntu-24-04-lts β€” cloud_init_fix
Datasource tuning and cloud-init cleanup β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Disable unused datasource probes in controlled VM environments.

sudo sed -n '1,120p' /etc/cloud/cloud.cfg.d/90_dpkg.cfg

Verification & Acceptance Criteria

Boot time decreases and cloud-init reaches done state without long waits.

cloud-init status
systemd-analyze

Rollback Plan

Restore previous cloud-init configuration if provisioning behavior regresses.

sudo cp /etc/cloud/cloud.cfg.d/90_dpkg.cfg.bak /etc/cloud/cloud.cfg.d/90_dpkg.cfg

Prevention & Hardening

Bake validated datasource settings into golden images and test first-boot timing.

Related to network bring-up delays and metadata endpoint routing failures.

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 performance tuning references.

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.