To allow you to name batch created instances/hosts according to a rule during creation, the features of automatically incrementing suffixed numbers and specifying pattern strings are provided.
This document applies to setting instance name and setting host name.
NoteThis document uses setting instance name as an example. The procedure may vary slightly according to the name type.
This feature allows you to name batch purchased instances with the same prefix and automatically ascending suffixed numbers.
The following example assumes that you have purchased three instances and want to name these instances in the form of "CVM+Sequence number" (for example, CVM 1, CVM 2, and CVM 3).NoteThe created instances are suffixed with numbers starting from 1 by default. You cannot specify the starting number.
CVM
as the instance name.This feature allows you to name batch purchased instances in a complex form with specified serial numbers. You can use one or more pattern strings in instance names as required.
The instance name with a specified pattern string is in the form of {R:x}, where x indicates the starting number in generated instance names.
The following example assumes that you want to create three instances and name them with ascending numbers starting from 3.
CVM{R:3}
as the instance name.The following example assumes that you want to create three instances and name them with the cvm, Big, and test prefixes, where cvm and Big are followed by ascending numbers starting from 13 and 2, respectively. For example, their names are cvm13-Big2-test, cvm14-Big3-test, and cvm15-Big4-test, respectively.
cvm{R:13}-Big{R:2}-test
as the instance name.After you batch create instances through automatically incrementing suffixed numbers or specifying pattern string, you can verify the feature as follows:
Log in to the CVM console and view the newly created instances. You can see that the batch purchased instances are named according to the rule you set as shown below:
Select different steps according to the instance's operating system:
On the operating system UI, run the following commands:
hostname
View the returned result of the hostname
command.
If the returned result is similar to the following, the setting is successful.
cvm13-Big2-test
Repeat step 1–step 3 to verify other batch purchased instances.
Was this page helpful?