Help Center > > FAQs> ECS Management> Hostnames> How Can I Set Sequential ECS Names When Creating Multiple ECSs?

How Can I Set Sequential ECS Names When Creating Multiple ECSs?

Updated at: Jan 26, 2021 GMT+08:00

Scenarios

When creating multiple ECSs at the same time, you can use either of the following methods to sequentially name the ECSs:

  • Automatic naming: The system automatically adds a hyphen followed by a four-digit incremental number to the end of each ECS name.
  • Customizable naming: You can customize a naming rule in the format "name_prefix[begin_number,bits]name_suffix". The system will automatically name the ECSs according to naming rule you specify.

This section describes how to use the two methods to name ECSs.

Automatic Naming

The name can be customized but must comply with the following naming rules: Can contain only letters, digits, underscores (_), hyphens (-), and periods (.), and must be 1 to 64 characters long.

When you create multiple ECSs at the same time, the system automatically adds a hyphen followed by a four-digit incremental number to the end of each ECS name. In this case, the customized name is 1 to 59 characters long. For example, if you enter ecs and there is no existing ECS in the system, the first ECS's name will be ecs-0001. If you create multiple ECSs again, the values in the new ECS names increase from the existing maximum value. For example, the existing ECS with the maximum number in name is ecs-0010. If you enter ecs, the names of the new ECSs will be ecs-0011, ecs-0012, .... When the value reaches 9999, it will start from 0001.

Allow duplicate ECS name: allows ECS names to be duplicate. If you select Allow duplicate ECS name and create multiple ECSs in a batch, the created ECSs will have the same name.

  • Example 1: If there is no existing ECS and you enter ecs-f526,

    The ECSs will be named ecs-f526-0001, ecs-f526-0002, ecs-f526-0003, ....

  • Example 2: If there is an ECS named ecs-0010 and you enter ecs-f526,

    The ECSs will be named ecs-f526-0011, ecs-f526-0012, ecs-f526-0013, ....

  • Example 3: If there is an ECS named ecs-0010 and you select Allow duplicate ECS name,

    All the ECSs will be named ecs-0010.

Customizable Naming

You can customize a naming rule in the format "name_prefix[begin_number,bits]name_suffix". The system will automatically name the ECSs according to naming rule you specify.

Field Description for a Customizable Naming Rule

Figure 1 shows the format of a customizable naming rule.

Figure 1 Format of a customizable naming rule

Table 1 describes these parameters.

Table 1 Parameters in a customizable naming rule

Field

Mandatory

Description

Example

name_prefix

Yes

ECS name prefix

Contains only letters, digits, underscores (_), hyphens (-), and periods (.).

ecs

[begin_number,bits]

Yes

Sequence numbers that increase in ascending order to differentiate multiple ECSs.

[0,4]

name_suffix

No

ECS name suffix

Contains only letters, digits, underscores (_), hyphens (-), and periods (.).

f526

Table 2 [begin_number,bits] parameters

Field

Mandatory

Description

Example

begin_number

No

Begin number of ECS names.

The begin number ranges from 0 to 9999. The default value is 0.

0

bits

No

Number of bits for the sequential numbers in ECS names.

The value ranges from 1 to 4. The default value is 4.

4

Notes on Using Customizable Naming
  • Customized names cannot be duplicate.
  • No space is allowed in [begin_number,bits].
  • If the bits of "Begin number + Number of ECSs to be created - 1" is greater than the specified bits, the bits of "Begin number + Number of ECSs to be created - 1" will be used.

    For example, if [begin_number,bits] is set to [8,1] and the number of ECSs to be created is 2, the bits of "Begin number + Number of ECSs to be created - 1" is the same as the specified bits (1). Then, the ECSs will be named name_prefix8name_suffix and name_prefix9name_suffix.

    If [begin_number,bits] is set to [8,1] and the number of ECSs to be created is 3, the specified bits is 1, the bits of "Begin number + Number of ECSs to be created - 1" (value 10, bits 2) is different from the specified bits (1). Therefore, the bits of "Begin number + Number of ECSs to be created - 1" will be used, which is 2.

    The ECSs will be named name_prefix08name_suffix, name_prefix09name_suffix, and name_prefix10name_suffix.

  • If the value of "Begin number + Number of ECSs to be created" is greater than the maximum value 9999, the sequential numbers that exceed 9999 will consistently to be 9999.
  • If [begin_number,bits] is set to [] or [,], the begin number starts from 0, and the number of bits is 4 by default.
  • If [begin_number,bits] is set to [99] or [99,], the begin number starts from 99, and the number of bits is 4 by default.
Customizable Naming Examples
  • Example 1: If you select customizable naming and enter name_prefix[,]name_suffix,

    The ECSs will be named name_prefix0000name_suffix, name_prefix0001name_suffix, name_prefix0002name_suffix, ....

  • Example 2: If you select customizable naming and enter name_prefix[]name_suffix,

    The ECSs will be named name_prefix0000name_suffix, name_prefix0001name_suffix, name_prefix0002name_suffix, ....

  • Example 3: If you select customizable naming and enter name_prefix[9,]name_suffix,

    The ECSs will be named name_prefix0009name_suffix, name_prefix0010name_suffix, name_prefix0011name_suffix, ....

  • Example 4: If you select customizable naming and enter name_prefix[,3]name_suffix,

    The ECSs will be named name_prefix000name_suffix, name_prefix001name_suffix, name_prefix002name_suffix, ....

  • Example 5: If you select customizable naming and enter name_prefix[8]name_suffix,

    The ECSs will be named name_prefix0008name_suffix, name_prefix0009name_suffix, name_prefix0010name_suffix, ....

  • Example 6: If you select customizable naming and enter name_prefix[9999]name_suffix,

    All the ECSs will be named name_prefix9999name_suffix.

  • Example 7: If you select customizable naming and enter name_prefix[8],

    The ECSs will be named name_prefix0008, name_prefix0009, name_prefix0010, ....

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel