Canonical’s MAAS production is an incredible piece of software. It provides the DHCP and PXE booting capabilities for physical servers to automatically handle some normally time-intensive, manual tasks such as:
- Taking an inventory of the RAM, HDDs, CPUs, etc. in a physical server
- Running some basic hardware and connectivity tests on the servers
- Updating and configuring the base management controller (BMC)
- Configuring an IPMI user to control power for the server remotely
- Configuring the physical server’s filesystem layout, network configuration, etc. (all through a web interface and easily replicated for additional servers)
- Finally, installation of the operating system itself
- Subsequent wiping and re-installation of the operating system, as needed
Where to host MAAS
I’m sure there are many and varied opinions about this, but I like to host MAAS on a dedicated VM in Proxmox. Proxmox makes it easy to establish the various network interfaces you’ll need. Another good place might be on a Raspberry Pi or another low-power option.
The installation requirements provide some helpful tips on the resources required. In my experience, 4 GB of RAM is acceptable, but 8 GB is preferred if possible.
Network layout
A sample VLAN configuration for a working MAAS environment might look something like this:
- VLAN 1 (
10.x.0.0/24
): management network, with DHCP provided by your main router. Define your MAAS URL in this network. - VLAN 302 (
10.x.20.0/24
): dedicated VLAN for IPMI NICs - VLAN 303 (
10.x.30.0/24
): dedicated VLAN for the hardware to be managed by MAAS
If using Proxmox or another virtualization platform, you can manage the network interfaces via Cloud-Init. There is no requirement for the VLAN tags to be apparent within the MAAS host itself; the host merely needs to have a network interface in each subnet that it manages.
If using dedicated hardware, you can configure the network interfaces as normal on Linux for tagged traffic (e.g., eth0.302
for VLAN 302).
For each network, pick an IP address with a consistent final octet in each subnet to assign to each interface (e.g., 10.x.x.10/24
). While there is no requirement in MAAS for this, it will help maintain your sanity.
Initial installation
To install MAAS, follow the installation instructions. I recommend skipping the “How to initialise MAAS 3.2 snap for a test or POC environment” section and jumping directly to “Initialise MAAS for a production configuration.” It’s easy enough to install PostgreSQL locally instead of via snap, plus it’s useful to get familiar with this process if you’ll be doing it for production later on anyways.
Additional note:
- The MAAS URL you choose must be reachable both by you in a web browser and by the physical servers when you install them. In my case, I chose to host it in the management work (e.g.,
10.x.0.10/24
), and I made sure that the other subnets could reach this IP address in my router. - When initializing MAAS, I chose the
region+rack
option. I’m only running a single copy of it for now and wanted to keep things simple.
Logging in and initial configuration
Once MAAS is installed, you can access it via the MAAS URL you configured (e.g., http://10.x.0.10:5240/MAAS/). If you haven’t yet, you might need to run sudo maas createadmin
to create a user for yourself.
The setup wizard will guide you through some initial configuration.
Subnet configuration
Once the initial setup is completed, you will want to configure some subnets. This assumes you already have network interfaces configured on the MAAS host in each of the subnets that you want to manage (as well as the management network where the MAAS URL is defined).
Under the Subnets menu in the header, you will want to add a VLAN and Subnet for each of the networks you plan to use.
Once this is done, for each VLAN where MAAS will provide DHCP (VLANs 302 and 303 in our example above), you will want to reserve two ranges of IP addresses:
- A “Dynamic Reserved Range” where MAAS is allowed to hand out IP addresses for temporary usage (e.g., installing an OS or booting into rescue mode,
10.x.x.200 - 10.x.x.254
). - A “Reserved Range” where MAAS should not hand out IP addresses (e.g., you might want to reserve a few IPs at the start of the subnet for things like your router and MAAS itself,
10.x.x.1 - 10.x.x.20
). - Everything else in the subnet MAAS considers “available to assign to deployed servers.”
Once the ranges are configured, still on the detail page for each VLAN, click Configure DHCP. Here you can specify:
- MAAS provides DHCP for this VLAN
- Provide DHCP from rack controller (select your maas install from the list)
I had some trouble figuring out what subnet and VLAN configuration had to be in place before this, so if it does not allow you to enable DHCP for a VLAN, double check that the subnet and reserved ranges are all in place for the VLAN you are attempting to configure.