How to use MAAS constraints?


I’m trying to understand more how to specify machine tags, zones, and pools when deploying applications using Juju on a MAAS cloud.

We have something similar to this in our bundle.yaml that we juju deploy ./bundle.yaml:

        charm: foo
        constraints: tags=foo,bar,^bla zones=a-1

I want to understand more about these constraints:

  1. tags=foo,bar means: "match machines with tag foo AND bar"?
  2. how do I specify an OR between tags? For example: "match machines with tag foo OR bar"? Can I use tags=foo|bar?
  3. how do I specify a more complex constraint, like: "(foo OR bar) AND (bla) AND NOT (x) "?
  4. what are the constrains that I can set/request when using Juju? i know I can specify MAAS tags and zones, can I also specify a pool and fabric vlan? What is the syntax for that?
  5. when specifying multiple constraints, they are all “joined” with a boolean AND?

(cross post from MAAS constraints when using Juju - Users - MAAS | Discourse)

Thank you,



Hi Heitor, answers below.

  1. Yes
  2. Arbitrary boolean logic is not supported. Only AND (the default), and NOT (the ^)
  3. You cannot. See #2
  4. See Juju constraints (apparently only available on Discourse for some reason)
  5. Yes

I suggest you file an RFE bug for the features you would like to see.

Hope this helps.

Hi Peter, thanks for the help!

This secret page for the constraints is very helpful. I wonder why is not on the Juju docs pages?

Filed a bug for that: Bug #1948959 “Enrich constraints for MAAS cloud” : Bugs : juju

Thanks again!

Apologies for having introduced confusion. The reference page is linked from this documentation page:


but it brings you to Discourse instead of staying in the documentation.


Ping @tmihoc ^

1 Like

Thanks, I’ll make sure to list it.

1 Like