Providing User Data to an Instance

A user data file is a special key in the metadata service that holds a file that cloud-aware applications in the guest instance can access. For example, one application that uses the user data file is the cloud-init system, which is an open-source package from Ubuntu that is available on various Linux distributions and handles early initialization of a cloud instance.

You can place user data in a local file and pass it as a parameter through the --user-data <user-data-file> option at instance creation. The following example passes the mydata.file user data file:

$ openstack server create --image ubuntu-cloudimage --flavor 1 --user-data mydata.file