Configuration priority

Configuration settings are prioritized by their source. Settings from a higher priority source override settings from lower priority sources. In decreasing priority:

  1. Runtime configuration

  2. Image configuration

  3. Builtin defaults

Runtime configuration

Runtime configuration is fetched from the datasource and is defined at instance launch. Runtime settings use the user-data format..

User-provided configurations override settings provided by the platform (called vendor-data).

Every platform supporting cloud-init should provide a method for supplying user-data. See your cloud provider’s documentation for details. The datasource page for your cloud might have clues for how to define user-data.

Once an instance has been initialized, the user-data may not be edited. It is sourced directly from the cloud, so even if you find a local file that contains user-data, it will likely be overwritten in the next boot.

Image configuration

Image configurations are built into an image before it boots. Image configurations can define user-data settings, as well as other base configuration settings.

From highest priority to lowest, image configuration sources are:

  • Runtime config: Machine-generated /run/cloud-init/cloud.cfg. Do not write to this file.

  • Configuration directory: Anything defined in /etc/cloud/cloud.cfg and /etc/cloud/cloud.cfg.d/*.cfg.

  • Hardcoded config Config that lives within the source of cloud-init and cannot be changed.

Builtin defaults

Some settings are part of the source code and may be overridden.

Network configuration

Cloud-init brings up the network without any configuration required. See network configuration documentation for more information.