Using MAAS with Juju
× Caution! These older versions of Juju documentation are no longer maintained and are provided for reference only. See docs.jujucharms.com for the current, supported documentation.

Using a MAAS cloud

Juju works closely with MAAS to deliver the same experience on bare metal that you would get by using any other cloud. Note that the Juju 2.x series is compatible with both the 1.x and 2.x series of MAAS.

Add a MAAS cloud

Use the interactive add-cloud command to add your MAAS to Juju's list of clouds:

juju add-cloud

Example user session:

Cloud Types
  maas
  manual
  openstack
  oracle
  vsphere

Select cloud type: maas

Enter a name for your maas cloud: maas-cloud

Enter the API endpoint url: http://10.55.60.29:5240/MAAS

Cloud "maas-cloud" successfully added
You may bootstrap with 'juju bootstrap maas-cloud'

We've called the new cloud 'maas-cloud' and used an endpoint of 'http://10.55.60.29:5240/MAAS'.

Now confirm the successful addition of the cloud:

juju clouds

Here is a partial output:

Cloud        Regions  Default          Type        Description
.
.
.
maas-cloud         0                   maas        Metal As A Service

You will need to add credentials for this cloud before bootstrapping it (creating a controller).

Manually defining MAAS clouds

Alternatively, it is possible to manually define a single or multiple MAAS clouds with a file and add a cloud by referring to such a file (still with juju add-cloud). See Manually adding MAAS clouds for details.

Add credentials

Use the interactive add-credential command to add your credentials to the new cloud:

juju add-credential maas-cloud

Example user session:

Enter credential name: maas-cloud-creds

Using auth-type "oauth1".

Enter maas-oauth:

Credentials added for cloud maas-cloud.

We've called the new credential 'maas-cloud-creds'. When prompted for 'maas-oauth', you should paste your MAAS API key.

Note: The API key will not be echoed back to the screen.

Typically you will have a MAAS user of your own. The MAAS API key can be found on your user preferences page in the MAAS web UI, or by using the MAAS CLI, providing you have sudo access:

sudo maas-region apikey --username=$PROFILE

Where $PROFILE is to be replaced by the MAAS username.

Create the Juju controller

You are now ready to create a Juju controller:

juju bootstrap maas-cloud maas-cloud-controller

Above, the name given to the new controller was 'maas-cloud-controller'. MAAS will allocate a node from its pool to run the controller on. If you want to make sure a specific node is used for this, use constraints (see Create a controller with constraints).

Next steps

You can now start deploying Juju charms and/or bundles to your MAAS cloud. Continue with Juju by visiting the Models and Introduction to Juju Charms pages.