2.2. Datasource types of cloud-init
Datasources are the sources of configuration data for cloud-init in the form of user data and metadata. Metadata has the configuration drive created by certified cloud service provider (CCSP). cloud-init uses the user data and metadata for configuration of datasource, and optionally vendor data. In case if you need to verify vendor data is available or not:
# grep -i "vendor data" /var/log/cloud-init.log
For datasources, there are three types of configuration data: user data, metadata, and vendor data.
-
User data includes directives specified in the
cloud.cfgfile and thecloud.cfg.ddirectory. For example, user data can include files to run, packages to install, and shell scripts. Refer to thecloud-initDocumentation section User-Data Formats for information about the types of user data thatcloud-initallows. -
Metadata includes data associated with a specific datasource. For example, metadata can include a server name and instance ID. If you are using a specific cloud platform, the CCSP determines where your instance can find user data and metadata. After adding user data and metadata to an HTTP service. In this case, when
cloud-initruns, it consumes user data and metadata from the HTTP service. -
Vendor data is optionally provided by the organization (for example, a cloud provider) and includes information that can customize the image to better fit the environment where the image runs.
cloud-initacts upon optional vendor data and user data after it reads any metadata and initializes the system. By default, vendor data runs on the first boot. You can disable vendor data execution.
By default, cloud-init automatically identifies the existing datasource. cloud-init attempts to identify the cloud platform using the script ds-identify. The script runs on the first boot of an instance. Adding a custom datasource directive can save time when cloud-init runs. You would add the directive in the /etc/cloud/cloud.cfg file or in the /etc/cloud/cloud.cfg.d directory. After cloud-init runs, you can view a log file (run/cloud-init/ds-identify.log) that provides detailed information about the platform. For details on datasource_list, check custom datasources.
For details on configuring datasources for CCSP, see: