Chapter 14. Troubleshooting cloud-init
After running the cloud-init
utility, you can troubleshoot the instance by examining the configuration and log files. After identifying the issue, rerun cloud-init
on your instance. You can run cloud-init
from the command line. For details, run the cloud-init --help
command.
For general configuration issues, review the
cloud-init
configuration files:-
Examine the
/etc/cloud/cloud.cfg
configuration file. Check which modules are included undercloud_init_modules
,cloud_config_modules
, andcloud_final_modules
. -
Check directives (
*.cfg
files) in the/etc/cloud/cloud.cfg.d
directory.
-
Examine the
If the root partition was not automatically extended, check log messages for the
growpart
utility.Notegrowpart
does not support LVM. If your root partition is based in LVM, the root partition is not automatically extended upon first boot.-
Review the
/var/log/cloud-init.log
and/var/log/cloud-init-output.log
files for details on any specific issue.
-
Review the
If the file system was not extended, check log messages for
resizefs
grep resizefs /var/log/cloud-init.log
# grep resizefs /var/log/cloud-init.log
Copy to Clipboard Copied!
Rerun cloud-init
commands as root.
Rerun
cloud-init
with only the init modules:/usr/bin/cloud-init -d init
# /usr/bin/cloud-init -d init
Copy to Clipboard Copied! Rerun
cloud-init
with all modules in the configuration:/usr/bin/cloud-init -d modules
# /usr/bin/cloud-init -d modules
Copy to Clipboard Copied! Delete the
cloud-init
cache and forcecloud-init
to run after boot:rm -rf /var/lib/cloud/ && /usr/bin/cloud-init -d init
# rm -rf /var/lib/cloud/ && /usr/bin/cloud-init -d init
Copy to Clipboard Copied! Clean directories and simulate a clean instance:
rm -rf /var/lib/cloud/instances/ rm -rf /var/lib/cloud/instance rm -rf /var/lib/cloud/data/ reboot
# rm -rf /var/lib/cloud/instances/ # rm -rf /var/lib/cloud/instance # rm -rf /var/lib/cloud/data/ # reboot
Copy to Clipboard Copied! Rerun the
cloud-init
utility:cloud-init init --local cloud-init init
# cloud-init init --local # cloud-init init
Copy to Clipboard Copied!