MAAS Deployment¶
MAAS (Metal as a Service)
MAAS is a powerful tool designed to automate the installation and deployment of operating systems across multiple physical (bare-metal) or virtual machines. It transforms your raw hardware into an elastic cloud resource, managing provisioning from start to finish via PXE booting.
Used Prerequisites:
- Ubuntu Server: for MAAS Installation
- Nodes: Three machines (Master, Worker 1, Worker 2) configured for PXE boot
MAAS Deployment & Initial Configuration¶
1. ๐พ MAAS Core Installation¶
Install the MAAS packages and the required database components.
# Add repository for latest MaaS version
sudo apt install software-properties-common
sudo add-apt-repository ppa:maas/3.7
# Update and install the MaaS package
sudo apt update
sudo apt install maas
2. โ๏ธ Initial Configuration¶
Initialize the MAAS region controller. You will be prompted to choose a user (create a new one).
3. ๐ Access UI¶
Open a web browser and navigate to:
http://<MAAS_SERVER_IP>:5240/MAAS
Login: Use the administrator account credentials set during maas init
MAAS Networking & Domain Configuration¶
1. ๐ Disable DHCP on the VLAN¶
By default, MAAS provides DHCP. To avoid conflicts with your router, you must disable the dynamic range and only use MAAS for IP reservations.
Steps:
- Navigate to Subnets in the MAAS UI
- Select your primary subnet (e.g.,
192.168.55.0/24) - In the DHCP section, delete the dynamic IP range
- Ensure the DHCP mode for the VLAN is set to "Unmanaged" or that the DHCP range is empty
2. ๐ Configure Domain and Hostnames¶
Set a cleaner domain name and ensure MAAS uses consistent naming conventions.
Steps:
- Navigate to Settings โ General โ Default DNS suffix
- Change the default (e.g.,
maas) to something cleaner (e.g.,homelab) - In the DNS tab, verify that MAAS is configured to manage DNS records for your domain
3. ๐ SSH Key Registration¶
You can securely import your keys directly from GitHub, which is faster than pasting them manually.
Steps:
- Go to User Account โ My Account
- In the SSH keys section, choose "Import from GitHub"
- Enter your GitHub username - MAAS will automatically fetch and register all your public keys
4. โ๏ธ Commissioning and IP Assignment¶
Steps:
- Start Nodes: Power on your bare-metal nodes configured for PXE boot
- Commissioning: MAAS will discover them and perform hardware testing. Once complete, they will transition to the Ready state
- Static IP Reservation: For each Node, go to its configuration page and set a Static IP Reservation corresponding to its MAC address
My configuration:
| Node | Hostname | Target IP |
|---|---|---|
| Control Plane | master-00 | 192.168.55.10 |
| Agent 1 | worker-01 | 192.168.55.11 |
| Agent 2 | worker-02 | 192.168.55.12 |
5. ๐ Deploying the Nodes¶
- Select Ubuntu 24.04 LTS or your custom image for each node
- Ensure the static IP from the table above is assigned during deployment
- After deployment, remember to change boot sequence from PXE to External Disk
6. ๐งน Post-Deployment Cleanup¶
After deployment, the nodes are running Ubuntu 24.04 with the user ubuntu by default and some MAAS settings.
User Account Migration (ubuntu โ admin)¶
Perform SSH login using ssh ubuntu@<IP_ADDRESS> and execute:
Enable password-less sudo (required for Ansible):
Add to the end of the file:
Copy SSH key to new user and fix ownership/permissions:
sudo cp -r /home/ubuntu/.ssh /home/admin/
sudo chown -R admin:admin /home/admin/.ssh
sudo chmod 700 /home/admin/.ssh
sudo chmod 600 /home/admin/.ssh/authorized_keys
Switch to New User¶
Log out and log back in as the new user:
If everything works fine, delete the ubuntu user:
Change Hostname (Optional)¶
Remove MAAS APT Proxy Configuration¶
# Remove APT proxy config
sudo rm -f /etc/apt/apt.conf.d/90curtin-aptproxy
# Remove global proxy environment variables
sudo sed -i '/maas/d' /etc/environment
sudo sed -i '/maas/d' /etc/bash.bashrc
# Fix missing packages
sudo apt update --fix-missing
Optionally remove duplicate source warnings: