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:

    1. Examine the /etc/cloud/cloud.cfg configuration file. Check which modules are included under cloud_init_modules, cloud_config_modules, and cloud_final_modules.
    2. Check directives (*.cfg files) in the /etc/cloud/cloud.cfg.d directory.
  • If the root partition was not automatically extended, check log messages for the growpart utility.

    Note

    growpart 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.
  • If the file system was not extended, check log messages for resizefs

    # grep resizefs /var/log/cloud-init.log
    Copy to Clipboard
Important

Rerun cloud-init commands as root.

  • Rerun cloud-init with only the init modules:

    # /usr/bin/cloud-init -d init
    Copy to Clipboard
  • Rerun cloud-init with all modules in the configuration:

    # /usr/bin/cloud-init -d modules
    Copy to Clipboard
  • Delete the cloud-init cache and force cloud-init to run after boot:

    # rm -rf /var/lib/cloud/ && /usr/bin/cloud-init -d init
    Copy to Clipboard
  • 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
    Copy to Clipboard
  • Rerun the cloud-init utility:

    # cloud-init init --local
    # cloud-init init
    Copy to Clipboard
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat