[1.9] Multiple negative spaces constraints given and rejected by MAAS

Bug #1636969 reported by Martin Packman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Michael Foord
2.0
Fix Released
High
Michael Foord
MAAS
Invalid
Undecided
Unassigned
1.9
Invalid
Undecided
Unassigned

Bug Description

Juju 2.0 translates a constraint that a machine must be in neither of two spaces into a not_networks parameter that MAAS 1.9 rejects.

With two spaces, each with one subnet (here gz-test -> 10.0.50.0/24 and gz-test-b -> 10.0.60.0/24) juju accepts a constraint that a machine should be in neither space, which is rejected by MAAS 1.9 on acquire:

$ juju bootstrap munna-vmaas --config test-mode=true --bootstrap-constraints="spaces=^gz-test,^gz-test-b" --debug
19:29:36 INFO juju.cmd supercommand.go:63 running juju [2.0.1 gc go1.6.2]
...
19:29:37 INFO juju.cmd.juju.commands bootstrap.go:744 combined bootstrap constraints: spaces=^gz-test,^gz-test-b
...
19:29:49 ERROR cmd supercommand.go:458 failed to bootstrap model: cannot start bootstrap instance: cannot run instances: cannot run instances: ServerError: 400 BAD REQUEST ({"not_networks": ["No matching subnets found."]})

From the maas.log for this machine:

Oct 26 19:30:11 deafening-thrill maas.api: [INFO] Request from user root to acquire a node with constraints <QueryDict: {u'agent_name': [u'01bce9c6-1a51-468a-84ac-d4a37b390f9d'], u'zone': [u'default'], u'not_networks': [u'space:3,space:4']}>

See bug 1636919 for related constraint issue with MAAS 2.0+ accepting but ignoring parameters.

Related branches

Revision history for this message
Martin Packman (gz) wrote :
Revision history for this message
Andres Rodriguez (andreserl) wrote : Re: [1.9] Multiple negative spaces constraints given and rejected by MAAS 1.9

Martin,

Can you confirm the exact version of MAAS please?

summary: - Multiple negative spaces constraints given and rejected by MAAS 1.9
+ [1.9] Multiple negative spaces constraints given and rejected by MAAS
+ 1.9
Revision history for this message
Martin Packman (gz) wrote :

Sure, see the terminal session, it's "1.9.4+bzr4592-0ubuntu1".

summary: [1.9] Multiple negative spaces constraints given and rejected by MAAS
- 1.9
no longer affects: maas/2.0
Revision history for this message
Mike Pontillo (mpontillo) wrote :

Note that in MAAS 2.0 the 'networks' constraint was renamed to 'subnets' to match the new terminology for the network model, but otherwise, this code hasn't changed. (this is a separate bug.)

I wrote a test case to ensure that this behaves as-expected in MAAS[1], but long story short: you cannot use a comma to separate parameters when using the not_networks (MAAS 1.9) or not_subnets (MAAS 2.x+) constraint.

When making the API request, you must pass in something like:

.../node/?op=acquire&not_subnets=space:x&not_subnets=space:y

Whereas juju is passing in:

.../node?op=aquire&not_subnets=space:x,space:y

The comma syntax is not supported for these 'legacy' constraints, though they are supported according to the spec in the new 'interfaces' constraint.

[1]:
https://code.launchpad.net/~mpontillo/maas/multiple-subnet-constraints--bug-1636969/+merge/309402

Changed in maas:
status: New → Invalid
Changed in juju:
status: New → Invalid
Revision history for this message
Martin Packman (gz) wrote :

Okay, so this bug can just be about splitting into multiple params as MAAS requires. I filed bug 1637182 about the MAAS documentation here.

Changed in juju:
importance: Undecided → High
milestone: none → 2.1.0
status: Invalid → Triaged
Changed in maas:
status: Invalid → Fix Committed
Revision history for this message
Mike Pontillo (mpontillo) wrote :

Note: the errant "Fix Committed" from the lander was just me committing a unit test to make sure we don't break this in the future. No fix was necessary.

Changed in maas:
status: Fix Committed → Invalid
Michael Foord (mfoord)
Changed in juju:
assignee: nobody → Michael Foord (mfoord)
Michael Foord (mfoord)
Changed in juju:
status: Triaged → In Progress
Martin Packman (gz)
no longer affects: maas/2.0
Michael Foord (mfoord)
Changed in juju:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.1.0 → 2.1-beta1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.