How to Retrieve Instance Metadata from Command Line
in Linux
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:
0