We’re trialling a rollout of MAAS but ran into one issue which I couldn’t find any information about.
After MAAS finishes a commission, running tests, etc, it shuts down the server. I’ve seen that if I manually run a commission then I can set to not shut down, but is there an option to globally prevent MAAS from shutting down the server?
A lot of our servers don’t run IPMI, and instead, we have a system where we can trigger the reset header on the motherboard. As a result, we don’t want to wait hours for a datacenter technician to start the server every time MAAS shuts it down.
I’ve already got the power set to manual. I’ve span up a VM to simulate my test physical server, so I don’t need to keep getting a technician to start the server as I debug.
So MAAS has finished commissioning the server, and it has the status “Ready”. Now, every time the server (test VM) boots, it loads from PXE, loads Ubuntu, then shuts down as soon as it reaches the login screen. The power type is still set to manual, so the shut down comes from the cloud-init config/some script that MAAS provides.
That’s what I’d like to know how to modify so it does not shut down—checking the checkbox to prevent shutdown before commissioning works just one time but not for future boots.
EDIT: Just did some more testing:
Commission server from MAAS and select “Allow SSH access and prevent machine powering off”. It commissions, changes status to ready, and stays online.
Reboot the server and it boots from PXE. It runs a shutdown command once it’s loaded and turns off. ← I need to prevent this from happening
If you want the machine to stay up, I think the simple solution is to put it into the Deployed state and power it on. This will write the selected OS image to the disk and then leave the system powered up for use.
Thanks for the suggestion. I’ve thought about this and it does work well. I still run the risk of a server booting from PXE and loading the ephemeral then shutting down after, though it is reduced if servers are all in the deployed state.
EDIT: I have found out that MAAS shuts down the server by providing poweroff to the cloud-init module “power-state” that the ephemeral loads. I need to edit this cloud-init config the ephemeral gets to remove that and my problem is sorted. How can I do this?
Unfortunately, we can’t ask the datacenter to enable iLO on the servers because the servers aren’t HP and most don’t have any form of BMC/IPMI altogether. We have a system where we can trigger the reset header on the motherboard to restart it.
If we had IPMI on the servers, we’d have no issue as MAAS would be able to start the server back up when it’s needed, etc.
So if the bare metal deployment is not the case , I would have gone for a hypervisor such as proxmox or esxi then on top of hyeprvisor I’d provision the vms and so on.
I had the idea of making my own custom preseed file (curtin_userdata) as all the others are just “{{preseed_data}}” from this MAAS logic. But, unfortunately, this file is only loaded while a server is deploying and not in any other state. Otherwise, I would have added a touch command to make a file that the shutdown logic tests always.
I cannot just modify this file as MAAS is built, then shipped as a Snap, so I was wondering if a feature could be added that will allow my use case/fix this issue:
I had in mind that MAAS has a setting per controller that allows adjusting this to change the default behaviour from poweroff to reboot and apply this to specific power action types? So, for example, it could be set where servers with the power type as manual or webhook will reboot and never shut down, but MAAS can shut down servers with IPMI.