Using MAAS with Juju

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.

Adding 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

Select cloud type: maas

Enter a name for your maas cloud: maas-cloud

Enter the API endpoint url:

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 ''.

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

For the manual method for adding a MAAS cloud, see Manually adding MAAS clouds.

Adding 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.

Creating a controller

You are now ready to create a Juju controller for cloud 'maas-cloud':

juju bootstrap maas-cloud maas-cloud-controller

Above, the name given to the new controller is 'maas-cloud-controller'. MAAS will allocate a node from its pool to run the controller on.

For a detailed explanation and examples of the bootstrap command see the [Creating a controller][controllers-creating] page.

Next steps

A controller is created with two models - the 'controller' model, which should be reserved for Juju's internal operations, and a model named 'default', which can be used for deploying user workloads.

See these pages for ideas on what to do next:

© 2018 Canonical Ltd. Ubuntu and Canonical are registered trademarks of Canonical Ltd.