Tagging VMs
Tags are user-defined labels that you can assign to ccloud³ VMs and other centron resources. They enable you to filter by tagged ccloud³ VMs and automatically include ccloud³ VMs in centron firewall or load balancer configurations based on tags. You can also create monitoring alert policies for groups of tagged ccloud³ VMs and use the centron API to initiate actions across multiple ccloud³ VMs with the same tag.
Choosing terms that describe the function of a ccloud³ VM can help you find and manage ccloud³ VMs with shared roles. For example, you could tag ccloud³ VMs as follows:
-
Environments such as production, staging or development.
-
Applications such as web servers (Apache) or database servers (MariaDB).
-
Purpose, such as a project name or another key term that describes the use of the ccloud³ VM.
-
The person or team responsible for managing the ccloud³ VM.
You can add tags to ccloud³ VMs either during or after creation.
Limits
- Tags must be a single word containing only letters, numbers, colons, hyphens and underscores.
Known issues
-
You cannot edit existing tags. Instead, create a new tag, apply it to the relevant resources, and delete the old one.
-
Tag names are case-insensitive, which means that the spelling you use when first creating a tag is the canonical form.
-
Tagged resources in the Control Panel always display the canonical form. For example, if you create a tag called PROD, you can tag resources in the Control Panel with “prod”. However, the tag will still be displayed using its canonical form, PROD.
-
When working with tags in the API, you must use the canonical form of the tag. For example, the URL to add this tag to a resource would be:
https://api.centron.com/v2/tags/PROD/resources(not /v2/tags/prod/resources).
Automating the tagging of ccloud³ VMs
- When tagging a ccloud³ VM via the API, you must have created a tag beforehand. This requirement does not apply when using
doctl.
Tagging ccloud³ VMs during creation
To add tags when creating a new ccloud³ VM, look for the ‘Tags’ field in the ‘Final details’ section of the ccloud³ VM creation page. Here, you can enter tags and add them one at a time using the SPACE BAR or ENTER key after each term.
Tagging existing ccloud³ VMs
To add or change tags for existing ccloud³ VMs, use the ‘More’ menu on the ccloud³ VM and select ‘Edit tags’, or use the ‘Tags’ link on the ccloud³ VM’s details page.
Filter by tag
If you click on a tag in the Control Panel, you will be taken to a list of all resources with that tag. Filtered lists are limited to a single tag, which is displayed at the top of the list.