How do I check whether cloud-init completed on my VPS?
cloud-init status reports the provisioning state on images that use cloud-init. Read the detailed state and errors before starting dependent deployment steps. A normal SSH login can become available before all first-boot modules have finished.
Before you start
- The selected Linux image uses cloud-init.
Instructions
1. Read the current state
This is a read-only status query.
cloud-init status --longLook at status, extended status when available, errors and recoverable errors. Output and exit-code detail vary with the installed release.
2. Inspect the relevant boot-stage logs
Use a bounded journal query on a systemd-based guest.
sudo journalctl -b -u cloud-init-local.service -u cloud-init.service -u cloud-config.service -u cloud-final.service --no-pager -n 80The logs can identify the failing stage. Review privately and redact user data, credentials and internal addresses before sharing any excerpt.
3. Correct the actual failed dependency
A failed package source, invalid user-data setting or unavailable datasource needs its own targeted fix. Do not run cloud-init clean or force all modules to rerun on a working production guest merely to clear a status message; first-boot actions can change access or data.
Check the result
- The expected provisioning stages have finished and reported errors are understood.
- The intended users, keys, packages and application prerequisites are actually present.
Troubleshooting
- Status remains running
- Review the active stage and its logs; a long package operation differs from a stalled datasource.
- Status reports recoverable errors
- Inspect the exact module and effect. A completed state can still contain a failed optional action.
Official references
Use the documentation for your installed version when a flag, service name or platform feature differs.
