How do I use MAAS custom commissioning scripts?

I am attempting to use a custom MAAS commissioning script to perform custom operations on my MAAS cluster. When do these scripts run? How should they be named? Do they need to be in a particular format, or can they be executable shell scripts or binaries?


Please find steps to achieve this:

Step 1: prepare shell script as per your requirement Note: Commissioning scripts built into MAAS will have names starting with "00-maas" or "99-maas" to ensure that they run first or last, respectively.

Step 2 : Open MAAS Dashboard ( http://localhost:5240/MAAS/settings/ ) and Go to “Setting” tab.

Step 3 : Upload your shell script under commissioning script section.

Step 4 : Start commissioning for target machine and reboot the target machine.

Besides, following Restful MaaS API also available to perform the same.

List commissioning scripts: GET /api/2.0/commissioning-scripts/

Create a new commissioning script: POST /api/2.0/commissioning-scripts/

Ref: https://docs.ubuntu.com/maas/2.1/en/api