Mastering network interface tags
Errors or typos? Topics missing? Hard to read? Let us know!
Get to grips with the nitty-gritty of network interface tags in MAAS. There are two major sections:
Network tags do not vary by MAAS version.
Note: In the operations that follow, autocomplete might be scarce, as interface tags don't usually carry over between machines with different MAC addresses.
Creating and tagging network interfaces
To slap a tag onto an interface:
To remove a tag from an interface:
To scrutinise the tags on an interface:
Identify your network interfaces with a command akin to this:
maas $PROFILE interfaces read $SYSTEM_ID \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),(.[]|[.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
Example:
maas admin interfaces read xn8taa \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),(.[]|[.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
Expect output like:
mac_address type id tags
----------- ---- -- ----
00:16:3e:18:7f:ee physical 9 andrpko plinko cochise
Tag your network interface with this command format:
maas $PROFILE interface add-tag $SYSTEM_ID $INTERFACE_ID tag=$TAG_NAME
Example:
maas admin interface add-tag xn8taa 9 tag=farquar
You'll see a verbose JSON output revealing the changes.
To exterminate a tag:
maas $PROFILE interface remove-tag $SYSTEM_ID $INTERFACE_ID tag=$TAG_NAME
Example:
maas admin interface remove-tag xn8taa 9 tag=farquar
You'll be greeted with a JSON output that confirms the tag's removal.
List all tags with:
maas $PROFILE interfaces read $SYSTEM_ID \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),(.[]|[.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
Example:
maas admin interfaces read xn8taa \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),(.[]|[.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
Expect output like:
mac_address type id tags
----------- ---- -- ----
00:16:3e:18:7f:ee physical 9 andrpko plinko cochise farquar
To scope out tags on a specific interface:
maas $PROFILE interface read $SYSTEM_ID $INTERFACE_ID \
| jq '.tags'
Example:
maas admin interface read xn8taa 9 | jq '.tags'
Anticipate a JSON output displaying the tags.