Instance metadata refers to the instance attributes such as instance ID, virtual private cloud (VPC), and network interface controller (NIC). You can obtain the metadata of an ENS instance by using the metadata service. The metadata service allows you to access information inside ENS instances without the need to log on to the ENS console or call API operations. The metadata service also allows you to configure or manage ENS instances in the Running state or applications that are hosted on ENS instances in a more convenient and secure manner.
Limits
The edge node where the ENS instance resides must support the metadata service.
To access the metadata of an ENS instance, you must access the metadata server from the instance and make sure that the instance is in the Running state.
If you frequently access the metadata server from a single ENS instance, your access requests may be throttled.
Access methods
Instance metadata items
Metadata | Description | Example |
hostname | The hostname of the instance. | i-53eqacdvilu2s4******w7joy |
instance/instance-type | The instance type. | ens.sn1.large |
instance/instance-name | The name of the instance. | i-53eqacdvilu2s4******w7joy |
instance/instance-id | The ID of instance. | i-53eqacdvilu2s4******w7joy |
image-id | The ID of the image that is used to create the instance. | aliyun_3_x64_20G_alibase_20210425 |
region-id | The edge node where the ENS instance resides. | cn-wuhan-telecom |
network/interfaces/macs/ | The MAC address. | 00:16:3e:56:e0:45 |
network/interfaces/macs/[mac]/eni-id | The identifier of the NIC. Replace [mac] with the MAC address of the instance. | eni-531bsvp06****avjfiznhaxml |
network/interfaces/macs/[mac]/isp | The Internet service provider (ISP) of the public NIC. | cmcc |
network/interfaces/macs/[mac]/netmask | The subnet mask of the NIC. | 255.255.XX.XX |
network/interfaces/macs/[mac]/primary-ip-address | The primary private IP address of the NIC. | 192.168.XX.XX |
network/interfaces/macs/[mac]/private-ipv4s | The private IPv4 addresses that are assigned to the NIC. | 192.168.XX.XX |
network/interfaces/macs/[mac]/gateway | The IPv4 gateway address of the NIC. | 192.168.XX.XX |
network/interfaces/macs/[mac]/max-netbw | The maximum outbound bandwidth of the instance. | 2000 |
network/interfaces/macs/[mac]/ipv6s | The IPv6 addresses assigned to the NIC. | 2408:XXXX:325:a204:1875:217f:184a:e4e |
network/interfaces/macs/[mac]/ipv6-gateway | The IPv6 gateway address of the VPC to which the NIC belongs. | 2408:XXXX:325:a204:ffff:ffff:ffff:fff7 |
disk/ | The ID of the disk. | d-bp131n0q38u3a4zi**** |
disk/[disk]/disk-id | The name of the disk. | d-bp131n0q38u3a4zi**** |
disk/[disk]/disk-type | The category of the disk. | cloud-efficiency |
dns-conf/nameservers | The Domain Name System (DNS) configurations of the instance. | 100.100.XX.XX |
ntp-conf/ntp-servers | The address of the Network Time Protocol (NTP) server. | ntp.aliyun.com |
source-address | The address of the YUM or APT image repository. The package management software of a Linux instance can obtain updates from the image repository. | http://mirrors.cloud.aliyuncs.com |