How to label and find machines

When you’re working with a half-dozen machines, a lot of labelling isn’t necessary. As your constellation of machines grows, though, you reach a point where you can’t keep a compact picture in your head. This is where tags, annotations, and filtering come in.

Two of the more useful attributes of machines are tags and annotations. These can be used not only to identify machines, but to customise them (e.g., kernel options) when they are commissioned and deployed. You can tag machines, annotate machines, and use tags to mark machines, storage, controllers, and network interfaces.

You can also use filtering to find a given subset of machines. There isn’t a lot of theory, per se, on filtering, since it’s just a utility function of the user interface.

The rest of this article contains a little background information on tags and annotations.

About tags

Tags are short, descriptive, searchable words that can be applied to various MAAS objects, including:

  • machines (physical and virtual)
  • VM hosts
  • controllers (rack and region)
  • storage (virtual and physical; block devices or partitions)
  • network interfaces
  • devices
  • nodes (in the CLI only)

Tags serve to help you identify, group, and find objects easily, especially when you routinely deploy hundreds of machines.

About annotations

Annotations are descriptive, searchable phrases that apply only to machines. There are two types of annotations: static (always present in any machine state), and dynamic (only present in allocated or deployed states). Annotations help you identify, characterise, and inform others about your machines.

About tags and scripts

As with general tag management, tags make scripts easier to manage; grouping scripts together for commissioning and testing, for example:

maas $PROFILE node-script add-tag $SCRIPT_NAME tag=$TAG
maas $PROFILE node-script remove-tag $SCRIPT_NAME tag=$TAG

MAAS runs all commissioning scripts by default. However, you can select which custom scripts to run during commissioning by name or tag:

maas $PROFILE machine commission \

You can also select which testing scripts to run by name or tag:

maas $PROFILE machine commission \

Any testing scripts tagged with commissioning will also run during commissioning.

Last updated 5 days ago.