You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register
Note!! Please register for a free account to access the full content and also to participate in Q&A in the community

How to Retrieve Instance Metadata from Command Line

Applies To:

Oracle Cloud Infrastructure - Version N/A and later

Linux x86-64

Goal:

How to gather the metadata for an instance including its OCID , display name, compartment , shape, region, availability domain , creation date, state, image, and any custom metadata from within the instance level.

Solution:

Oracle Linux 7

The oci-metadata utility is used to display or update metadata for a compute instance running in the Oracle Cloud Infrastructure.

oci-metadata utility is provided by the rpm oci-utils which is installed by default on all the Oracle provided Linux images.

# rpm -qf $(which oci-metadata)
oci-utils-0.10.0-14.el7.noarch

Running the command oci-metadata without any option displays all the information.

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!