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.
bash
sudo apt update
sudo apt install snapd lxd lxd-client python3-lxc python3-openstackclient
bash
sudo snap install maas
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
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
Initialize MAAS:
bash
sudo maas init region+rack --database-uri postgres://maas:password@localhost/maasdb
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
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.
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.
In the web UI, go to Settings > General and set a forward DNS server, such as "8.8.8.8".
Under Images, select the Ubuntu release to sync; you can usually accept the default.
Under Accounts, import your SSH public key from Launchpad or GitHub, or upload your existing public key. Follow the on-screen instructions.
Review remaining config options like proxy usage, NTP, etc.
MAAS can now manage and provision nodes.
Install the LXD snap:
sudo snap install lxd
Initialize the LXD configuration:
sudo lxd init
Choose appropriate options for networking, storage pools, etc.
Disable LXD's built-in DHCP server:
lxc network set lxdbr0 ipv4.dhcp=false
Networking and DHCP Configuration
Identify the LXD bridge IP address:
ip addr show lxdbr0
In MAAS, go to Subnets and identify the VLAN for that subnet.
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 LXD VM host with a MAAS-generated certificate:
Select KVM > LXD.
Select Add KVM.
Enter a Name for the KVM host.
Optionally, select a non-default Zone.
Optionally, select a non-default Resource pool.
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
.
Select Generate new certificate.
Select Next.
Select Add trust to LXD via command line.
Copy the bash command and certificate from the text box.
In a terminal, paste the copied command and make sure that it runs.
Select Check authentication. You'll switch screens; if all goes well, you'll see Connected with a green check-mark.
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.
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 virtual machine from the MAAS UI:
Select KVM > LXD.
Select the desired VM host by clicking on its name.
Select Add VM.
Optionally enter the VM name.
Select Use any available core(s) or Pin VM to specific core(s), as desired. Enter specific core identities as appropriate.
Enter the RAM desired.
Select Show advanced if you want to edit the Domain, Zone, Resource pool, or Architecture. Make those changes as desired.
Optionally Define interfaces.
Optionally Add disks.
Select Compose machine to create the virtual machine.
You can switch from here to the Machine list to watch the commissioning process in action.
Acquire (aka, "allocate") your new machine so that only you can deploy it:
Select your new VM when it reaches the "Ready" state.
Drop down the Take action menu.
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:
Select your allocated VM and choose Deploy.
On the follow-on options screen, don't worry about deviating from the default OS, release, and kernel, at least not for now.
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').
SSH into deployed machines with username Ubuntu
. Feel free to explore the deployed VM.
Dive deeper into MAAS features and in the explanation, how-to guides, and reference sections sections.