Product SiteDocumentation Site

20.3. User Data and Meta Data

CloudStack provides API access to attach user data to a deployed VM. Deployed VMs also have access to instance metadata via the virtual router.
User data can be accessed once the IP address of the virtual router is known. Once the IP address is known, use the following steps to access the user data:
  1. Run the following command to find the virtual router.
    # cat /var/lib/dhclient/dhclient-eth0.leases | grep dhcp-server-identifier | tail -1
  2. Access user data by running the following command using the result of the above command
    # curl http://10.1.1.1/latest/user-data
Meta Data can be accessed similarly, using a URL of the form http://10.1.1.1/latest/meta-data/{metadata type}. (For backwards compatibility, the previous URL http://10.1.1.1/latest/{metadata type} is also supported.) For metadata type, use one of the following: