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.

Install & setup

Prerequisites

  • Hardware meeting minimum requirements.
  • Knowledge of Ubuntu and basic Linux commands.
  • Understanding of networking concepts.
  • A MAAS server with internet access.
  • Administrative rights for setup.

Installation

  1. Update and install dependencies:

    sudo apt update
    sudo apt install snapd lxd lxd-client python3-lxc python3-openstackclient
    
  2. Install MAAS:

    sudo snap install maas
    
  3. Install and configure PostgreSQL for MAAS:

    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:

    sudo vi /etc/postgresql/12/main/pg_hba.conf
    host    maasdb    maas    0/0     md5
    
  5. Initialize MAAS:

    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:

    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:

    sudo maas createadmin
    

MAAS is now installed.

Configuration

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

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

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

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

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

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

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

MAAS can now manage and provision nodes.

LXD setup

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 
    

N/W+DHCP Config

  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.

Deploying a VM

Add a LXD VM

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 VM

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 a VM

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.


Last updated 26 days ago.