You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Instance configuration
Batch configuring sequential instance names or hostnames
Copy page
Download PDF
Batch configuring sequential instance names or hostnames
This topic describes how to configure sequential names or hostnames for multiple instances when you create instances in a batch in the ECS console or via OpenAPI. This helps you to better manage your instances.​
Configuration rules​
Naming rules​
The naming rules for instance names and hostnames are listed below:​
​
Type​
Naming rules​
Instance name​
  • Start with a letter or a Chinese character.​
  • Only Chinese characters, letters, digits, underscores (_), hyphens (-), and dots (.) are allowed.​
  • It must be 1 to 128 characters in length.​
Host name​
  • Linux instances:​
  • Letters, numbers, periods ".", and hyphens "-" are allowed.​
  • Can not start or end with a hyphen or period. Hyphens and periods can not be used consecutively.​
  • The length limit is 2 to 63 characters.​
  • Windows instances:​
  • Letters, numbers, and hyphens ("-") are allowed, but the name cannot consist only of digits.​
  • Can not start or end with a hyphen. Hyphens can not be used consecutively.​
  • The length limit is 2 to 15 characters.​
​
Naming format​
Format​
Parameter format of configuring sequential names: name_prefix[begin_number,bits]name_suffix. Detailed field descriptions are listed below.​
​
Field​
Description​
Examples​
name_prefix​
Indicates the prefix of instance names or hostnames. You are required to specify this field based on the naming rules.​
name​
[begin_number,bits]​
  • begin_number: Specifies the starting number of instance names or hostnames.​
  • Value range: [0,9999]​
  • Default value: 0​
  • bits: Specifies the number of bits that value(s) occupy in instance names or hostnames.​
  • Value range: [1,4]​
  • Default value: 4​
tip​
  • Only English commas (,) are supported to separate values of "begin_number" and "bits", and no spaces are allowed between.​
  • If [begin_number,bits] is specified as [] or [,], the value of "begin_number" starts from 0, and "bits" takes the default value 4.​
  • If the total digits of begin_number plus Count (instance number) exceed the specified bits, the names are created based on the actual total digit count. This total cannot exceed the maximum allowed bits. Otherwise, the creation fails.​
[99,3]​
name_suffix​
Indicates the suffix of instance names or hostnames.​
ecs​
​
Examples​
​
Description​
Input parameter​
Instance names (three instances)​
Standard format​
name[1,3]ecs​
name001ecs, name002ecs, name003ecs​
Standard format. Digits of begin_number + Count: > specified value of "bits"​
name[99,2]ecs​
name099ecs, name100ecs, name101ecs​
"begin_number" and "bits" are left empty​
name[]ecs or name[,]ecs​
name0000ecs, name0001ecs, name0002ecs​
​
Procedure​
​
ECS console
OpenAPI
​
The following mainly describes how to configure instance names and hostnames. For more instance configurations, refer to Purchasing an instance by following the wizard.​
  1. Log in to the ECS console. ​
  1. Click the "Create instance" button to purchase an ECS instance.​
  1. Configure the information in Basic configuration and Network configuration.​
  1. On the "Custom configuration" tab, in the "Instance name" (required) or "Hostname" field, enter the desired sequence in the format name_prefix[begin_number,bits]name_suffix. For configuration rules, see Naming format. Then complete the remaining configurations.​
  • In the example provided in this topic, name[1,3]ecs is entered in "Instance name", and name[1,3]host in "Hostname".​
  1. Set the number of instances to 3 to complete the purchase.​
Operation results:​
After the purchase, you can view the three newly created instances on the Instances page. Their sequential instance names are name001ecs, name002ecs, and name003ecs, and sequential hostnames are name001host, name002host, and name003host.​
​
Last updated: 2026.06.18 17:49:49