Found 0 result in total
Content is empty
If you don't find the content you expect, please try another search term
Last updated:2021-08-04 11:26:31
Instance metadata refers to the configuration information related to KEC and EPC instances, such as NICs, instance names, and IP addresses. It can be used to configure and manage running instances.
This topic describes how to query instance metadata in Linux operating systems and explains each item of the metadata.
Access the root directory of the metadata.
curl http://global.cloudinit.sdns.ksyun.com:8775/latest/meta-data/
Add metadata item names to URLs to obtain detailed information about the corresponding metadata. Common metadata items:
Obtain the instance ID.
curl http://global.cloudinit.sdns.ksyun.com:8775/latest/meta-data/instance-id
curl http://global.cloudinit.sdns.ksyun.com:8775/latest/meta-data/hostname
curl http://global.cloudinit.sdns.ksyun.com:8775/latest/meta-data/host-type
curl http://global.cloudinit.sdns.ksyun.com:8775/latest/meta-data/image-id
curl http://global.cloudinit.sdns.ksyun.com:8775/latest/meta-data/mac
curl http://global.cloudinit.sdns.ksyun.com:8775/latest/user-data
Name of metadata item | Description of metadata item |
---|---|
hostname | Name of the host (name of operating system) |
host-type | Instance type |
instance-id | Instance ID |
image-id | Image ID |
vpc-id | ID of the VPC where the primary NIC resides |
subnet-id | ID of the subnet where the primary NIC resides |
securitygroup-ids | ID of the security group to which the primary NIC belongs |
mac | MAC address of the primary NIC |
placement/region | Region of the instance |
placement/zone | Availability zone of the instance |
local-ipv4 | IPv4 address of the primary NIC |
local-ipv6 | IPv6 address of the primary NIC |
public-ipv4 | Elastic IP address of the primary NIC |
network/interfaces/macs | MAC addresses of instance NICs |
network/interfaces/macs/mac/vpc-id | ID of the VPCs where NICs reside |
network/interfaces/macs/mac/subnet-id | IDs of the subnets where NICs reside |
network/interfaces/macs/mac/gateway | Gateway addresses of NICs |
network/interfaces/macs/mac/local-ipv4 | IPv4 addresses of NICs |
network/interfaces/macs/mac/local-ipv6 | IPv6 addresses of NICs |
network/interfaces/macs/mac/public-ipv4 | Elastic IP addresses of NICs |
network/interfaces/macs/mac/securitygroup-ids | IDs of the security groups to which NICs belong |
Pure Mode