In the Alibaba cloud Enviroment, how to find out the instance id of an ECS instance from within the ECS instance?
Steps for Linux Instance
curl http://100.100.100.200/latest/meta-data/
to access the root directory of the metadata.curl http://100.100.100.200/latest/meta-data/instance-id
to get the ID of an ECS instance.
Run curl http://100.100.100.200/latest/meta-data/image-id
to get the image ID of an ECS instance.For Windows Instances
Invoke-RestMethod http://100.100.100.200/latest/meta-data/
to get the metadata.Invoke-RestMethod http://100.100.100.200/latest/meta-data/instance-id
to get the ID of an ECS instance.
Run Invoke-RestMethod http://100.100.100.200/latest/meta-data/image-id
to get the image ID of an ECS instance.