Deploy machine with MAAS

Ok, after installation and configuration of MAAS controller we are finally going to deploy our first machine with MAAS. Empty machine with only hardware configuration and network boot enabled. We are going to deploy Ubuntu.

Before we begin

My MAAS installation is v2.9.1 and is deployed on Ubuntu Server 20.04 within 10.0.0.0/24 subnet on IP 10.0.0.101.

I’m doing this inside VM, so have that in mind, but the procedure is valid when you deploy on the hardware in physical network.

You machine should be only configured hardware wise, and you should set your machine to boot from network.

Also, it would be nice that your equipment has some kind of IPMI (iLO, iDRAC, IPMI…) because MAAS can manage power state of the machine if IPMI is configured.

Unfortunately, I don’t have IPMI, and that is more complicated scenario then having IPMI. If you set IPMI properly, MAAS will automatically boot/reboot/shutdown your machine. I will also show you where to set IPMI after you deploy machine.

My VM has 4vCPUs, 8GB of RAM, 80GB of disk storage and is set to boot from Network.

I’m getting error when deploying Ubuntu 20.04 with MAAS 2.9.1 – error is “Failed to find primary ESP mounted at /boot/efi…”

So, in order to have successful install, I’m going to switch BIOS from UEFI to Legacy BIOS on the machine I’m planning to install.

Deployment

There are three stages of deploying machine through MAAS. First one is commissioning. After first boot, your machine should search through the network for bootable devices and MAAS should respond.

If MAAS picks up your machine it will begin commission on it.After commissioning is done, MAAS will shut down the machine (or reboot it). Then you should select Test action. Then MAAS will boot your machine once again and test it. If tests are success you can then proceed with Deploy phase. If the deploy phase goes well, you should have OS installed on your machine.

If any of these phases fail, you will not be able to deploy machine, you will have to troubleshoot and find solution for the errors you get.

Let’s go together step by step…

MAAS controller is up and running, and for this process we will watch Machines menu. So far, we have zero machines deployed.

Let’s start our machine (remember, it has to boot from network card).

Machine is booting from network and in my network it stays in this state for cca 2 minutes.

At one point, screen will say “Booting under MAAS direction…” That is good. It is not unusual that this doesn’t work at the first attempt. Maybe you will have to attempt booting one or more times. My Intel NUC machines usually won’t boot for the first time.

Ok, so, after we started booting under MAAS direction, we let few screens slide. Somewhere when you are at the “Starting LLDP daemon…” screen, you should go and look to your MAAS controller screen.

So, new machine appeared, and MAAS gave it name “causal-moth”. Click on it

There are few tabs on the machine that you are deploying. We are now interested in “Commissioning” tab, because that is where all the action happens. So far, everything is green, that is good (bmc-config has warning, but that is nothing to be considered about)

While the commissioning is going on (it will finish fast if you have good network and machines) go to the Configuration tab.

This is where you will configure your IPMI under Power type. I really cannot go through all of the settings for every brand, but I know it works since I’m using it with HPE and Intel servers/NUCs. Just make sure you have right IP address and login data for your IPMI. I’m going to select manual, because my VM doesn’t have any kind of IPMI. I selected Manual and then Save changes.

This is full list of supported power devices

Now, back to the Commissioning tab. Commissioning is done, and all is green. In case this phase fails, you will not be able to go further and deploy machine. You will have to troubleshoot and see what is going on.

In our case, everything if fabulous, so we can proceed further. Commissioning phase turned of our machine after it finished (some of my machines keep rebooting after this, but that is nothing to worry about, just make sure they are at BIOS screen when you select Testing phase).

Now, in the top right screen there is a green button that says “Take action” – click on it. Select Test…

Now, if you have IPMI configured, after you select test and define type of tests, your machine will boot automagically. But not mine, since I have manual IPMI type, I will have to boot myself.

Here, I usually just select “Allow SSH…” and leave everything else empty. Select options that you want to retain or test. Click on Test machien when you are done.

Ok, at this point your machine should power up again (or should be at the boot screen, not at the MAAS deployment) but I will have to start up mine manually.

My tests are pending…

In order to deploy your machine, test phase also has to be success, it has to go green, just like Commissioning phase. Also, if test phase fails, see what the errors are, and make sure to correct errors.

Ok, as you can see Tests section is green.

Tests are skipped, but that is because I don’t have smart function on my disks

Main thing is that we got green light, and we can go to the final section. Deployment.

From “Take action” select Deploy…

Again, if you have IPMI, after you defined everything, your machine would reboot and start process automatically. I will have to reboot manually.

As I already said, I will deploy Ubuntu 20.04 LTS with No minimum Kernel option, everything is left default, as it is – Deploy machine

We are now watching Logs section of our machine. It says “System is booting…” I will reboot my machine manually (and also gracefully).

Ok, installation is underway! I also brought my machine screen beneath so you can see how it look like when MAAS is deploying on “bare metal”. Let’s hope this goes well, I had too many failed attempts.

And we are done!! Logs is also in the green with Installation finished status. I had various errors at this stage, you will have to find answer yourself unfortunately. I mentioned above my solution for the error I got, but if it is something wlse, you will have to resolve that with the help of the internet of MAAS community.

Ok, machine is deployed. And what is the login you ask yourself now. I don’t know :)

If you followed my MAAS install and config guides you will have a solution. I already said in the MAAS config part, you need to have your SSH public key imported into MAAS at startup.

That is the only way you will able to access (Ubuntu) machines you deploy via MAAS.

Ok, let’s assume you followed my guides and you deployed SSH public keys on time to your MAAS installation.

We will access our “causal-moth” machine via SSH from the Ubuntu machine on which we created private and public SSH keys. That machine is in the same network as my MAAS deployed – causal-moth Ubuntu machine.

Let’s check IP address of our Ubuntu causal-moth machine

IP address is 10.0.0.5. You will also notice (if you followed my previous config and install guides for MAAS) that IP address is out of our defined DHCP range for MAAS. We defined 10.0.0.102-112 as an DHCP MAAS range, and now my machine has 10.0.0.5, how is that? MAAS DHCP is valid only for PXE booting part and part where you initialize your machines through network. Ater machien is deployed it will get IP from your “other” DHCP source, or will be configured other way, depends on how you deploy machine.

But MAAS DHCP range is only for PXE booting from network.

Ok, now that we know our machine is on 10.0.05 we will access it through SSH. I also defined custom name for my SSH cert (maas1_rsa) so in order for this connection to go well, we have to specify it (otherwise, SSH uses id_rsa by default).

Also, be sure that you access SSH from the machine that has private key part for the public key you imported into MAAS.

MAAS also specifies user ubuntu for deployed machines (don’t use root).

ssh -i ~/.ssh/maas1_rsa ubuntu@10.0.0.5

It works, we are in!!!

So, now you can change user passwords, manage you system as you would any other installation.

That is it, this is simple deployment of Ubuntu on MAAS. Be aware that it can go smooth or be troublesome, and what is not so helpful is that documentation on some topics of MAAS is not very detailed, so sometimes it is all on you.

Disclaimer