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

Bootstrap MAAS

Quick guide to MAAS installation and configuration

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

MAAS simplifies hardware management in data centers and clouds, offering scalable deployment.

Prerequisites

Installation Steps

  1. Update and install dependencies: bash sudo apt update sudo apt install snapd lxd lxd-client python3-lxc python3-openstackclient
  2. Install MAAS: bash sudo snap install maas
  3. Install and configure PostgreSQL for MAAS: bash sudo apt install postgresql postgresql-contrib sudo su - postgres psql CREATE USER maas WITH PASSWORD 'password'; CREATE DATABASE maasdb OWNER maas; \q exit

  4. Edit /etc/postgresql/12/main/pg_hba.conf, adding a line like the one below, to allow the MAAS user to connect:

    bash sudo vi /etc/postgresql/12/main/pg_hba.conf host maasdb maas 0/0 md5

  5. Initialize MAAS: bash sudo maas init region+rack --database-uri postgres://maas:password@localhost/maasdb

  6. Make a note of the URL this command returns, of the form shown below; you'll need it later:

    bash http://<ip-address>:5240/MAAS

  7. Visit the web UI at the noted URL and create an admin account; note that the e-mail address can be anything:

    bash sudo maas createadmin

MAAS is now installed.

Initial Configuration

  1. Access MAAS at this address, where $API_HOST is the MAAS URL used above:

    bash http://${API_HOST}:5240/MAAS

Log in using the login information you created when initializing MAAS.

  1. In the web UI, go to Settings > General and set a forward DNS server, such as "8.8.8.8".

  2. Under Images, select the Ubuntu release to sync; you can usually accept the default.

  3. Under Accounts, import your SSH public key from Launchpad or GitHub, or upload your existing public key. Follow the on-screen instructions.

  4. Review remaining config options like proxy usage, NTP, etc.

MAAS can now manage and provision nodes.

Set up LXD

  1. Install the LXD snap:

    sudo snap install lxd

  2. Initialize the LXD configuration:

    sudo lxd init

    Choose appropriate options for networking, storage pools, etc.

  3. Disable LXD's built-in DHCP server:

    lxc network set lxdbr0 ipv4.dhcp=false

Networking and DHCP Configuration

  1. Identify the LXD bridge IP address:

    ip addr show lxdbr0

  2. In MAAS, go to Subnets and identify the VLAN for that subnet.

  3. Select the VLAN and configure DHCP with the bridge IP as the gateway.

MAAS now provides networking and DHCP for provisioning LXD VMs.

Create a VM host

Create a LXD VM host with a MAAS-generated certificate:

  1. Select KVM > LXD.

  2. Select Add KVM.

  3. Enter a Name for the KVM host.

  4. Optionally, select a non-default Zone.

  5. Optionally, select a non-default Resource pool.

  6. Enter the LXD address as the gateway address of the bridge for that LXD instance. For example, if lxdbr0 has address 10.4.241.0, the default gateway address is 10.4.241.1.

  7. Select Generate new certificate.

  8. Select Next.

  9. Select Add trust to LXD via command line.

  10. Copy the bash command and certificate from the text box.

  11. In a terminal, paste the copied command and make sure that it runs.

  12. Select Check authentication. You'll switch screens; if all goes well, you'll see Connected with a green check-mark.

  13. Select Add new project or Select existing project. Be aware that if you select an existing project, any VMs already in that project will begin to commission.

  14. Select Next. You will drop out to a dashboard for the VM host.

MAAS now has a VM host, to which LXD virtual machines can be added.

Add a LXD virtual machine

Add a virtual machine from the MAAS UI:

  1. Select KVM > LXD.

  2. Select the desired VM host by clicking on its name.

  3. Select Add VM.

  4. Optionally enter the VM name.

  5. Select Use any available core(s) or Pin VM to specific core(s), as desired. Enter specific core identities as appropriate.

  6. Enter the RAM desired.

  7. Select Show advanced if you want to edit the Domain, Zone, Resource pool, or Architecture. Make those changes as desired.

  8. Optionally Define interfaces.

  9. Optionally Add disks.

  10. Select Compose machine to create the virtual machine.

You can switch from here to the Machine list to watch the commissioning process in action.

Acquiring a "Ready" machine

Acquire (aka, "allocate") your new machine so that only you can deploy it:

  1. Select your new VM when it reaches the "Ready" state.

  2. Drop down the Take action menu.

  3. Select Allocate and confirm your choice on the following screen.

MAAS is now ready to deploy your newly-created virtual machine.

Deploying your virtual machine

Deploy your VM directly from MAAS:

  1. Select your allocated VM and choose Deploy.

  2. On the follow-on options screen, don't worry about deviating from the default OS, release, and kernel, at least not for now.

  3. When you're ready, press Deploy... to get the machine up and running.

The VM's status will change several times as MAAS steps through the process. When done, the status becoemes the name of the deployed OS (e.g. 'Ubuntu 18.04 LTS').

After deployment

SSH into deployed machines with username Ubuntu. Feel free to explore the deployed VM.

Further Learning

Dive deeper into MAAS features and in the explanation, how-to guides, and reference sections sections.