
DigitalOcean launches metadata server

Metadata is a service provided for DigitalOcean droplets that allows each server to receive data about it itself (the so-called metadata). As an example of such data, we can mention user data, droplet ID, data center region, and IP address data. In addition to the usual receipt of droplet metadata, Metadata allows users to transfer certain data to droplets when they are created, which CloudInit can use to facilitate the configuration of cloud servers.
Metadata is currently available for new droplets in the following regions: SGP1, SFO1, LON1, AMS2, AMS3, and NYC3. If the droplet is in one of these regions, and metadata is not available, it is recommended to turn the droplet off and on.
Full Metadata documentation is available on the DigitalOcean Developer Portal .
When creating a droplet, metadata is set in the droplet control panel, in the "Available Settings" section, in the "user data" field:

If you create droplets using the DigitalOcean API, metadata can be passed as a user_data parameter in a POST request for creating a server:
curl -X POST "https://api.digitalocean.com/v2/droplets" \
-d'{"name":"metadata.example.com","region":"nyc3","size":"512mb","private_networking":true,"image":"ubuntu-14-04-x64","user_data":
"'"$(cat ~/user-data.yaml)"'",
"ssh_keys":[ ]}' \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
Getting metadata also looks simple: just make an HTTP GET request for a special URL
http://169.254.169.254/metadata/v1/. The response will contain data:
id
hostname
user-data
vendor-data
public-keys
region
interfaces/
dns/
Information is stored hierarchically, so more detailed requests, such as
169.254.169.254/metadata/v1/user-data
or 169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address
, will allow you to get the data specified in the "user data" field, or, accordingly, the public IPv4 address of the droplet.Only registered users can participate in the survey. Please come in.
Are you interested in the ability to work with server metadata?
- 18.6% I create a server automatically 52
- 58.4% I do not create a server automatically 163
- 21.5% I need metadata servers 60
- 47.3% I do not need metadata servers 132