Thinking Out Loud

August 19, 2021

OCI- How to retrieve instance metadata from command line

Filed under: OCI — mdinh @ 9:17 pm

When oci-metadata is not available or installed, use curl.

Some information have been removed to protect the innocent.

$ curl -L http://169.254.169.254/opc/v1/instance/
{
  "availabilityDomain" : "SVYj:US-ASHBURN-AD-2",
  "faultDomain" : "FAULT-DOMAIN-1",
  "compartmentId" :
  "displayName" :
  "hostname" : 
  "id" :
  "metadata" : {
    "ssh_authorized_keys" : 
    "nodeNumber" : "0",
    "user_data" :
    "sshkey-resourceID" : 
    "agentAuth" : "true",
    "dbSystemShape" : "Exadata.Quarter3.100"
  },
  "region" : "iad",
  "canonicalRegionName" : "us-ashburn-1",
  "ociAdName" : "iad-ad-2",
  "regionInfo" : {
    "realmKey" : "oc1",
    "realmDomainComponent" : "oraclecloud.com",
    "regionKey" : "IAD",
    "regionIdentifier" : "us-ashburn-1"
  },
  "shape" : "ExadataCavium",
  "state" : "Running",
  "timeCreated" : 1613174787736
}

Reference: OCI- How to retrieve instance metadata from command line (Doc ID 2570001.1)

How To Determine Host Is On OCI

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a free website or blog at WordPress.com.

%d bloggers like this: