Offline docs (switch to live docs)                          UI-only  CLI-only

How to tag machines

Tags for different objects have similar purposes, but they aren't necessarily administered in the same way -- so we've included detailed articles for each tag type. That said, many of the common operations regarding tags are performed in the same way. This article will present some general, explanatory information, and then look at tag management steps that are the same (or very similar) across all types of MAAS tags.

How to name tags

When working with tags, there are some universal rules you need to follow:

  1. Tag names can include any combination of alphabetic letters (a-zA-Z), numbers (0-9), dashes (-) and underscores (_).
  2. Tag names can be a maximum of 256 characters in length.
  3. Tag names cannot include spaces.

In general, names that do not conform to these rules cannot be created.

How to download hardware configuration information

To download hardware configuration information in XML format:

  1. Select Machines.

  2. Select a machine which is allocated or deployed.

  3. Select Logs >> Installation output >> Download >> Machine output (XML).

You can learn more about these attributes if desired. Note that:

You can also find device classes from the same sources.

Automatic tags

MAAS 3.2 and above provide greatly expanded tagging capability. You can auto-apply tags to machines that match a custom XPath expression. Setting up an automatic tag lets you recognise special hardware characteristics and settings, e.g., the gpu passthrough.

How to create automatic tags

To create automatic tags:

  1. Select Organisation > Tags.

  2. Select Create new tag.

  3. Enter the Tag name.

  4. Optionally enter a Comment.

  5. Optionally enter Kernel options.

  6. Enter an XPath-based Definition. A tag is considered automatic when the definition field is filled with an XPath expression. The current version of our UI will only validate if your XPath expression is valid or not, but it will not show you which machines it will apply to before you create the tag.

  7. Select Save to register your changes.

Once an automatic tag is created the screen will initially show that 0 machines are tagged. That is because MAAS is running a background task to auto-apply the tag to matching machines. It can take some time to see that the number of machines tagged is populating.

[note] Kernel options will be applied at boot time. So by default kernel options will not be applied to any machines until they are deployed. If machines are deployed before they are tagged, the kernel option will be applied when these machines are redeployed. [/note]

How to update the definition of a tag

  1. Select Organisation > Tags.

  2. Select the pencil icon on the right end of the tag's row.

  3. Edit the Definition.

  4. Select Save to register your changes.

Keep in mind that when a new definition is updated, MAAS will re-tag all the machines that match with the new definition. This can take some time, since it is a background process.

How to update the kernel options on a tag

To update the kernel options on a tag:

  1. Select Machines.

  2. Select Tags.

  3. Select the pencil icon on the right end of the tag's row.

  4. Edit the Kernel options.

  5. Select Save to register your changes.

Kernel options can exist for both manual and automatic tags. However, they will be applied during boot time (commissioning and deploying).

[note] If the tagged machines are deployed, the updated kernel option won’t apply until the machines are redeployed. We suggest that you release those machines prior to the update, then redeploy those machines when the kernel options of the tag are updated. [/note]

How to unassign tags from machines

To unassign tags from machines:

  1. Select Machines.

  2. Select the checkbox(es) next to the machine(s) you wish to untag.

  3. Select Take action >> Tag. A table of tags appears at the top of the screen.

  4. For each tag you wish to unassign, select Remove. The text will change to Discard with an X to the right.

  5. If you want to undo a choice before saving, click the X to right of Discard to undo the proposed change.

  6. When you're satisfied with your new tag configuration, select Save to finalize and register your choice(s).

[note] Automatic tags cannot be unassigned manually. You can either update or delete automatic tags. [/note]

You can also unassign tags individually by going to Machines >> {machine-name} >> Configuration >> Tags >> Edit. The Tags table functions exactly the same as what's described above.

How to see all tagged nodes

To see how many nodes (Machines, controllers, devices) are tagged, search for GRUB_CMDLINE_LINUX_DEFAULT in the "Installation output" tab of the machine details page. That log should stay around for the lifetime of the deployment of the machine. The log gets overwritten when you redeploy the machine. For example:

GRUB_CMDLINE_LINUX_DEFAULT="sysrq_always_enabled dyndbg='file drivers/usb/* +p' console=tty1 console=ttyS0"

How to create and assign tags

In the MAAS UI, creating and assigning tags is a combined operation; that is, you create tags as you assign them, rather than creating them first. Creating tags in the UI is a little different user experience: there is a self-loading completion menu that collects all tags of a similar type. This completion menu helps you avoid misspelling tags when entering them more than once; otherwise, you might not be able to group and filter tags properly. It also makes tag entry more efficient.

To create and assign a tag to specific machines:

  1. Select Machines.

  2. Select the checkbox next to the machines you wish to tag.

  3. Select Take action >> Tag. A Tag dialogue will pop up at the top of the screen.

  4. In the box labelled Search existing or add new tags, enter the name for your proposed tag (e.g., {tag-name}).

  5. Select Create tag {tag-name}, under the Search... box. A modal dialogue box pops up; {tag-name} will automatically populate the Tag name field.

  6. Optionally enter a Comment.

  7. Optionally enter some Kernel options.

  8. Select Create and add to tag changes. You will be returned to the previous screen; note that your changes have not yet been registered with MAAS.

  9. If you wish to abandon this new tag without assigning it, select Discard X to the right of the new tag name. It will disappear from the list.

  10. If you're happy with the new tag(s), select Save to apply your changes to the selected machines. You'll be returned to Machines.

You can confirm your changes by hovering over the Tags list in the Machines screen.

How to delete and remove tags

You have two choices when it comes to eliminating tags from machines in your MAAS instance: you can delete them from all machines, or simply remove them from specific machines.

Deleting tags from all machines at once

To delete tags from all machines:

  1. Select Machines.

  2. Select Tags.

  3. Select the trash can icon to the right of the tag you'd like to delete. A warning dialogue will pop up at the top of the screen.

  4. Select Delete.

The tag will be unassigned from all machines and deleted. There is no undo.

Removing a tag from specific machines

To remove a tag only from specific machines:

  1. Select Machines.

  2. Select the checkbox next to each machine from which you want the tag removed.

  3. Select Take action >> Tag.

  4. For each tag you wish to unassign, select Remove. The text will change to Discard with an X to the right.

  5. If you want to undo a choice before saving, click the X to right of Discard to undo the proposed change.

  6. When you're satisfied with your new tag configuration, select Save to finalize and register your choice(s).