CLI MAAS - OpenStack Guide v0
CLI MAAS - OpenStack Guide v0
CLI MAAS - OpenStack Guide v0
If you have additional stand-alone rack controllers and a fresh installation has regenerated the
/var/lib/maas/secret file, you'll need to make sure this secret is updated on each rack
controller to allow them to re-connect to the newly restored region controller.
Now either restart your system(s) or the stopped services. You'll find your MAAS deployment
fully restored.
MAAS CLI
The MAAS CLI can do everything that the web UI can do, and more. The CLI uses the maas
command exclusively which, in turn, connects to the API.
This page explains what is needed to get going with the CLI. Tasks are then separated into
common, image management, DHCP snippet management, and advanced.
Note that we do not provide complete coverage of the MAAS CLI. For an exhaustive treatment,
see the API documentation.
Values are represented as uppercase variables preceded with the '$' character (e.g. $PROFILE
and $EMAIL_ADDRESS). These are to be replaced with actual values.
Create an administrator
MAAS requires an initial administrator, sometimes called a MAAS "superuser". When the web
UI is accessed for the first time you will be prompted to create this user:
Extra administrators can be created in the same way. See MAAS CLI - common tasks for
creating regular users with the CLI.
Log in (required)
To use the CLI you must first log in to the API server (region controller).
You will need the API key that was generated when your MAAS account was created. To obtain
it, run this command on the region controller (i.e. where the 'maas-region-controller' package was
installed):
Note: A user's API key can also be obtained from the web interface. Click on 'username' in the
top right corner, and select 'Account'.
Log in. You will be prompted for the API key:
For example, to log in with the account whose username is 'admin' and where the region
controller is on the localhost:
#!/bin/sh
MAAS_URL=http://$API_SERVER/MAAS/api/2.0
Get help
To access command help:
maas $PROFILE -h
Further examples:
Log out
Once you are done with the CLI you can log out from the given profile, flushing the stored
credentials.
Next steps
The following categories are now available to be explored:
Common tasks
Kernel management
Image management
Tag management
DHCP snippet management
Advanced tasks
Composable hardware
Common CLI Tasks
This is a list of common tasks to perform with the MAAS CLI. See MAAS CLI on how to get
started.
List nodes
To list all nodes (and their characteristics) in the MAAS:
Commission a node
To commission a node:
Acquire a node
To acquire/allocate a random node:
Deploy a node
To deploy a node:
Note: To deploy with the CLI the node must have a status of 'Allocated'. See 'Acquire a node'
above (or use the web UI).
To create a range of dynamic IP addresses that will be used by MAAS for node enlistment,
commissioning, and possibly deployment:
Determine a fabric ID
To determine a fabric ID based on a subnet address:
Enable DHCP
To enable DHCP on a VLAN on a certain fabric:
To enable DHCP HA you will need both a primary and a secondary controller:
Note: DHCP for PXE booting will need to be enabled on the 'untagged' VLAN.
Configure proxying
Enabling and disabling proxying in general is done via a boolean option ('true' or 'false'). This is
how proxying is disabled completely:
To set an external proxy, ensure proxying is enabled (see above) and then define it:
Enabling and disabling proxying per subnet is done via a boolean option ('true' or 'false'). This is
how proxying is disabled per subnet:
For example,
See Proxy for detailed information on how proxying works with MAAS.