Updated on 2026-08-10 GMT+08:00

Adding Tags to an ECS

Tags are used to identify cloud resources, such as ECSs, images, and disks. If you have multiple types of cloud resources which are associated with each other, you can add tags to the resources to classify and manage them easily. For more details, see Overview.

Constraints

If your organization has configured tag policies for cloud resources, add tags to resources based on the tag policies. If a tag does not comply with the tag rules, the creation may fail. Contact the organization administrator to learn about tag policy details.

Tag setting rules:

  • A maximum of 20 tags can be added to each ECS.
  • Each tag consists of a key-value pair.
  • For each resource, a tag key must be unique and can have only one tag value.
  • A tag consists of a tag key and a tag value. Table 1 lists the tag key and value requirements.
    Table 1 Tag key and value requirements

    Parameter

    Requirement

    Example Value

    Key

    • Cannot be left blank.
    • The key value must be unique for an ECS.
    • Can contain a maximum of 128 characters.
    • Cannot contain the following special characters: =*<>\,|/
    • Cannot be started or ended with a space.

    Organization

    Value

    • Can contain a maximum of 255 characters.
    • Cannot contain the following special characters: =*<>\,|
    • Cannot be started or ended with a space.

    Apache

Adding Tags During ECS Creation

  1. Log in and access the Buy ECS page.
  2. Set required parameters as instructed.

    Under Instance Management > Tag, add tag keys and values to the ECS based on the constraints described in Constraints. You can also use predefined tags. For details, see Adding Predefined Tags to an ECS.

    For details about other parameters, see Purchasing an ECS in Custom Config Mode.

    Figure 1 Adding tags

Editing Tags in the ECS List

  1. Log in to the ECS console and access the ECS list page.
  2. In the ECS list, edit tags using either of the following methods:
    • Method 1: Hover over in the Tag column of the ECS list and click Edit Tag.
    • Method 2: Locate the target ECS and choose More > Edit Tag in the Operation column.

      To edit tags for multiple ECSs in a batch, select the target ECSs and choose More > Edit Tag above the list.

  3. In the slide-out panel, click Add and enter tag keys and values based on the constraints described in Constraints.
    You can also use predefined tags. For details, see Adding Predefined Tags to an ECS.
    Figure 2 Editing tags
  4. (Optional) On the Edit Tag panel, edit tags of associated resources.

    If you want to add tags to the EVS disks and EIPs associated with the ECS, select Disks and EIPs.

  5. Click OK.

Editing Tags on the ECS Details Page

  1. Log in to the ECS console and access the ECS list page.
  2. In the ECS list, click the name of the target ECS.

    The ECS details page is displayed.

  3. Click the Tags tab and then Add Tag. In the displayed dialog box, enter the tag key and value based on the requirements described in Constraints.
    You can also use predefined tags. For details, see Adding Predefined Tags to an ECS.
    Figure 3 Adding tags on the Tags tab
  4. (Optional) In the Add Tag dialog box, add tags to associated resources.

    If you want to add tags to the EVS disks and EIPs associated with the ECS, select Disks and EIPs.

  5. Click OK.

    After tags are added, you can click Edit in the Operation column to edit them.

    You can edit the tags of the selected associated resources (disks or EIPs) at the same time. The tags of the selected associated resources will be updated accordingly.
    Figure 4 Editing tags of associated resources

Adding Tags on the TMS Console

This method is suitable for adding tags with the same tag key to multiple resources.

  1. Log in to the TMS console.
  2. On the displayed page, select the region where the resource is located, select ECS-ECS for Resource Type, and click Search.

    All ECSs matching the search criteria are displayed.

  3. In the Search Results area, click Create Key. In the displayed dialog box, enter a key (for example, project) and click OK.

    After the tag key is created, it will be displayed in the resource tag list. If not, click and select the key you just created.

    By default, the value of the tag key is Not tagged. You need to set a value for the tag of each resource to associate the tag with the resource.

    Figure 5 Resource list
  4. Click Edit to make the resource list editable.
  5. Locate the row containing the target ECS, click , and enter a value (for example A).

    After a value is set for a tag key, the number of tags is incremented by 1. Repeat the preceding steps to add tag values for other ECSs.

    Figure 6 Setting a tag value

Adding Predefined Tags to an ECS

If you want to add the same tag to multiple ECSs or other resources, you can create a predefined tag on the TMS console and then select the tag for the ECSs or other resources. This frees you from having to repeatedly enter tag keys and values. To do so, perform the following operations:

  1. Log in to the TMS console.
  2. Choose Predefined Tags in the left navigation pane and click Create Tag. In the slide-out panel, enter a tag key (for example, project) and a tag value (for example, A).
  3. Go back to the ECS console.
  4. Select predefined tags from the tag key and tag value drop-down lists. This operation is available during or after the ECS creation.
    Figure 7 Selecting predefined tags