Errors or typos? Topics missing? Hard to read? Let us know.
This tutorial will walk you through the basics of the MAAS CLI.
Log in
- Fetch your API key: Generate your unique key with the following command:
maas apikey --username=$MAAS_USER > api-key
- Login: Use your API key to authenticate:
maas login admin http://<maas.domain>:5240/MAAS/api/2.0/ < api-key
Configure MAAS
- Set the DNS forwarder: If it’s your first time, set up DNS forwarding:
maas $MAAS_USER maas set-config name=upstream_dns value=8.8.8.8
- Import Ubuntu images: Again, if new, pull in Ubuntu images:
maas $MAAS_USER boot-resources import
Manage nodes
- Enlist a node: Add a new machine to MAAS:
maas $MAAS_USER machines create architecture=amd64 \
power_type=virsh mac_addresses=52:54:00:00:00:01
- Review status: Confirm the node’s state:
maas $MAAS_USER machines read | jq '.[].status_name'
- Commission a node: Prepare the node for deployment:
maas $MAAS_USER machine commission <node_id>
- Acquire a node: Claim the commissioned node:
maas $MAAS_USER machines allocate system_id=<id>
- Deploy a node: Get the machine running:
maas $MAAS_USER machine deploy <id>
Connect nodes
- Fetch a node’s IP: Retrieve the IP of a deployed node:
lxc list
-
Gain SSH access: Just log in as
ubuntu
. -
File transfer: Use
scp
for transferring files, and apply your customisations.