Managing Instances via Tags

Last updated: 2024-05-15 09:43:51

Scenario

Tags are key-value pairs provided by Tencent Cloud for identifying cloud resources. Tags can help you conveniently categorize and manage cloud server resources from various perspectives, such as business, purpose, and person in charge. Please note that Tencent Cloud does not use the tags you set; they are solely for your management of server resources.

Usage Limits

You need to pay attention to the following use limits of tags:
Quantity: each resource can have at most 50 tags.
Tag key limitations:
qcloud, tencent, and project prefixes are reserved for system tag keys and cannot be created.
Tags can only contain numbers, letters, and +=.@-, with a maximum length of 255 characters for the tag key.
Tag value limit: A tag value can contain up to 127 characters. Only null strings or digits, letters, and + = . @ - symbols are supported.

Directions and Use Cases

Use case

A company has purchased six CVM instances, of which the business group, scope and owners are as follows:
Instance instance-id
Business Group
Business Scope
Owner
ins-abcdef1
E-commerce
Marketing campaigns
John Smith
ins-abcdef2
E-commerce
Marketing campaigns
Chris
ins-abcdef3
Gaming
Game A
Jane Smith
ins-abcdef4
Gaming
Game B
Chris
ins-abcdef5
Entertainment
Post-production
Chris
ins-abcdef6
Entertainment
Post-production
John Smith

Taking
ins-abcdef1 as an example, we can add the following 3 sets of tags to the instance:
Tag Key
Tag Value
dept
ecommerce
business
mkt
owner
zhangsan

Similarly, you can add tag key-value pairs to other instances based on the business group, scope and owners.

Setting tags in the CVM console

Take the preceding case as an example. After designing the tag key-value pairs, you can log in to the CVM console to specify the tags.
1. Log in to the CVM console.
2. On the instance management page, proceed according to the actually used view mode:
List view
Tab view
Select the instance for which you want to edit tags, then choose More > Instance Settings > Edit Tags.
Select the instance(s) you want to edit tags for, then choose the top-right corner More Actions > Instance Settings > Edit Tags.
3. In the Edit Tags pop-up window, set the tags . For example, add three sets of tags to the instance ins-abcdef1.
4. Click OK, and the system will display a successful modification message.

Filtering instances by tags

To filter instances by tag, follow the steps below:
1. In the search box, select Tag Key.
2. Enter the tag key after Tag Key: and click

to search. You can filter by multiple tag keys simultaneously. For example, entering Tag Key: key1|key2 will filter instances with the tag keys key1 or key2.