Metadata is a service offered on every Packet server that allows it to access and share various data about itself. This kind of data includes hostname, instance ID, ssh keys, tags, assigned IPs, etc.

This information is especially useful for automation, but of course can be accessed manually.

Retrieving Metadata from Your Server

You can view the metadata by doing a cURL to

The output will be a long json formatted text, so you might want to use so jq to make it easier to read and digest.

root@metadata:~# curl -s | jq
  "id": "2885032e-61a8-4786-bd26-7b2e2e6ba1ea",
  "hostname": "metadata",
  "iqn": "",
  "operating_system": {
  "slug": "ubuntu_16_04",
  "distro": "ubuntu",
  "version": "16.04",
  "license_activation": {
  "state": "unlicensed"
  "plan": "baremetal_1",
  "facility": "ewr1",
  "tags": [],
  "ssh_keys": [
  "ssh-rsa AAAAB3Nza............."
  "storage": {
  "disks": [
  "raid": [
  "filesystems": [
 "network": {
 "bonding": {
 "mode": 4
 "interfaces": [
  "name": "p1p1",
  "mac": "0c:c4:7a:e1:3d:d0",
  "bond": "bond0"
  "name": "p1p2",
  "mac": "0c:c4:7a:e1:3d:d1",
  "bond": "bond0"
"addresses": [
  "id": "63f24352-0997-4f65-babd-6f8c9d048568",
  "address_family": 4,
  "netmask": "",
  "created_at": "2017-11-04T17:03:20Z",
  "public": true,
  "cidr": 31,
  "management": true,
  "enabled": true,
  "network": "",
  "address": "",
  "gateway": "",
  "parent_block": {
  "network": "",
  "netmask": "",
  "cidr": 31,
  "href": "/ips/6c2d45a7-df8b-451e-9d6d-2a1b5476a9d0"
 "spot": {},
 "volumes": [],
 "api_url": "",
 "phone_home_url": ""

Additionally, if you want to grab specific information from the metadata, you can use jq to filter on specific fields, or choose to any of the following options:

root@metadata:~# curl -s
root@metadata:~# curl

Note! 2009-04-04 is a specific metadata version which we are currently using.

Metadata and Spot Instances

As you might have seen on our Spot Market KB article, you will be able to get some information regarding the device’s termination time.

For a spot instance, there will be an additional field in the metadata: "spot": {}

In case the server is up for termination, meaning your spot price falls below the current bids, then you will see termination_date appearing into that spot field. Keep in mind that the current termination time is 120 seconds.

Looking for More Help?

You can always reach out to us via email, live chat or return to our home page.

Did this answer your question?