Revision history [back]

click to hide/show revision 1
initial version

For the user-data script to have any affect on your instance, the image you are booting needs to have tooling installed to fetch and execute that image. For most major distributions (CentOS, Red Hat, Fedora, Ubuntu, etc), this is cloud-init, and is installed on the cloud images for these distributions.

Cirros uses an alternative mechanism, which means that you probably don't want to use it for testing because it will not support the same sort of user-data scripts that larger distributions will support (for example, python isn't available on the cirros image, so you wouldn't be able to test out a python script in any case).

Your simple test ought to work. There are a number of diagnostic steps you can perform to figure out what went awry...

First, check if the metadata service is available. After logging into the cirros instance, try running:

# curl

This should return:


If you get an error response, this suggests that there are probably configuration issues in your openstack environment.

If the above worked, trying fetching the user-data script by running:

# curl

This should return your user-data script, e.g:

echo "Hello World" > /tmp/test.txt

If that worked, see if the cirros tooling fetched it correctly. Run:

# cirros-query get user-data

This should return the same thing.

I suspect that one of the above steps will produce some useful diagnostic information. If you do see any errors, feel free to update your question with the additional information and we'll see if we can get things working.