How to use machine tags (snap/3.1/UI)
This article will explain:
- How to create and assign machine tags to machines
- How to remove and delete machine tags from machines
- How to list machine tags for multiple machines
- How to view machine tags for one machine
- How to view machine tags for a VM host
If you want to create a new tag, and simultaneously assign it to a machine, use the following steps:
- Go to the machine list and select the machine you’re interested in modifying, by checking the box next to the machine name:
- Select the “Take action” drop-down menu and select “Tag”:
Create and/or assign the desired tag, as described in the general tagging procedure above.
Don’t forget to hit the “Tag machine” button when you’re done, to apply your changes to the machine.
In the first step of the above procedure, you can select more than one machine:
Any tags you add in the “Tags” box will be applied to all selected machines, as noted by the change in the “Tag machine” button:
Other than the scope of the transaction (e.g., tagging three machines, in this case), everything else about this operation conforms to the general tag assignment procedure.
To remove machine tags from a machine:
View a machine’s currently assigned tags: stay on the ‘Machines’ page and click on the machine in question. MAAS will display currently-assigned tags in the Tags pane of the ‘Machine summary’.
Select the ‘Configuration’ tab and then the ‘Edit’ button alongside ‘Machine configuration’ to edit tags:
Follow the general tag removal procedure.
In the MAAS UI, you don’t explicitly list all machine tags; instead, you filter by them using the “Filter by” drop-down. This filtered list does not distinguish between virtual machines (VMs) and physical machines, unless you’ve assigned tags to help with that distinction.
Here’s how you can filter the machine list by machine tags, using the MAAS UI:
To list all tags, visit the ‘Machines’ tab and expand the ‘Tags’ subsection in the left pane. In this view, you can use tags as machine search filters.
Select one or several tags. The machines that satisfy all selected tags will display on the right pane. Notice there is a search field at the top of the right pane. You can type a search expression into this field.
Below, tag ‘virtual’ has been selected (with the mouse), and the search field automatically reflects this. Five machines satisfy this search filter.
Remove a tag from the search filter by either hitting the ‘x’ character alongside a tag or editing the search expression.
To view the tags assigned to a specific machine, use the following procedure:
On the machine list, select the machine of interest by clicking on its name.
On the machine detail screen that comes up, look for the tags on one of the cards presented there: the tags for that machine should be listed there.
To view the machine tags assigned to a VM host, here’s the procedure you’ll follow:
- Click on the KVM tab at the top of the screen. This will bring you to a list of active KVMs for your system:
- On the detail screen that comes up, choose the “Settings” tab at the top:
- In the settings tab, you’ll see a box labelled “Tags.” You can use this box to view, assign, edit, or remove tags for the KVM:
Note that you can only see the tags for a VM host in the same place that you change it. For a more comprehensive list of VM host tags, use the MAAS CLI.