edit-icon download-icon

How to filter ECS instance by instance names?

Last Updated: Jun 12, 2017

Currently, ECS instance IDs are unique ECS identifiers and cannot be changed. To customize ECS names, you can change ECS instance names. For example:

Instance ID Instance name
i-xxxxx01 style01
i-xxxxx02 style02
i-xxxxx03 style03
i-xxxxx04 temp01

You can use the DescribeInstances method of ECS API to perform fuzzy search. In this method, you can use the InstanceName parameter to obtain instance names. For example, to search for an ECS instance whose name starts with “style02”, you can run aliyuncli ecs DescribeInstances --InstanceName "style02" to obtain the information of the target ECS instance. (Note the InstanceName parameter value, which is recommended to be included in double quotation marks.)

Besides, the value of the InstanceName parameter supports wildcards. For example, to search for an ECS instance whose name starts with “style”, you can run aliyuncli ecs DescribeInstances --InstanceName "style*" to obtain the information of the target ECS instance.

If the problem persists, contact Alibaba Cloud After-Sales Technical Support.

Thank you! We've received your feedback.