Offline docs (switch to live docs)                          UI-only  CLI-only

Try out the MAAS CLI

Master your infrastructure with the MAAS CLI

Errors or typos? Topics missing? Hard to read? Let us know!

Harness the power of the MAAS CLI to take full control of your infrastructure. From logging in to deploying nodes, this guide is your roadmap to managing MAAS like a pro.

Get started: log in to the MAAS CLI

  1. Fetch your API key: Generate your unique key with the following command. bash maas apikey --username=$MAAS_USER > api-key

  2. Login: Use your API key to authenticate. bash maas login admin http://<maas.domain>:5240/MAAS/api/2.0/ < api-key

Configure your environment

  1. Set the DNS forwarder: If it's your first time, set up DNS forwarding. bash maas $MAAS_USER maas set-config name=upstream_dns value=8.8.8.8

  2. Import Ubuntu images: Again, if new, pull in Ubuntu images. bash maas $MAAS_USER boot-resources import

Node management 101

  1. Enlist a node: Add a new machine to MAAS. bash maas $MAAS_USER machines create architecture=amd64 \ power_type=virsh mac_addresses=52:54:00:00:00:01

  2. Review status: Confirm the node’s state. bash maas $MAAS_USER machines read | jq '.[].status_name'

  3. Commission a node: Prepare the node for deployment. bash maas $MAAS_USER machine commission <node_id>

  4. Acquire a node: Claim the commissioned node. bash maas $MAAS_USER machines allocate system_id=<id>

  5. Deploy a node: Execute the deployment. bash maas $MAAS_USER machine deploy <id>

Connect to your nodes

  1. Fetch a node's IP: Retrieve the IP of a deployed node. bash lxc list

  2. Gain SSH access: Just log in as ubuntu.

  3. File transfer: Use scp for transferring files, and apply your customisations.

Explore more on your own

Now, you’re equipped to manage your infrastructure at scale using MAAS and its CLI. Ready to take the plunge?