Support multiple Juju environments per MAAS install

Bug #1085182 reported by Ryan Finnie
0
Affects Status Importance Assigned to Milestone
pyjuju
Triaged
Low
Unassigned

Bug Description

MAAS has no concept of Layer 3, which is basically a good thing. You could have a MAAS server with multiple physical or VLAN interfaces, set up DHCP for each of them and then, as long as you're good about setting constraints, have multiple Juju environments using multiple networks using only one MAAS server.

However, MAAS's object store appears to be global to the install, does not have the EC2 equivalent of buckets, and is not user-specific. I tried creating two MAAS users and bootstrapping two juju environments, and the second time it found the bootstrap ID of the first, but couldn't get info about (since it was allocated to the other user). It appears Juju sets/gets the "provider-state" object, which again is global to the MAAS install.

I went into /usr/lib/python2.7/dist-packages/juju/providers/common/state.py, changed _STATE_FILE to "provider-state2", and indeed it allowed me to bootstrap and utilize a second Juju environment. This appears to be the only barrier to allowing multiple Juju environments per MAAS install. Adding a config option (similar to "control-bucket" Juju option on the S3/Swift providers) to, say, prefix the MAAS object name would achieve this. Something like:

environments:
  env1:
    type: maas
    maas-server: 'http://maashost.internal:80/MAAS'
    maas-oauth: '...'
    authorized-keys-path: ~/.ssh/env1-id_rsa.pub
 env2:
    type: maas
    maas-server: 'http://maashost.internal:80/MAAS'
    maas-oauth: '...'
    maas-object-prefix: 'env2'
    authorized-keys-path: ~/.ssh/env2-id_rsa.pub

In this case, env1 would use the default "provider-state" object key to preserve backwards compatibility, while env2 would use an object key called "env2_provider-state".

Ryan Finnie (fo0bar)
description: updated
description: updated
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

maas has other issues with multiple environments for the same user in addition to this. it has no segmentation/tagging of the machines in a particular environment, which causes several other issues (see bug:1081247). for this case we can auto prefix with the env name if nesc or use the fielded config.

Revision history for this message
Kapil Thangavelu (hazmat) wrote :

another easy option here is introduce the control-bucket value we use for other providers with that as the prefix.

Changed in juju:
importance: Undecided → Medium
status: New → Triaged
Curtis Hovey (sinzui)
Changed in juju:
importance: Medium → Low
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.