Log and configuration files¶
Cloud-init uses the filesystem to read inputs and write outputs. These files are configuration and log files, respectively. If other methods of debugging cloud-init fail, then digging into log files is your next step in debugging.
Cloud-init log files¶
Cloud-init’s early boot logic runs before system loggers are available or filesystems are mounted. Runtime logs and early boot logs have different locations.
Runtime logs¶
While booting, cloud-init
logs to two different files:
/var/log/cloud-init-output.log
: Captures the output from each stage ofcloud-init
when it runs./var/log/cloud-init.log
: Very detailed log with debugging output, describing each action taken.
Be aware that each time a system boots, new logs are appended to the files in
/var/log
. Therefore, the files may contain information from more
than one boot.
When reviewing these logs, look for errors or Python tracebacks.
Early boot logs¶
Prior to initialization, cloud-init
runs early detection and
enablement / disablement logic.
/run/cloud-init/cloud-init-generator.log
: On systemd systems, this log file describes early boot enablement of cloud-init via the systemd generator. These logs are most useful if trying to figure out why cloud-init did not run./run/cloud-init/ds-identify.log
: Contains logs about platform / datasource detection. These logs are most useful if cloud-init did not identify the correct datasource (cloud) to run on.
Configuration files¶
Cloud-init
configuration files are provided in two places:
/etc/cloud/cloud.cfg
/etc/cloud/cloud.cfg.d/*.cfg
These files can define the modules that run during instance initialisation, the datasources to evaluate on boot, as well as other settings.
See the configuration sources explanation and configuration reference pages for more details.