This topic provides answers to frequently asked questions about Elastic Compute Service (ECS) API operations.
- What is an ECS API operation?
- What do I do if the InvalidDataDiskCategory.NotSupported error code is returned when I create an ECS instance?
- How do I set sequential instance names or hostnames when I create multiple ECS instances?
- How can I create an ECS instance that is assigned a public IP address?
- What do I do if the public IP address of an ECS instance cannot be pinged after I create the instance by calling an ECS API operation?
- What do I do if the "The specified IP is already in use." error message is returned when I call an ECS API operation to assign a public IP address to an ECS instance?
- When I modify the public bandwidth configurations of an instance by calling an ECS API operation, Can I specify an effective period for the new bandwidth configurations ?
- What do I do if only specific security group rules are displayed when I call an API operation or use ECS SDKs to query the rules of a security group?
- Why are only 10 entries returned for a request made by using an ECS API operation, an ECS SDK, or an Alibaba Cloud CLI command?
What is an ECS API operation?

What do I do if the InvalidDataDiskCategory.NotSupported error code is returned when I create an ECS instance?
- Problem description: When you call the RunInstances operation to create an ECS instance, the following error is returned:
{ "Code": "InvalidDataDiskCategory.NotSupported", "Message": "Specified disk category is not supported." }
- Cause: The error occurred because disks of the specified category cannot be created in the specified zone.
- Solution: We recommend that you call the DescribeAvailableResource operation to query the resources available in the zone where you want to create the ECS instance and make sure that resources in the zone are sufficient. You can also change the value of ZoneId and try again.
aliyun ecs RunInstances --ImageId win2008_64_ent_r2_cn_40G_alibase_20150429.vhd --InstanceType ecs.g5.large --SecurityGroupId <TheSecurityGroupId> --SystemDiskCategory cloud_efficiency --ZoneId cn-hangzhou-c
How do I set sequential instance names or hostnames when I create multiple ECS instances?
We recommend that you call the RunInstances operation to create multiple ECS instances. RunInstances contains the InstanceName and HostName parameters. You can set the instance name and the hostname that comply with the naming conventions.
Use the following methods to set sequential instance names or hostnames for multiple ECS instances:
- Add the sequential suffix specified by the UniqueSuffix parameter to the instance name specified by the InstanceName parameter or the hostname specified by the HostName parameter. A sequential suffix can be in the range from 001 to 999.A Examples: LocalHost001 and LocalHost002, and MyInstance001 and MyInstance002.
- Specify the instance names or hostnames for multiple ECS instances in the name_prefix[begin_number,digits]name_suffix format. For example, if you set the InstanceName parameter to k8s-node-[1,4]-alibabacloud, the name of the first ECS instance is k8s-node-0001-alibabacloud. A maximum of 999,999 ECS instances can share the same prefix and suffix.
- name_prefix: the prefix of the instance name or hostname. A prefix is required when you specify sequential names. Otherwise, the names are regarded as common names.
- [begin_number,digits]: the starting value of the number in the instance name or hostname. Numbers in instance names or hostnames are incremental. These numbers identify different ECS instance names or hostnames of different instances. The [begin_number,digits] segment cannot contain spaces.
- begin_number: the number from which the instance name starts. Valid values: 0 to 999999. Default value: 0.
- digits: the number of digits in the instance name. Valid values: 1 to 6. Default value: 6.
- If you specify
[]
or[,]
, begin_number starts from 0 and digits is set to 6. - If you specify
[99]
or[99,]
, begin_number starts from 99 and digits is set to 6. - If the number of the digits specified by begin_number is greater than the value of digits, the digit of begin_number takes precedence. For example, digits is set to 1 in [1234,1], and the value of begin_number is set to 1234. digits is set to 6.
- If the sum of the begin_number value and the number of ECS instances exceeds the maximum value of 999999, all ECS instances whose names that contain numbers greater than the maximum value use 999999.
- name_suffix: the suffix of an instance name or hostname.
instance099
instead of instance099001
. How can I create an ECS instance that is assigned a public IP address?
- Method 1: Call the RunInstances operation and set InternetMaxBandwidthOut to a value greater than 0 to create an ECS instance. The ECS instance is automatically assigned a public IP address.
- Method 2: Call the CreateInstance operation to create an ECS instance. Then, call the AllocatePublicIpAddress operation to assign a public IP address to the instance.
What do I do if the public IP address of an ECS instance cannot be pinged after I create the instance by calling an ECS API operation?
- Problem description: The ECS instance that you created by calling an ECS API operation cannot connect to the Internet, and the public IP address of the instance cannot be pinged.
- Cause: The security group to which the instance belongs does not have a rule to allow Internet access.
- Solution: Call the AuthorizeSecurityGroup operation to add an inbound rule to the security group to allow Internet access. For example, you can send the following request where IpProtocol is set to ICMP to call the AuthorizeSecurityGroup operation and add an inbound rule that allows the public IP address of this instance to be pinged from all IP addresses:
https://ecs.aliyuncs.com/?Action=AuthorizeSecurityGroup &SecurityGroupId=sg-bp15ed6xe1yxeycg7*** &SourceCidrIp=0.0.0.0/0 &IpProtocol=ICMP &PortRange=-1/-1 &<Common request parameters>
What do I do if the "The specified IP is already in use." error message is returned when I call an ECS API operation to assign a public IP address to an ECS instance?
- Problem description: When you call the AllocatePublicIpAddress operation to assign a public IP address specified by IpAddress to an ECS instance, the following error is returned:
{ "Code": "IpInUse", "Message": "The specified IP is already in use." }
- Cause: The specified IP address is already in use.
- Solution: Check whether the IP address is already in use. If yes, try another IP address.
When I modify the public bandwidth configurations of an instance by calling an ECS API operation, Can I specify an effective period for the new bandwidth configurations ?
You can call the ModifyInstanceNetworkSpec operation to modify the public bandwidth configurations of an ECS instance. The new bandwidth configurations take effect on the instance immediately after the modification. If you want to temporarily modify the bandwidth configurations of your instance, set StartTime and EndTime to specify an effective period.
If you are using an elastic IP address (EIP), you can call the ModifyEipAddressAttribute operation to make the modification but you cannot specify an effective period.
What do I do if only specific security group rules are displayed when I call an API operation or use ECS SDKs to query the rules of a security group?
aliyun ecs DescribeSecurityGroupAttribute --SecurityGroupId <TheSecurityGroupId> --RegionId <TheRegionId>
aliyun ecs DescribeSecurityGroupAttribute --SecurityGroupId <TheSecurityGroupId> --RegionId <TheRegionId> --NicType intranet
Why are only 10 entries returned for a request made by using an ECS API operation, an ECS SDK, or an Alibaba Cloud CLI command?
For more information about this issue, see Why are only 10 entries returned after an API operation is called by using an ECS SDK in Alibaba Cloud CLI?.