MAAS UI: Automatic tags and Tag management

Summary

This week we have been working on defining the scope to enhance our Tag management feature in the UI. MAAS tag is a powerful feature, especially, the automatic tags. This feature is already available in the CLI via our REST API and in the up coming release, our goal is to expose this feature in the UI.

What are automatic tags?

In short, automatic tags are tags with a definition. The capabilities of MAAS’ Tag are powerful because it can be used to categorise machines, acquire machines, and configure kernel parameters.

To create a tag via the CLI, the REST API needs:

//Tag parameter.
name:[string]
comment (optional): [string]
definition (optional):
// XPath Expresion (the rule to define which HW or characteristics of the machine to apply the name to.)
kernel_opts (optional): [string]

An example of automated tag usage can be described as the CLI input example below:

This tag will enable passthrough for Nvidia Tesla v100 PCIe series 16GB GPUs on Intel VT-d

maas $PROFILE tags create name=gpgpu-tesla-vi comment="Enable passthrough for Nvidia Tesla V series GPUs on Intel" \
definition='//node[@id="cpu:0"]/capabilities/capability/@id = "vmx" and 
//node[@id="display"]/vendor[contains(.,"NVIDIA")] and //node[@id="display"]/description[contains(.,"3D")] and //node[@id="display"]/product[contains(.,"Tesla V100 PCIe 16GB")]' \
kernel_opts="console=tty0 console=ttyS0,115200n8r nomodeset 
modprobe.blacklist=nouveau,nvidiafb,snd_hda_intel nouveau.blacklist=1 video=vesafb:off,efifb:off intel_iommu=on rd.driver.pre=pci-stub rd.driver.pre=vfio-pci pci-stub.ids=10de:1db4 vfio-pci.ids=10de:1db4 vfio_iommu_type1.allow_unsafe_interrupts=1 vfio-pci.disable_vga=1"


As such, creating this tag will auto-apply the tag gpgpu-tesla-vi to all machines that match the hardware definition and apply kernel parameters at deployment time.

How does this work in the UI?

At the moment we are drafting different scenarios to show how we can expose this experience.

Some example scenarios can be described as below:

How might we list all the tags?

This picture above is a rough wireframe of our initial idea.
Because automatic tags currently work with machines only, we will only focus on the machine story instead of all nodes. So a Tag tab will be added to the Machine listing page.

Inside the Tag Tab, you should be able to

  • see all the existing tags
  • distinguish between manual tags and automatic tags
  • how many machines are associated with that tag
  • the comment
  • all the kernel parameters
  • last updated date

By default tags are sorted alphabetically.

Actions:

  • A user can create a new tag (manual or automatic) from this page
  • edit the existing tag
  • delete the existing tag

Considerations:

  • ability to search for tags
  • ability to sort by last updated date

How might we create/assign/un-assign tags from the Machine listing page?

One of the biggest pain points in the UI is that people are able to tag multiple machines very easily, but when they need to un-assign the tag, they need to go into individual machines to untag them. We want to solve this problem in the UI as well, to make this feature more complete.

Let’s imagine that there are 4 machines selected in the Machine listing page

Machine Tag(s) Status
Machine 1 TagA, AutoTag Deployed
Machine 2 TagA, TagB, AutoTag Ready
Machine 3 TagC Ready
Machine 4 TagA, TagC Deployed

When you select Take action from the header menu the new Tag form should allow you to work like the image below:

The tag field should allow you to see all assigned tags.


You should be able to :

  • See the number of the selected machines associated with that tag.
  • The automatic tag is disabled because you cannot un-assign automatic tags manually.
  • You should be able to create a new tag with comments and add kernel options from this view.
  • If a new tag is created with kernel options a user will get a warning that the deploy machines needs to be redeployed to apply the new kernel options.

A similar experience should also be in the machine/configuration page.

How might we an automatic tag in the UI?

Since automated tags will auto-apply to machines that fit in with the definition, we think that it should live under the Tag listing page.
When you click Create new tag the form below will slide down.

This form has an extra field, definition, where you can add an XPath expression as a rule for tagging machines in your MAAS environment. When new machines are added to your environment and they match with this definition, it will automatically tag the new machines as well.

