Eucalyptus is a cloud computing platform that is intended to be API compatible with Amazon’s EC2, but can be installed on your own machines. In the latest stable version available at the time of writing, version 1.4, there is a catch in fetching meta-data and user-data. According to Amazon’s API description, you can get the meta-data by doing an HTTP GET on the URL:

However, this doesn’t work in Eucalyptus 1.4. The correct host to fetch this data from is the gateway for the running instance and the port is 8773. This little script will print the correct host and port:

echo http://$(route -n | awk '$4 ~ ".*G.*" {print $2}'):8773/


You can fetch a list of meta-data keys by getting /latest/meta-data. Fetching the value for a key is as easy as getting /latest/meta-data/key. The following table shows an example of the keys and associated values:

reservation-id r-412F078F
security-groups [default]
product-codes not yet supported.
ami-launch-index 0
ramdisk-id emi-F4CB118E
kernel-id eki-90591388
ami-id emi-7C83135D
placement/ availability-zone
public-keys/ 0=admin_key
ancestor-ami-ids none
block-device-mapping not yet supported.
instance-type m1.small
instance-id i-2ECA052C


You can supply user-data as an option to ec2-run-instances:

ec2-run-instances <emi> -k <key> -d <user-data>

This data is fetched by getting /latest/user-data.

Fetching meta-data and user-data in Eucalyptus
Tagged on:

Leave a Reply

Your email address will not be published. Required fields are marked *