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.
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.
This article will show you how to:
All headings have been hyperlinked for easy bookmarking. Note that not all functions for tags and annotations can be accessed via one interface (UI/CLI), so you will occasionally encounter cross-links.
Work with tags
This section is devoted to procedures for working with tags. We begin with some general operations that apply to all tags types, such as naming conventions and basic mechanics. We then walk through the various tag types, providing procedures that will help you create, assign, remove, delete, list, view, and filter tags, covering the nuances of each type.
Specifically, this section will show you how to:
- Work with tags, independent of application
- Work with machine tags
- Work with virtual machine host tags
- Work with region controller tags
- Work with rack controller tags
- Work with block device tags
- Work with partition tags
- Work with network tags
- Work with device tags
- Work with node tags
Work with tags, independent of application
This subsection will explain how to:
- Create a tag
- Create tags with built-in kernel options
- Delete a tag
- Update a tag
- List all tags available on this MAAS
- Rebuild a tag
Create a tag
With the CLI, you can create a tag with the following command:
maas $PROFILE tags create name=$TAG_NAME comment='$TAG_COMMENT'
For example, depending upon your system configuration, you might type a command similar to this one:
maas admin tags create name="new_tag" comment="a new tag for test purposes"
When the command is successful, you should see output similar to this:
Success.
Machine-readable output follows:
{
"name": "new_tag",
"definition": "",
"comment": "a new tag for test purposes",
"kernel_opts": "",
"resource_uri": "/MAAS/api/2.0/tags/new_tag/"
}
You can verify your work by listing all the tags on this MAAS.
Create tags with built-in kernel options
You can create tags with embedded kernel boot options. When you apply such tags to a machine, those kernel boot options will be applied to that machine on the next deployment.
To create a tag with embedded kernel boot options, use the following command:
maas $PROFILE tags create name='$TAG_NAME' \
comment='$TAG_COMMENT' kernel_opts='$KERNEL_OPTIONS'
For example:
maas admin tags create name='nomodeset_tag' \
comment='nomodeset_kernel_option' kernel_opts='nomodeset vga'
This command yields the following results:
Success.
Machine-readable output follows:
{
"name": "nomodeset_tag",
"definition": "",
"comment": "nomodeset_kernel_option",
"kernel_opts": "nomodeset vga",
"resource_uri": "/MAAS/api/2.0/tags/nomodeset_tag/"
}
You can check your work with a modified form of the listing command:
maas admin tags read | jq -r \
'(["tag_name","tag_comment","kernel_options"]
|(.,map(length*"-"))),(.[]|[.name,.comment,.kernel_opts])
| @tsv' | column -t
This should give you results something like this:
tag_name tag_comment kernel_options
-------- ----------- --------------
virtual
new_tag a-new-tag-for-test-purposes
pod-console-logging console=tty1 console=ttyS0
nomodeset_tag nomodeset_kernel_option nomodeset vga
Delete a tag
With the CLI, you can delete a tag with the following command:
maas $PROFILE tag delete $TAG_NAME
For example, depending upon your system configuration, you might type a command similar to this one:
maas admin tag delete zorko
When the command is successful, you should see output similar to this:
Success.
Machine-readable output follows:
Note that there is no actual “Machine-readable output” produced by this command, in most cases. Also note that remove a tag removes it from any nodes where you may have assigned it, but does not affect those nodes in any other way.
You can check your work by listing all the tags on this MAAS.
Update a tag
You can update a tag (e.g., a tag comment) like this:
maas $PROFILE tag update $TAG_NAME comment='$TAG_COMMENT'
For example:
maas admin tag update new_tag comment="a-new-tag-for-test-purposes"
This should return an output similar to this one:
Success.
Machine-readable output follows:
{
"name": "new_tag",
"definition": "",
"comment": "a-new-tag-for-test-purposes",
"kernel_opts": "",
"resource_uri": "/MAAS/api/2.0/tags/new_tag/"
}
You can always verify by listing all the tags on this MAAS.
List all tags available on this MAAS
You can list all tags that currently exist in this MAAS with a command of the form:
maas $PROFILE tags read | jq -r '(["tag_name","tag_comment"]|(.,map(length*"-"))),(.[]|[.name,.comment]) | @tsv' | column -t
For example:
maas admin tags read | jq -r '(["tag_name","tag_comment"]|(.,map(length*"-"))),(.[]|[.name,.comment]) | @tsv' | column -t
Your output might look like this:
tag_name tag_comment
-------- -----------
virtual
new_tag a-new-tag-for-test-purposes
Rebuild a tag
If you need to update tags for all machines – without having to recommission them – you can accomplish this with the rebuild command:
maas $PROFILE tag rebuild $TAG
This command automatically applies the tag to all machines regardless of state, even machines that are actively deployed. For example:
maas admin tag rebuild virtual
This command would produce output similar to the following:
Success.
Machine-readable output follows:
{
"rebuilding": "virtual"
}
Work with machine tags
This subsection will explain how to:
- Assign machine tags to a machine
- Remove machine tags from a machine
- List machine tags for all machines
- View machine tags for one machine
Assign machine tags to a machine
You can assign tags to a physical or virtual machine with the following command:
maas $PROFILE tag update-nodes $TAG_NAME add=$SYSTEM_ID
For example:
maas admin tag update-nodes new_tag add=g6arwg
This returns something like the following:
Success.
Machine-readable output follows:
{
"added": 1,
"removed": 0
}
You can check your work by listing machine tags, like this:
maas admin machines read | jq -r \
'(["hostname","sysid","machine_tags"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.tag_names[]])
| @tsv' | column -t
This should yield output similar to the following:
hostname sysid machine_tags
-------- ----- ------------
divine-stork 8b3ypp pod-console-logging virtual
casual-prawn 4end6r pod-console-logging virtual
driven-teal tgaat6 pod-console-logging virtual
immune-beetle 43xand pod-console-logging virtual
good-osprey napfxk pod-console-logging virtual
smart-hen c4rwq7 pod-console-logging virtual
boss-satyr xn8taa pod-console-logging androko
golden-martin 8fxery pod-console-logging virtual
crack-guinea qk4b3g pod-console-logging virtual
finer-leech cy3dtr pod-console-logging virtual
free-mouse gxtbq4 pod-console-logging virtual
humble-bunny srqnnb pod-console-logging virtual
wanted-muskox ekw7fh pod-console-logging virtual
one-boa by477d pod-console-logging virtual
great-urchin srnx4g pod-console-logging virtual
ace-frog g6arwg pod-console-logging virtual barbar farquar new_tag
alive-marlin gbwnfb pod-console-logging virtual
picked-parrot am77wn pod-console-logging virtual
tough-kit ke3wc7 pod-console-logging virtual
legal-whale 8nq3mt pod-console-logging virtual
game-sponge 76pdc6 pod-console-logging virtual
fun-ghoul qxfm7k pod-console-logging virtual
aware-earwig 8m8hs7 pod-console-logging virtual
chief-crane 7fapx7 pod-console-logging virtual
select-tapir 4ascbr pod-console-logging virtual
on-slug snfs8d pod-console-logging virtual
polite-llama dbqd4m pod-console-logging virtual
frank-coyote wcmk48 pod-console-logging virtual
usable-condor ed8hmy pod-console-logging virtual
still-imp h6ra6d pod-console-logging virtual
Remove machine tags from a machine
You can remove a tag from a physical or virtual machine with this command:
maas $PROFILE tag update-nodes $TAG_NAME remove=$SYSTEM_ID
For example:
maas admin tag update-nodes new_tag remove=g6arwg
This would produce output similar to the following:
Success.
Machine-readable output follows:
{
"added": 0,
"removed": 1
}
A quick check to verify results should yield something like this:
hostname sysid machine_tags
-------- ----- ------------
ace-frog g6arwg pod-console-logging virtual barbar farquar
Adding and removing machine tags simultaneously from multiple machines
You can simultaneously add and remove tags from multiple machines, as long as you are only modifying one tag, with a command like this one:
maas $PROFILE tag update-nodes $TAG_NAME add=$SYSTEM_ID1 add=$SYSTEM_ID2 remove=$SYSTEM_ID3
For example, to remove the tag “barbar” from machine “g6arwg,” but add it to machines “8fxery” and “by477d,” you could use a command like this:
maas admin tag update-nodes barbar add=8fxery add=by477d remove=g6arwg
This compound operation would yield a response similar to this:
Success.
Machine-readable output follows:
{
"added": 2,
"removed": 1
}
Again, verifying by checking the list of machine tags, we enter a command like this:
maas admin machines read | jq -r \
'(["hostname","sysid","machine_tags"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.tag_names[]])
| @tsv' | column -t
The resulting response looks something like this:
hostname sysid machine_tags
-------- ----- ------------
divine-stork 8b3ypp pod-console-logging virtual
casual-prawn 4end6r pod-console-logging virtual
driven-teal tgaat6 pod-console-logging virtual
immune-beetle 43xand pod-console-logging virtual
good-osprey napfxk pod-console-logging virtual
smart-hen c4rwq7 pod-console-logging virtual
boss-satyr xn8taa pod-console-logging androko
golden-martin 8fxery pod-console-logging virtual barbar
crack-guinea qk4b3g pod-console-logging virtual
finer-leech cy3dtr pod-console-logging virtual
free-mouse gxtbq4 pod-console-logging virtual
humble-bunny srqnnb pod-console-logging virtual
wanted-muskox ekw7fh pod-console-logging virtual
one-boa by477d pod-console-logging virtual barbar
great-urchin srnx4g pod-console-logging virtual
ace-frog g6arwg pod-console-logging virtual farquar
alive-marlin gbwnfb pod-console-logging virtual
picked-parrot am77wn pod-console-logging virtual
tough-kit ke3wc7 pod-console-logging virtual
legal-whale 8nq3mt pod-console-logging virtual
game-sponge 76pdc6 pod-console-logging virtual
fun-ghoul qxfm7k pod-console-logging virtual
aware-earwig 8m8hs7 pod-console-logging virtual
chief-crane 7fapx7 pod-console-logging virtual
select-tapir 4ascbr pod-console-logging virtual
on-slug snfs8d pod-console-logging virtual
polite-llama dbqd4m pod-console-logging virtual
frank-coyote wcmk48 pod-console-logging virtual
usable-condor ed8hmy pod-console-logging virtual
still-imp h6ra6d pod-console-logging virtual
List machine tags for all machines
To list machine tags for all physical and virtual machines, just enter a command similar to this one:
maas $PROFILE machines read | jq -r '(["hostname","sysid","machine_tags"]|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.tag_names[]]) | @tsv' | column -t
For example:
maas admin machines read | jq -r \
'(["hostname","sysid","machine_tags"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.tag_names[]])
| @tsv' | column -t
This gives us a listing similar to this:
hostname sysid machine_tags
-------- ----- ------------
divine-stork 8b3ypp pod-console-logging virtual
casual-prawn 4end6r pod-console-logging virtual
driven-teal tgaat6 pod-console-logging virtual
immune-beetle 43xand pod-console-logging virtual
good-osprey napfxk pod-console-logging virtual
smart-hen c4rwq7 pod-console-logging virtual
boss-satyr xn8taa pod-console-logging androko
golden-martin 8fxery pod-console-logging virtual barbar
crack-guinea qk4b3g pod-console-logging virtual
finer-leech cy3dtr pod-console-logging virtual
free-mouse gxtbq4 pod-console-logging virtual
humble-bunny srqnnb pod-console-logging virtual
wanted-muskox ekw7fh pod-console-logging virtual
one-boa by477d pod-console-logging virtual barbar
great-urchin srnx4g pod-console-logging virtual
ace-frog g6arwg pod-console-logging virtual farquar
alive-marlin gbwnfb pod-console-logging virtual
picked-parrot am77wn pod-console-logging virtual
tough-kit ke3wc7 pod-console-logging virtual
legal-whale 8nq3mt pod-console-logging virtual
game-sponge 76pdc6 pod-console-logging virtual
fun-ghoul qxfm7k pod-console-logging virtual
aware-earwig 8m8hs7 pod-console-logging virtual
chief-crane 7fapx7 pod-console-logging virtual
select-tapir 4ascbr pod-console-logging virtual
on-slug snfs8d pod-console-logging virtual
polite-llama dbqd4m pod-console-logging virtual
frank-coyote wcmk48 pod-console-logging virtual
usable-condor ed8hmy pod-console-logging virtual
still-imp h6ra6d pod-console-logging virtual
View machine tags for one machine
To view tags for one physical or machine, you can enter a command like this:
maas $PROFILE machine read $SYSTEM_ID | jq -r '(["hostname","sysid","machine_tags"]|(.,map(length*"-"))),([.hostname,.system_id,.tag_names[]]) | @tsv' | column -t
For example:
maas admin machine read 8fxery | jq -r \
'(["hostname","sysid","machine_tags"]
|(.,map(length*"-"))),([.hostname,.system_id,.tag_names[]])
| @tsv' | column -t
Typical output from this command might look like this:
hostname sysid machine_tags
-------- ----- ------------
golden-martin 8fxery pod-console-logging virtual barbar
Work with virtual machine host tags
This subsection will show you how to:
- Discover your virtual machine host ID
- Assign tags to a virtual machine host
- Remove tags from a virtual machine
- List tags for all virtual machines
- View tags for one virtual machine
Discover your virtual machine host ID
If you don’t know your VM host ID, you can discover it with this command:
maas $PROFILE vmhosts read \
| jq -r '(["vm_host_name","id"]
|(.,map(length*"-"))),(.[]|[.name,.id])
| @tsv' | column -t
For example:
maas admin vmhosts read \
| jq -r '(["vm_host_name","id"]
|(.,map(length*"-"))),(.[]|[.name,.id])
| @tsv' | column -t
This should produce output similar to the following:
vm_host_name id
------------ --
my-lxd-vm-host-1 1
Assign tags to a virtual machine host
To assign a tag to a virtual machine host, enter the following command:
maas $PROFILE vmhost add-tag $VMHOST_ID tag=$TAG_NAME
If you don’t know the ID of your VM host, you can look it up beforehand.
As an example of assigning a tag to a VM host:
maas admin vmhost add-tag 1 tag=virtual
If it worked, this should return Success
, followed by the JSON that describes the VM host. You can check your work by listing all VM host tags.
Remove tags from a virtual machine host
To remove a tag from a virtual machine host, enter the following command:
maas $PROFILE vmhost remove-tag $VMHOST_ID tag=$TAG_NAME
If you don’t know the ID of your VM host, you can look it up beforehand.
As an example of removing a tag from a VM host:
maas admin vmhost remove-tag 1 tag=virtual
If it worked, this should return Success
, followed by the JSON that describes the VM host. You can check your work by listing all VM host tags.
List tags for all virtual machine hosts
You can list tags for all VM hosts with the following command:
maas $PROFILE vmhosts read | jq -r '(["vm_host_name","id","tags"]|(.,map(length*"-"))),(.[]|[.name,.id,.tags[]]) | @tsv' | column -t
For example:
maas admin vmhosts read | jq -r '(["vm_host_name","id","tags"]|(.,map(length*"-"))),(.[]|[.name,.id,.tags[]]) | @tsv' | column -t
This should yield output similar to the following:
vm_host_name id tags
------------ -- ----
my-lxd-vm-host-1 1 morkopongo pod-console-logging virtual
View tags for one virtual machine host
If you want to list the tags for just one VM host, you can use a command like this one:
maas $PROFILE vmhost read $VMHOST_ID \
| jq -r '(["name","id","tags"]
|(.,map(length*"-"))),([.name,.id,.tags[]])
| @tsv' | column -t
If you don’t know the ID of your VM host, you can look it up beforehand.
As an example of viewing tags for one VM host:
maas admin vmhost read 1 | jq -r '("name","id","tags"]|(.,map(length*"-"))),([.name,.id,.tags[]]) | @tsv' @ column -t
Typical output might look something like this:
name id tags
---- -- ----
my-lxd-vm-host-1 1 morkopongo pod-console-logging
Work with region controller tags
This subsection will show you how to:
- Discover the ID of your region controller(s)
- Assign tags to a region controller
- Remove tags from a region controller
- List tags for all region controllers
- View tags for one region controller
Discover the ID of your region controller(s)
You can discover the ID of your region controller(s) with the following command:
maas $PROFILE region-controllers read \
| jq -r '(["name","id"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id])
| @tsv' | column -t
For example:
maas admin region-controllers read \
| jq -r '(["name","id"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id])
| @tsv' | column -t
Typical output would look something like this:
name id
---- --
bill-Lenovo-Yoga-C740-15IML 86xya8
Assign tags to a region controller
To add tags to a region controller, you can use a command of this form:
maas $PROFILE tag update-nodes $TAG_NAME add=$SYSTEM_ID
If you need to find the ID of your region controller(s), you can look it up.
For example:
maas admin tag update-nodes virtual add=86xya8
This command produces output similar to the following:
Success.
Machine-readable output follows:
{
"added": 1,
"removed": 0
}
You can check your work by listing all tags for your region controllers.
Remove tags from a region controller
To remove tags from a region controller, you can use a command like this:
maas $PROFILE tag update-nodes $TAG_NAME remove=$SYSTEM_ID
If you need to find the ID of your region controller(s), you can look it up.
For example:
maas admin tag update-nodes virtual remove=86xya8
This command produces output similar to the following:
Success.
Machine-readable output follows:
{
"added": 0,
"removed": 1
}
You can check your work by listing all tags for your region controllers.
List tags for all region controllers
To list tags for all region controllers, you can use a command similar to this:
maas $PROFILE region-controllers read | jq -r '(["hostname","sysid","tags"]|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.tag_names[]]) | @tsv' | column -t
For example:
maas admin region-controllers read | jq -r '(["hostname","sysid","tags"]|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.tag_names[]]) | @tsv' | column -t
This will produce output something like this:
hostname sysid tags
-------- ----- ----
bill-Lenovo-Yoga-C740-15IML 86xya8 virtual lxd-vm-host
View tags for one region controller
To view tags for a specific region controller, you can try a command like this:
maas $PROFILE region-controller read $SYSTEM_ID | jq -r '(["hostname","sysid","tags"]|(.,map(length*"-"))),([.hostname,.system_id,.tag_names[]]) | @tsv' | column -t
'''
If you need to find the ID of your region controller(s), you can [look it up](#heading--discover-the-id-of-your-region-controllers).
For example:
```bash
maas admin region-controller read 86xya8 \
| jq -r '(["hostname","sysid","tags"]
|(.,map(length*"-"))),([.hostname,.system_id,.tag_names[]])
| @tsv' | column -t
This should produce output similar to the following:
hostname sysid tags
-------- ----- ----
bill-Lenovo-Yoga-C740-15IML 86xya8 virtual lxd-vm-host
Work with rack controller tags
This subsection will show you how to:
- Discover the ID of your rack controller(s)
- Assign tags to a rack controller
- Remove tags from a rack controller
- List tags for all rack controllers
- View tags for one rack controller
Discover the ID of your rack controller(s)
You can discover the ID of your rack controller(s) with the following command:
maas $PROFILE rack-controllers read \
| jq -r '(["name","id"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id])
| @tsv' | column -t
For example:
maas admin rack-controllers read \
| jq -r '(["name","id"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id])
| @tsv' | column -t
Typical output would look something like this:
name id
---- --
bill-Lenovo-Yoga-C740-15IML 86xya8
Assign tags to a rack controller
To add tags to a rack controller, you can use a command of this form:
maas $PROFILE tag update-nodes $TAG_NAME add=$SYSTEM_ID
If you need to find the ID of your rack controller(s), you can look it up.
For example:
maas admin tag update-nodes virtual add=86xya8
This command produces output similar to the following:
Success.
Machine-readable output follows:
{
"added": 1,
"removed": 0
}
You can check your work by listing all tags for your rack controllers.
Remove tags from a rack controller
To remove tags from a rack controller, you can use a command like this:
maas $PROFILE tag update-nodes $TAG_NAME remove=$SYSTEM_ID
If you need to find the ID of your rack controller(s), you can look it up.
For example:
maas admin tag update-nodes virtual remove=86xya8
This command produces output similar to the following:
Success.
Machine-readable output follows:
{
"added": 0,
"removed": 1
}
You can check your work by listing all tags for your rack controllers.
List tags for all rack controllers
To list tags for all rack controllers, you can use a command similar to this:
maas $PROFILE rack-controllers read | jq -r '(["hostname","sysid","tags"]|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.tag_names[]]) | @tsv' | column -t
For example:
maas admin rack-controllers read | jq -r '(["hostname","sysid","tags"]|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.tag_names[]]) | @tsv' | column -t
This will produce output something like this:
hostname sysid tags
-------- ----- ----
bill-Lenovo-Yoga-C740-15IML 86xya8 virtual lxd-vm-host
View tags for one rack controller
To view tags for a specific rack controller, you can try a command like this:
maas $PROFILE rack-controller read $SYSTEM_ID | jq -r '(["hostname","sysid","tags"]|(.,map(length*"-"))),([.hostname,.system_id,.tag_names[]]) | @tsv' | column -t
'''
If you need to find the ID of your rack controller(s), you can [look it up](#heading--discover-the-id-of-your-rack-controllers).
For example:
```bash
maas admin rack-controller read 86xya8 \
| jq -r '(["hostname","sysid","tags"]
|(.,map(length*"-"))),([.hostname,.system_id,.tag_names[]])
| @tsv' | column -t
This should produce output similar to the following:
hostname sysid tags
-------- ----- ----
bill-Lenovo-Yoga-C740-15IML 86xya8 virtual lxd-vm-host
Work with block device tags
This subsection will show you how to:
- Discover the ID of your block device
- Assign tags to a block device
- Remove tags from a block device
- List tags for all block devices
- View tags for one block device
Discover the ID of your block device
Block devices do not exist apart from the physical or virtual machines to which they are attached. Finding the ID of the block device that interests you requires starting with a particular machine, in a command form that looks like this:
maas $PROFILE block-devices read $SYSTEM_ID \
| jq -r '(["system_id","block_device_id","path","avail_size"]
|(.,map(length*"-"))),(.[]|[.system_id,.id,.path,.available_size])
| @tsv' | column -t
For example:
maas admin block-devices read qk4b3g \
| jq -r '(["system_id","block_device_id","path","avail_size"]
|(.,map(length*"-"))),(.[]|[.system_id,.id,.path,.available_size])
| @tsv' | column -t
This example would produce output that looks something like this:
system_id block_device_id path avail_size
--------- --------------- ---- ----------
qk4b3g 10 /dev/disk/by-dname/sda 0
The path
component is printed to help you confirm that you are choosing the right block device, when there are several present. The avail-size
column will tell you whether you can operate on that block device at all: If the available size is “0,” for example, you can’t set a block device tag on any part of that drive. Instead, you’d want to see something like this:
system_id block_device_id path avail_size
--------- --------------- ---- ----------
xn8taa 8 /dev/disk/by-dname/sda 1996488704
Assign tags to a block device
You can only assign tags to a block device that is available. You can find out whether the block device is available at all when you discover its ID.
To assign an existing tag to a block device, you would type a command formulated like this:
maas $PROFILE block-device add-tag $SYSTEM_ID $BLOCK_DEVICE_ID tag=$TAG_NAME
If you’re not sure about the ID of your block device, you can look it up.
For example:
maas admin block-device add-tag xn8taa 8 tag=farquar
If this command succeeds, it will display Success
, followed by a JSON sequence describing the new state of the block device.
Note that if you try to add a tag to a block device that is not available, that is, to a block device that is in use, you will get a result like this:
Not Found
Remove tags from a block device
You can only remove tags from a block device that is available. You can find out whether the block device is available at all when you discover its ID.
To remove an assigned tag from a block device, you would type a command formulated like this:
maas $PROFILE block-device remove-tag $SYSTEM_ID $BLOCK_DEVICE_ID tag=$TAG_NAME
If you’re not sure about the ID of your block device, you can look it up.
For example:
maas admin block-device remove-tag xn8taa 8 tag=farquar
If this command succeeds, it will display Success
, followed by a JSON sequence describing the new state of the block device.
Note that if you try to remove a tag from a block device that is not available, that is, to a block device that is in use, you will get a result like this:
Not Found
List tags for all block devices
To list tags for all block devices associated with a physical or virtual machine, you can use a command of this form:
maas $PROFILE block-devices read $SYSTEM_ID | jq -r '(["id","tags"]|(.,map(length*"-"))),(.[]|[.id,.tags[]]) | @tsv' | column -t
For example:
maas admin block-devices read xn8taa | jq -r '(["id","tags"]|(.,map(length*"-"))),(.[]|[.id,.tags[]]) | @tsv' | column -t
This command would produce output similar to this:
id tags
-- ----
8 hello ssd trinkoplinko
View tags for one block device
To view tags for one specific block device, you can enter a command like this:
maas $PROFILE block-device read $SYSTEM_ID $BLOCK_DEVICE_ID | jq -r '(["id","tags"]|(.,map(length*"-"))),([.id,.tags[]]) | @tsv' | column -t
If you’re not sure about the ID of your block device, you can look it up.
For example:
maas admin block-device read xn8taa 8 | jq -r '(["id","tags"]|(.,map(length*"-"))),([.id,.tags[]]) | @tsv' | column -t
This command would produce output similar to this:
id tags
-- ----
8 hello ssd trinkoplinko
9 20gig ssd
10 250Gs ssd
Work with partition tags
This subsection will show you how to:
- Discover the ID of your partition
- Assign tags to a partition
- Remove tags from a partition
- List tags for all partitions
- View tags for one partition
Discover the ID of your partition
Partitions do not exist apart from the block devices on which they reside. Finding the ID of the partition that interests you requires starting with a particular machine and block device, similar to this command:
maas $PROFILE partitions read $SYSTEM_ID $BLOCK_DEVICE_ID \
| jq -r '(["system_id","block_dev_id","part_id","path"]
|(.,map(length*"-"))),(.[]|[.system_id,.device_id,.id,.path])
|@tsv' | column -t
For example:
maas admin partitions read xn8taa 8 \
| jq -r '(["system_id","block_dev_id","part_id","path"]
|(.,map(length*"-"))),(.[]|[.system_id,.device_id,.id,.path])
|@tsv' | column -t
This example would produce output that looks something like this:
system_id block_dev_id part_id path
--------- ------------ ------- ----
xn8taa 8 67 /dev/disk/by-dname/sda-part1
The path
component is printed to help you confirm that you are choosing the right partition, when there are several present.
Assign tags to a partition
You can only assign tags to a partition that is available. To assign an existing tag to a partition, you would type a command formulated like this:
maas $PROFILE partition add-tag $SYSTEM_ID $BLOCK_DEVICE_ID $PARTITION_ID tag=$TAG_NAME
If you’re not sure about the ID of your partition, you can look it up.
For example:
maas admin partition add-tag xn8taa 8 67 tag=farquar
If this command succeeds, it will display Success
, followed by a JSON sequence describing the new state of the partition.
Note that if you try to add a tag to a partition that is not available, that is, to a partition that is in use, you will get a result like this:
Not Found
Remove tags from a partition
You can only remove tags from a partition that is available. To remove a existing tag from a partition, you would type a command formulated like this:
maas $PROFILE partition remove-tag $SYSTEM_ID $BLOCK_DEVICE_ID $PARTITION_ID tag=$TAG_NAME
If you’re not sure about the ID of your partition, you can look it up.
For example:
maas admin partition remove-tag xn8taa 8 67 tag=farquar
If this command succeeds, it will display Success
, followed by a JSON sequence describing the new state of the partition.
Note that if you try to remove a tag from a partition that is not available, that is, to a partition that is in use, you will get a result like this:
Not Found
On the other hand, if you try to remove a tag that is not assigned to the partition you’ve chosen, MAAS will simply return Success
, followed by a JSON sequence describing the current state of the partition.
List tags for all partitions
To list tags for all partitions of a particular block device, use a command like this one:
maas $PROFILE partitions read $SYSTEM_ID $BLOCK_DEVICE_ID \
| jq -r '(["id","tags"]
|(.,map(length*"-"))),(.[]|[.id,.tags[]])
| @tsv' | column -t
For example:
maas admin partitions read xn8taa 8 \
| jq -r '(["id","tags"]
|(.,map(length*"-"))),(.[]|[.id,.tags[]])
| @tsv' | column -t
A command like this should return output similar to the following:
id tags
-- ----
54 farquar swap opendisk
67 foobar farquar
97 foobar
View tags for one partition
To view tags for one partition, enter a command similar to this:
maas $PROFILE partition read $SYSTEM_ID $BLOCK_DEVICE_ID $PARTITION_ID | jq -r '(["id","tags"]|(.,map(length*"-"))),([.id,.tags[]]) | @tsv' | column -t
If you’re not sure about the ID of your partition, you can look it up.
For example:
maas admin partition read xn8taa 8 67 | jq -r '(["id","tags"]|(.,map(length*"-"))),([.id,.tags[]]) | @tsv' | column -t
This command should produce output similar to this:
id tags
-- ----
67 foobar farquar
Work with network tags
This subsection will show you how to:
- Discover the ID of your network interface
- Assign tags to a network interface
- Remove tags from a network interface
- List tags for all network interfaces
- View tags for one network interface
Discover the ID of your network interface
You can use a command of the following form to identify the interfaces associated with a particular device on your MAAS:
maas $PROFILE interfaces read $SYSTEM_ID \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),(.[]|[.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
For example:
maas admin interfaces read xn8taa \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),(.[]|[.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
This would produce output similar to the following:
mac_address type id tags
----------- ---- -- ----
00:16:3e:18:7f:ee physical 9 andrpko plinko cochise
Assign tags to a network interface
To assign a tag to a network interface, using both the device system ID and the interface ID, use a command of the following form:
maas $PROFILE interface add-tag $SYSTEM_ID $INTERFACE_ID tag=$TAG_NAME
For example:
maas admin interface add-tag xn8taa 9 tag=farquar
This command, if successful, will produce a long sequence of JSON describing the interface, including the changes introduced by the command above. You can also check your work by listing the tags associated with the device.
Remove tags from a network interface
To remove a tag from a network interface, use both the device system ID and the interface ID in a command similar to this one:
maas $PROFILE interface remove-tag $SYSTEM_ID $INTERFACE_ID tag=$TAG_NAME
For example:
maas admin interface remove-tag xn8taa 9 tag=farquar
This command, if successful, will produce a long sequence of JSON describing the interface, including the changes introduced by the command above. You can also check your work by listing the tags associated with the device.
List tags for all network interfaces
To list all the tags for a given network interface on a given device, use a command like this one:
maas $PROFILE interfaces read $SYSTEM_ID \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),(.[]|[.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
For example:
maas admin interfaces read xn8taa \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),(.[]|[.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
This would produce output similar to the following:
mac_address type id tags
----------- ---- -- ----
00:16:3e:18:7f:ee physical 9 andrpko plinko cochise farquar
View tags for one network interface
To view tags for one particular network interface on a specific device, try a command formulated like this:
maas $PROFILE interface read $SYSTEM_ID $INTERFACE_ID \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),([.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
For example:
maas admin interface read xn8taa 9 \
| jq -r '(["mac_address","type","id","tags"]
|(.,map(length*"-"))),([.mac_address,.type,.id,.tags[]])
|@tsv'| column -t
Typical output might look like this:
mac_address type id tags
----------- ---- -- ----
00:16:3e:18:7f:ee physical 9 andrpko plinko cochise
Work with device tags
This subsection will show you how to:
- Identify your devices
- Assign tags to a device
- Remove tags from a device
- List tags for all devices
- View tags for one device
Identify your devices
You can use a command similar to the following to identify your devices:
maas $PROFILE devices read \
| jq -r '(["hostname","system_id"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id])
|@tsv' | column -t
For example:
maas admin devices read \
| jq -r '(["hostname","system_id"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id])
|@tsv' | column -t
This command produces a result similar to the following:
hostname system_id
-------- ---------
better-sole t8pmrs
light-aphid 76b6tt
Assign tags to a device
To assign tags to a device, you can use a command of the following form:
maas $PROFILE tag update-nodes $TAG_NAME add=$SYSTEM_ID
For example:
maas admin tag update-nodes farquar add=t8pmrs
A successful command like this might produce output similar to this:
Success.
Machine-readable output follows:
{
"added": 1,
"removed": 0
}
You can also check your work by listing tags for all devices.
Remove tags from a device
To remove tags from a device, you can use a command of the following form:
maas $PROFILE tag update-nodes $TAG_NAME remove=$SYSTEM_ID
For example:
maas admin tag update-nodes farquar remove=t8pmrs
A successful command like this might produce output similar to this:
Success.
Machine-readable output follows:
{
"added": 0,
"removed": 1
}
You can also check your work by listing tags for all devices.
List tags for all devices
If you want to list tags for all devices, you could use a command similar to this one:
maas $PROFILE devices read \
| jq -r '(["hostname","system_id","tags"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.tag_names[]])
|@tsv' | column -t
For example:
maas admin devices read \
| jq -r '(["hostname","system_id","tags"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.tag_names[]])
|@tsv' | column -t
Such a command would produce output that looks something like this:
hostname system_id tags
-------- --------- ----
better-sole t8pmrs farquar
light-aphid 76b6tt
View tags for one device
You can view the tags for a single device with the command:
maas $PROFILE device read $SYSTEM_ID \
| jq -r '(["hostname","system_id","tags"]
|(.,map(length*"-"))),([.hostname,.system_id,.tag_names[]])
|@tsv' | column -t
If you need to know the system ID of your device, you can look it up.
Note that this command differs in that (1) it uses the singular “device” instead of “devices;” (2) it gives the system ID of a specific device; and (3) it uses the single-record form of the jq
tag list ("([.hostname,.system_id,.tag_names[]]", rather than “(.[]|[.hostname…”).
For example:
maas admin device read t8pmrs \
| jq -r '(["hostname","system_id","tags"]
|(.,map(length*"-"))),([.hostname,.system_id,.tag_names[]])
|@tsv' | column -t
Sample output might look like this:
hostname system_id tags
-------- --------- ----
better-sole t8pmrs farquar
Work with node tags
- Identify your nodes
- Assign tags to a node
- Remove tags from a node
- List tags for all nodes
- View tags for one node
Identify your nodes
If you need to identify the system ID of your nodes, you can do so with a command like this one:
maas $PROFILE nodes read \
| jq -r '(["hostname","system_id"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id])
|@tsv'|column -t
For example:
When listing nodes, you should expect a large output, similar to this or larger:
hostname system_id
-------- ---------
better-sole t8pmrs
light-aphid 76b6tt
divine-stork 8b3ypp
casual-prawn 4end6r
driven-teal tgaat6
immune-beetle 43xand
good-osprey napfxk
smart-hen c4rwq7
boss-satyr xn8taa
golden-martin 8fxery
crack-guinea qk4b3g
finer-leech cy3dtr
free-mouse gxtbq4
humble-bunny srqnnb
wanted-muskox ekw7fh
one-boa by477d
great-urchin srnx4g
ace-frog g6arwg
alive-marlin gbwnfb
picked-parrot am77wn
tough-kit ke3wc7
legal-whale 8nq3mt
game-sponge 76pdc6
fun-ghoul qxfm7k
aware-earwig 8m8hs7
chief-crane 7fapx7
select-tapir 4ascbr
on-slug snfs8d
polite-llama dbqd4m
frank-coyote wcmk48
usable-condor ed8hmy
still-imp h6ra6d
bill-Lenovo-Yoga-C740-15IML 86xya8
A node listing will show all the machines, controllers, and devices in the system.
Assign tags to a node
To assign tags to any node (regardless of its type), you can use a command of this form:
‘’‘bash
maas $PROFILE tag update-nodes $TAG_NAME add=$SYSTEM_ID
‘’’
For example,
maas $PROFILE tag update-nodes $TAG_NAME add=$SYSTEM_ID
For example:
maas admin tag update-nodes farquar add=t8pmrs
A successful command like this might produce output similar to this:
Success.
Machine-readable output follows:
{
"added": 1,
"removed": 0
}
You can also check your work by listing tags for all devices.
Remove tags from a node
To remove tags from a node, regardless of type, you can use a command like this one:
maas $PROFILE tag update-nodes $TAG_NAME remove=$SYSTEM_ID
For example:
maas admin tag update-nodes farquar remove=t8pmrs
A successful command like this might produce output similar to this:
Success.
Machine-readable output follows:
{
"added": 0,
"removed": 1
}
You can also check your work by listing tags for all devices.
List tags for all nodes
If you want to list tags for all nodes, you could use a command similar to this one:
maas $PROFILE nodes read \
| jq -r '(["hostname","system_id","tags"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.tag_names[]])
|@tsv' | column -t
For example:
maas admin nodes read \
| jq -r '(["hostname","system_id","tags"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.tag_names[]])
|@tsv' | column -t
Such a command would produce output that looks something like this:
hostname system_id tags
-------- --------- ----
better-sole t8pmrs farquar
light-aphid 76b6tt
divine-stork 8b3ypp pod-console-logging virtual
casual-prawn 4end6r pod-console-logging virtual
driven-teal tgaat6 pod-console-logging virtual
immune-beetle 43xand pod-console-logging virtual
good-osprey napfxk pod-console-logging virtual
smart-hen c4rwq7 pod-console-logging virtual
boss-satyr xn8taa pod-console-logging androko
golden-martin 8fxery pod-console-logging virtual
crack-guinea qk4b3g pod-console-logging virtual
finer-leech cy3dtr pod-console-logging virtual
free-mouse gxtbq4 pod-console-logging virtual
humble-bunny srqnnb pod-console-logging virtual
wanted-muskox ekw7fh pod-console-logging virtual
one-boa by477d pod-console-logging virtual
great-urchin srnx4g pod-console-logging virtual
ace-frog g6arwg pod-console-logging virtual farquar
alive-marlin gbwnfb pod-console-logging virtual
picked-parrot am77wn pod-console-logging virtual
tough-kit ke3wc7 pod-console-logging virtual
legal-whale 8nq3mt pod-console-logging virtual
game-sponge 76pdc6 pod-console-logging virtual
fun-ghoul qxfm7k pod-console-logging virtual
aware-earwig 8m8hs7 pod-console-logging virtual
chief-crane 7fapx7 pod-console-logging virtual
select-tapir 4ascbr pod-console-logging virtual
on-slug snfs8d pod-console-logging virtual
polite-llama dbqd4m pod-console-logging virtual
frank-coyote wcmk48 pod-console-logging virtual
usable-condor ed8hmy pod-console-logging virtual
still-imp h6ra6d pod-console-logging virtual
bill-Lenovo-Yoga-C740-15IML 86xya8 lxd-vm-host
View tags for one node
You could use a command with a form like this to view the tags for one node:
maas $PROFILE node read $SYSTEM_ID \
| jq -r '(["hostname","system_id","tags"]
|(.,map(length*"-"))),([.hostname,.system_id,.tag_names[]])
|@tsv' | column -t
For example:
maas admin node read xn8taa \
| jq -r '(["hostname","system_id","tags"]
|(.,map(length*"-"))),([.hostname,.system_id,.tag_names[]])
|@tsv' | column -t
This command produces output that looks something like this:
hostname system_id tags
-------- --------- ----
boss-satyr xn8taa pod-console-logging androko
Work with annotations
This section will show you how to:
Work with static annotations
This subsection will show you how to:
- Identify your machines
- Set a static annotation for a machine
- Change or clear a static annotation for a machine
- List static annotations for all machines
- View a static annotation for one machine
Identify your machines
To identify your available machines, use a command like this one:
maas $PROFILE machines read \
| jq -r '(["hostname","system_id"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id])
|@tsv' | column -t
For example:
maas admin machines read \
| jq -r '(["hostname","system_id"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id])
|@tsv' | column -t
Typical output might look something like this:
hostname system_id
-------- ---------
divine-stork 8b3ypp
casual-prawn 4end6r
driven-teal tgaat6
immune-beetle 43xand
good-osprey napfxk
smart-hen c4rwq7
boss-satyr xn8taa
golden-martin 8fxery
crack-guinea qk4b3g
finer-leech cy3dtr
free-mouse gxtbq4
humble-bunny srqnnb
wanted-muskox ekw7fh
one-boa by477d
great-urchin srnx4g
ace-frog g6arwg
alive-marlin gbwnfb
picked-parrot am77wn
tough-kit ke3wc7
legal-whale 8nq3mt
game-sponge 76pdc6
fun-ghoul qxfm7k
aware-earwig 8m8hs7
chief-crane 7fapx7
select-tapir 4ascbr
on-slug snfs8d
polite-llama dbqd4m
frank-coyote wcmk48
usable-condor ed8hmy
still-imp h6ra6d
Set a static annotation for a machine
If you want to set the static annotation for a given machine, you can do so with a command that looks like this:
maas $PROFILE machine update $SYSTEM_ID description="$STATIC_ANNOTATION"
For example:
maas admin machine update ke3wc7 description="kilo-echo-3-whisky-charlie-7"
You can check your work by viewing the static annotations for one machine.
Change or clear a static annotation for a machine
If you want to set the static annotation for a given machine, use the same command you’d use to set a static annotation:
maas $PROFILE machine update $SYSTEM_ID description="$STATIC_ANNOTATION"
The existing annotation will be overwritten by the new one you enter. For example:
maas admin machine update ke3wc7 description=""
You can check your work by viewing the static annotations for one machine.
List static annotations for all machines
To list static annotations for all machines, enter a command similar to this one:
maas $PROFILE machines read \
| jq -r '(["hostname","system_id","description"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.description])
|@tsv' | column -t
For example:
maas admin machines read \
| jq -r '(["hostname","system_id","description"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.description])
|@tsv' | column -t
Output might look something like this:
hostname system_id description
-------- --------- -----------
driven-teal tgaat6 tango-golf
humble-bunny srqnnb sierra-romeo
tough-kit ke3wc7 kilo-echo
View a static annotation for one machine
To view a static annotation for one machine, try a command like this:
maas $PROFILE machine read $SYSTEM_ID \
| jq -r '(["hostname","system_id","description"]
|(.,map(length*"-"))),([.hostname,.system_id,.description])
|@tsv' | column -t
For example:
maas admin machine read tgaat6 \
| jq -r '(["hostname","system_id","description"]
|(.,map(length*"-"))),([.hostname,.system_id,.description])
|@tsv' | column -t
A command like this might produce output as follows:
hostname system_id description
-------- --------- -----------
driven-teal tgaat6 tango-golf
Work with dynamic (workload) annotations
This section will show you how to:
- Identify machines that can receive dynamic annotations
- Set dynamic annotations for a machine
- Clear and change dynamic annotations for a machine
- List dynamic annotations for all machines
- List dynamic allocations for one machine
Identify machines that can receive dynamic annotations
You can only set dynamic annotations for machines that are in the “Allocated” or “Deployed” state. To identify which of your machines are in these states, you can execute the following command:
maas $PROFILE machines read \
| jq -r '(["hostname","system_id","status"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.status_name])
|@tsv' | column -t
For example:
maas admin machines read \
| jq -r '(["hostname","system_id","status"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.status_name])
|@tsv' | column -t
Output should look something like this:
hostname system_id status
-------- --------- ------
divine-stork 8b3ypp Deployed
casual-prawn 4end6r Ready
driven-teal tgaat6 Allocated
immune-beetle 43xand Allocated
good-osprey napfxk Allocated
smart-hen c4rwq7 Allocated
boss-satyr xn8taa Ready
golden-martin 8fxery Allocated
crack-guinea qk4b3g Allocated
finer-leech cy3dtr Deployed
free-mouse gxtbq4 Allocated
humble-bunny srqnnb Allocated
wanted-muskox ekw7fh Deployed
one-boa by477d Allocated
great-urchin srnx4g Allocated
ace-frog g6arwg Ready
alive-marlin gbwnfb Deployed
picked-parrot am77wn Allocated
tough-kit ke3wc7 Deployed
legal-whale 8nq3mt Allocated
game-sponge 76pdc6 Allocated
fun-ghoul qxfm7k Allocated
aware-earwig 8m8hs7 Deployed
chief-crane 7fapx7 Ready
select-tapir 4ascbr Allocated
on-slug snfs8d Allocated
polite-llama dbqd4m Allocated
frank-coyote wcmk48 Allocated
usable-condor ed8hmy Deployed
still-imp h6ra6d Allocated
Set dynamic annotations for a machine
Dynamic annotations, otherwise known as “workload annotations” or “owner data,” can be used to keep track of the runtime status of machines that are acquired or deployed. These annotations are set using key=value
pairs. You can set any key=value
pair that you wish for any machine, although it’s probably more useful if you standardise your key names.
To set a dynamic annotation for a machine, you can enter a command like this:
maas $PROFILE machine set-owner-data $SYSTEM_ID $KEY=$VALUE
For example:
maas admin machine set-owner-data tgaat6 owner=gsmith@zorko.com
This command will return a JSON string representative of the machine’s new configuration, including the dynamic annotations you’ve added. You can check your work by listing the dynamic annotations for the one machine you just edited, or by listing dynamic annotations for all machines.
Clear and change dynamic annotations for a machine
You can change dynamic annotations for a machine simply by executing a new set-owner-data
command:
maas $PROFILE machine set-owner-data $SYSTEM_ID $KEY=$NEW_VALUE
You can clear a dynamic annotation by entering the empty string (""
) as the $VALUE:
maas $PROFILE machine set-owner-data $SYSTEM_ID $KEY=""
These commands will return a JSON string representative of the machine’s new configuration, including the dynamic annotations you’ve changed or cleared. You can check your work by listing the dynamic annotations for the one machine you just edited, or by listing dynamic annotations for all machines.
List dynamic annotations for all machines
You can list the current dynamic annotations for all machines with a command like this:
maas $PROFILE machines read \
| jq -r '(["hostname","system_id","owner_data"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.owner_data[]])
|@tsv' | column -t
For example:
maas admin machines read \
| jq -r '(["hostname","system_id","owner_data"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.owner_data[]])
|@tsv' | column -t
This command output might look something like this:
hostname system_id owner_data
-------- --------- ----------
divine-stork 8b3ypp
casual-prawn 4end6r
driven-teal tgaat6 farquar foobar
immune-beetle 43xand
good-osprey napfxk
smart-hen c4rwq7
List dynamic allocations for one machine
You can list the dynamic annotations for one machine by entering a command of the form:
maas $PROFILE machine read $SYSTEM_ID \
| jq -r '(["hostname","system_id","owner_data"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.owner_data[]])
|@tsv' | column -t
For example:
maas admin machine read tgaat6 \
| jq -r '(["hostname","system_id","owner_data"]
|(.,map(length*"-"))),(.[]|[.hostname,.system_id,.owner_data[]])
|@tsv' | column -t
This will produce output similar to the following:
hostname system_id owner_data
-------- --------- ----------
driven-teal tgaat6 farquar foobar