In this form, you should be able to:

  • create a manual or an automatic tag.
  • if the XPath expression is invalid, we will show an error and guide you towards the documentation.
  • if the XPath is valid we want to be able to show which machines this tag could apply to.
  • if kernel options are specified in the tag, we will provide a warning message that deployed machines need to be redeployed to have a new kernel option.

Last but not the least

This is the not the final version of our UI, we are still experimenting different interactions and different constraints. I hope that this new feature in the UI will get you excited for what’s coming in the new release. As usual, your feedback is a gift. Please tell us what you think about this feature (what you like, what you wish it could also do), add comments, tell us what is your understanding of XPath expression and what guiding materials can help you create these expressions efficiently.

See you in the next MAAS UI update!

4 Likes

I am very excited about this!

What is the target MAAS version for this feat? 3.0.x or 3.1.x?

1 Like

Hi @Heitor,

I am glad that you’re excited! Our goal is to launch this in the UI in 3.2
However, this is already available in the CLI (REST API), so feel free to play around with it!

Excited that you’re excited! I’m curious about what you’ll use it for, care to share?

I’m interested in adding extra tags according to some HW bits, like gpu, fpga, highmem, etc. This would help us a lot when deploying/expanding our clusters.

1 Like

Great. While you’re waiting you might like this:
https://github.com/canonical/mxt
and this:
https://gist.github.com/ThinGuy/661a88be3f8b0ed7770277374ac3546b
and this:

1 Like

@anton5mith, thanks for the links. That is great. Any plans on shipping with these rules as default or will that be left for users to add?

in order to keep things flexible, to support any type of hardware, it will be up to the users. We will list the library of xpath expressions however in the docs.

Is there any current way to remove automatic tags via the cli? Also, the current tags feature doesn’t use a name/value concept, so we end up creating a different rule for each type of CPU for example, or each possible upstream switch. We’d love to see tag=switch value=“name of switch we got back from xpath query” or tag=chassisSlot value=slot 6a)

Hi @mdeluca,

You can delete the automatic tag via the CLI using

$ maas $PROFILE tag delete $TAG_NAME

Here is the documentation for deleting tags in the CLI.

There are 4 attributes to the tag.

tag {
name: [The name of the tag, string up to 256 chars. ],
definition: [Xpath definition to define the rule],
comment: [A string that describes what the tag does.],
kernel_opts: [kernel parameters that you wish to assign to machines once deployed.]
}

I’m not quite clear on what you want to do with the value attribute. However, judging by your explanation, I think you can achieve this using the comment attribute of the tag.

Let me know if this helps :smiley:

It would be great if we can have an option to reset/delete existing tags when doing tags en masse. Currently on MAAS 3.1, when using group tagging, it only adds and does not touch existing tags.

Adding that option will make tagging operations much easier if one wants to get rid of all existing tags.

Any thoughts?

Hi @alanbach,

I am glad you mention that! We have noticed this behaviour and yes, we have a delete tag option in the up-coming release. (I’m not sure what you have in mind for reset).

From now on, there will be a Tag listing page in the UI that lists all the existing tags. Both manual and automatic tags. It will show you exactly how many machines it applies to and once deleted it will be removed from all machines. You may also update the tags. However, you cannot update a tag in a way that it will change a manual tag to automatic or automatic tag to manual.

Sorry if I was not clear. What I meant with reset was just delete. I’m envisioning the option to render like this:

If the checkbox is checked, MASS would first remove the given machines’ existing tags (tag relation to a given machine not the actual tag itself) before adding new tags to it.

Perhaps it would be better to call it “untagging” before adding new tags.

Hope this makes it more clear. Please let me know if there are any questions.

Hi @alanbach,

Here is a sneak-peek of our new design for the Tag Management form. This form allows you to make changes, remove assigned tag(s) from selected machines, as well as create a new tag and assign them to selected machines.

The page below is our new tag listing page. This should provide you a place to view all existing tags, you can update them, remove them and view their information from here as well.

There will be more updates in our next UI updates.

Oh, Wow, this is really nice! Can’t wait to see it in action.

Is it possible to add a mark to a tag (color or symbol or other) that it contains kernel options?

Hi @iaginde1,

Of course! If you see the second image referenced (in my comment) above (Tag listing page) there is a “Kernel Options” column that has check icons.

In the form (referenced in the first image), there should be a check icon for tags with Kernel options as well, when you click on the search box.

Stay tuned for next UI update!

It is perfectly! Didn’t notice right away, sorry :laughing: