The power of annotations in MAAS
Errors or typos? Topics missing? Hard to read? Let us know!
Annotations in MAAS are potent tools for adding context and metadata to your machines. They act as supplementary data that allow you to identify, filter, and manage your machines more effectively. Essentially, annotations fall into two categories:
Note: Dynamic annotations aren't supported in MAAS version 2.9 or earlier.
Notes are persistent descriptions that stay with a machine throughout its lifecycle unless manually altered. You can manage notes through both the MAAS UI and CLI.
Navigating notes in the MAAS UI
To add or modify notes via the MAAS UI:
To determine machine identifiers, run the following command:
maas $PROFILE machines read \
| jq -r '(["hostname","system_id"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id])
|@tsv' | column -t
You can add or modify a note as follows:
maas $PROFILE machine update $SYSTEM_ID description="$NOTE"
To erase a note, just use an empty string:
maas $PROFILE machine update $SYSTEM_ID description=""
The road to dynamic annotations
Dynamic annotations are ephemeral data, tied to the operational states of allocated or deployed machines. These annotations are especially handy for tracking the live status of your workloads.
Identifying eligible machines for dynamic annotations
To list machines that can receive dynamic annotations, execute:
maas $PROFILE machines read \
| jq -r '(["hostname","system_id","status"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.status_name])
|@tsv' | column -t
You can define dynamic annotations using key=value
pairs. To set one, use:
maas $PROFILE machine set-owner-data $SYSTEM_ID $KEY=$VALUE
To change or remove a dynamic annotation, use the following commands:
maas $PROFILE machine set-owner-data $SYSTEM_ID $KEY=$NEW_VALUE
maas $PROFILE machine set-owner-data $SYSTEM_ID $KEY=""
To view all current dynamic annotations, run:
maas $PROFILE machines read \
| jq -r '(["hostname","system_id","owner_data"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.owner_data[]])
|@tsv' | column -t
Annotations in MAAS offer an additional layer of intelligence to your machine management. While notes provide a stable form of annotations, dynamic annotations offer a more fluid form of tracking, directly linked to your machine's operational status. Both these tools, combined with the power of the MAAS UI and CLI, give you complete control over your machine metadata.