Inspired by this post I tried to change the cloud-init power state setting in the MAAS server python code from “poweroff” to “restart”.
In order to make that, I had to install MAAS as a deb package and then edit the correct file located at /usr/lib/python3/dist-packages/maasserver/compose_preseed.py
. Then just restart MAAS (e.g. using systemd restart for each of the maas* units, but don’t bother: I just rebooted the whole server).
The effect is that we now have the nodes doing repeated reboots at the “Ready” stage. This is more acceptable, but would use more power than necessary.
EDIT:
The cloud-init specification for the power state change module states that “If mode
is any value other than poweroff
, halt
, or reboot
, then no action will be taken.”
Hence, if we change the in the line from “poweroff” to e.g. “any” then we achieve the desired result.
If we want to deploy a machine we now will have to power cycle it using the remote controllable power switch. Then at the next netboot the machine will be set up properly.