<a id="cloud-maas"></a>

# The MAAS cloud and Juju

This document describes details specific to using your existing MAAS cloud with Juju.

> See more: [MAAS](https://maas.io/)

When using this cloud with Juju, it is important to keep in mind that it is a (1) machine cloud and (2) not some other cloud.

> See more: [Cloud differences](https://documentation.ubuntu.com/juju/2.9/reference/cloud.md#cloud-differences)

As the differences related to (1) are already documented generically in the rest of the docs, here we record just those that follow from (2).

## Requirements

Starting with `juju v.3.0`, versions of MAAS <2 are no longer supported.

## Notes on `juju add-cloud`

Type in Juju: `maas`

Name in Juju: User-defined.

## Notes on `juju add-credential`

### Authentication types

#### `oauth1`

Attributes:

- maas-oauth: OAuth/API-key credentials for MAAS (required)

#### NOTE
`maas-oauth` is your MAAS API key. See more: MAAS | How to add an API key for a user]([https://maas.io/docs/how-to-manage-user-accounts#heading–api-key](https://maas.io/docs/how-to-manage-user-accounts#heading--api-key))

<!--
## Notes on \`juju bootstrap\`
-->
<!--
## Cloud-specific model configuration keys
-->

## Supported constraints

| [CONSTRAINT](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint)                              |                                                                                           |
|---------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| conflicting:                                                                                      |                                                                                           |
| supported?                                                                                        |                                                                                           |
| - [allocate-public-ip](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-allocate-public-ip) | ✕                                                                                         |
| - [arch](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-arch)                             | ✓ <br> Valid values: See cloud provider.                                                  |
| - [container](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-container)                   | ✓                                                                                         |
| - [cores](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-cores)                           | ✓                                                                                         |
| - [cpu-power](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-cpu-power)                   | ✕                                                                                         |
| - [image-id](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-image-id)                     | ✓ (Starting with Juju 3.2) <br> Type: String. <br> Valid values: An image name from MAAS. |
| - [instance-role](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-instance-role)           | ✕                                                                                         |
| - [instance-type](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-instance-type)           | ✕                                                                                         |
| - [mem](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-mem)                               | ✓                                                                                         |
| - [root-disk](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-root-disk)                   | ✓                                                                                         |
| - [root-disk-source](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-root-disk-source)     | ✕                                                                                         |
| - [spaces](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-spaces)                         | ✓                                                                                         |
| - [tags](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-tags)                             | ✓                                                                                         |
| - [virt-type](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-virt-type)                   | ✕                                                                                         |
| - [zones](https://documentation.ubuntu.com/juju/2.9/reference/constraint.md#constraint-zones)                           | ✓                                                                                         |

## Supported placement directives

| [PLACEMENT DIRECTIVE](https://documentation.ubuntu.com/juju/2.9/reference/placement-directive.md#placement-directive)               |                                                              |
|------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| - [<machine>](https://documentation.ubuntu.com/juju/2.9/reference/placement-directive.md#placement-directive-machine)               | TBA                                                          |
| - [subnet=<subnet>](https://documentation.ubuntu.com/juju/2.9/reference/placement-directive.md#placement-directive-subnet)          | ✕                                                            |
| - [system-id=<system ID>](https://documentation.ubuntu.com/juju/2.9/reference/placement-directive.md#placement-directive-system-id) | ✓                                                            |
| - [zone=<zone>](https://documentation.ubuntu.com/juju/2.9/reference/placement-directive.md#placement-directive-zone)                | ✓ <br> If there’s no ‘=’ delimiter, assume it’s a node name. |
