第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-initconfiguration files:-
Examine the
/etc/cloud/cloud.cfgconfiguration file. Check which modules are included undercloud_init_modules,cloud_config_modules, andcloud_final_modules. -
Check directives (
*.cfgfiles) in the/etc/cloud/cloud.cfg.ddirectory.
-
Examine the
If the root partition was not automatically extended, check log messages for the
growpartutility.注記growpartdoes 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.logand/var/log/cloud-init-output.logfiles 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
Rerun cloud-init commands as root.
Rerun
cloud-initwith only the init modules:# /usr/bin/cloud-init -d initRerun
cloud-initwith all modules in the configuration:# /usr/bin/cloud-init -d modulesDelete the
cloud-initcache and forcecloud-initto run after boot:# rm -rf /var/lib/cloud/ && /usr/bin/cloud-init -d initClean directories and simulate a clean instance:
# rm -rf /var/lib/cloud/instances/ # rm -rf /var/lib/cloud/instance # rm -rf /var/lib/cloud/data/ # rebootRerun the
cloud-initutility:# cloud-init init --local # cloud-init init