- Documentation
Elastic Compute Service
Elastic Compute Service
Best Practices
Instance configuration
Batch configuring sequential instance names or hostnames
Instance configuration
Batch configuring sequential instance names or hostnames
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:
Naming format
Format
Parameter format of configuring sequential names: name_prefix[begin_number,bits]name_suffix. Detailed field descriptions are listed below.
Examples
Procedure
- Click the "Create instance" button to purchase an ECS instance.
- Configure the information in Basic configuration and Network configuration.
- 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".
- 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.
When you create instances in a batch by calling the RunInstances interface, the sequential suffix parameter UniqueSuffix can affect the sequential names of instances. Details are as follows.
tip
- The following mainly introduces arguments for configuring sequential names. For information about other arguments, refer to RunInstances.
- To configure sequential names for parameters InstanceName and Hostname, specify the parameters in the format name_prefix[begin_number,bits]name_suffix. For configuration rules, refer to Naming format.
Disable sequential suffix feature, with [begin_number,bits] specified only
Enable sequential suffix feature, with [begin_number,bits] not specified
Enable sequential suffix feature, with [begin_number,bits] specified
After disabling the sequential suffix feature (disabled by default), you can sequence names of the instances created in a batch by specifying values in the format of [begin_number,bits]. Detailed argument configurations are as follows:
- UniqueSuffix: false (default). This means not adding sequential suffixes for specified values of InstanceName and Hostname.
- InstanceName: name[1,3]ecs
Based on the operations above, the sequential names of the three newly created instances are name001ecs, name002ecs, and name003ecs. Their sequential hostnames are name001host, name002host, and name003host.
When creating multiple instances, you can enable the sequential suffix feature to automatically sequence instance names and hostnames. The parameters are configured as follows:
- UniqueSuffix: true. This means adding suffixes automatically sequenced for what is specified in InstanceName and Hostname, respectively. The number of added suffixes starts from 1 by default and increases sequentially based on the number of instances.
- SuffixIndex (optional): Specifies the starting number of sequential suffixes. Default value: 1. Value range: 1 ~ 999.
Based on the operations above, the sequential names of the three newly created instances are ecs-1, ecs-2, and ecs-3. Their sequential hostnames are host-1, host-2, and host-3.
When you enable the sequential suffix feature and specify InstanceName or Hostname in parameter format [begin_number,bits] at the same time, configuration in [begin_number,bits] takes precedence over that of the UniqueSuffix parameter. Details are listed below.
Last updated: 2026.06.18 17:49:49