Unable to relaunch commissioning script

I have tested on maas 3.1 and 3.2 beta 5

I have a custom commissioning script with the following metadata:

# --- Start MAAS 1.0 script metadata ---
# name: 90-mellanox_lldp
# title: Mellanox fix lldp MT27710 Family [ConnectX-4 Lx]
# description: Disable internal lldp to allow the usage from the machine.
# type: commissioning
# script_type: commissioning
# tags: noauto
# for_hardware: pci:15b3:1015
# parallel: disabled
# packages:
#   apt:
#     - gcc
#     - make
#     - dkms
#     - linux-headers-generic
# timeout: 00:08:00
# --- End MAAS 1.0 script metadata ---

This script only runs when the machine is in the state New, if the machine is Ready, no matter how much you select it on the web, it does not run.

The next image shows, that in the ‘Commissioning’ from New to Ready it fails, later I commission the machine without the script (state of the machine now it’s Ready), and now I can’t relaunch the script again.

But if I commission a machine from the cli, it launches:
maas xxxxxx machine commission yyyyyy commissioning_scripts=90-mellanox_lldp

Hi there, would you be able to provide the logs found in the details section for that script?

There is no logs of that script.
The problem is that even if I select the script on the web, it never runs again.

The aborted status of the script in the capture is due a aborted the commissioning for other reasons.
In the capture I relaunch a commissioning (selecting the 90-mellanox_lldp script), the machine is successful commissioned, but the script it’s never launched besides I selected in the WebUI.

I explain again. The first run of the script always launches, but besides it’s finish OK or Failed, I can never relaunch this commissioning script (on the same machine). If I commission the machine trough the cli specifying the script, it launches.

I don’t know if it’s a bug of my installation or desired behavior.

sorry, still a bit confused, so let me try to re-explain & see if I understand correctly:

  1. The 90-mellanox_lldp script runs (but fails) when commissioning a new machine.
  2. The 90-mellanox_lldp script does not run when re-commissioning a ready machine.

Do I understand that correctly?

Hi billwear, I explain better:

I upload the script 90-mellanox_lldp to maas, then commission a new machine. I realize that i forgot to include a proxy to a wget command in the script, so the commissioning of the machine hangs waiting to download a file. Then, I cancel the commissioning, fix the script and reuploaded again using cli (node-script update).

Finally, I try to recommissioning the machine selecting the script in the WebUI, but it never runs again. The behavior it’s the same as I never selected the commissioning script in the WebUI. I try to recommission 2 more times the same machine with the same result.

But, Then the weirdness starts:

  • If I commission a new machine with the script, it runs.
  • If I commission a machine without the script, then recommission with the script it doesn’t run.

I think that can be a issue with the cache in the browser, but I don’t see nothing trough the Inspector.

what if you try doing it again, but don’t forget the proxy? would it work then?

I will do the described above, the script will never be launched.

Another example, with other script:

This machine is in state ‘Ready’ and all scripts OK.

Then I recommission the machine including the script 20-hp_raid_10_hdd:

The machine start commissioning without the script:

If I commission the machine using the cli, then the script appears in the list of commissioning scripts and it launches.

Can be this issue due the scrip has the tag noauto?

that’s a good question, @adolfo94, and i don’t know the answer offhand. lemme research that.

yes, indeed, there we have it: https://maas.io/docs/how-to-deploy-machines#heading--how-to-commission-a-machine

noauto specifically prohibits custom commissioning scripts from running again, as i read this.

oddly, i wrote this, but a long time ago. i trust my memory to the doc, not to my little gray cells. :slight_smile:

m… I had read the docs but I don’t understand the same:

Note that if you are using your own commissioning scripts, and you do not want them to automatically run every time, you must specify noauto, as in this script snippet:

For me it means that if a script has the noauto tag, it will never be executed unless it is specified by the user.

If you do not specify noauto, your custom commissioning scripts will run every time commissioning is attempted.

Any script that doesn’t have the tag noauto always will be executed

Aside the Docs,

I try again to re-launch a commissioning to the same machine selecting the scipt

And if I see the logs the script It’s launched but in the WebUI doesn’t appear

I noticed that the script was launched because in Storage, the physical disks have disappeared and I already see the RAID 10 that this script creates.

So… Mas does what I thought runs the script if I select it through the WebUI, but it does not show up in the WebUI.

yeah, i’m not sure about what that does. i’ll have to run my own custom commissioning scripts and see.

@adolfo94, sorry so long getting back to this.

i ran my own custom commissioning script that just echoes “hello, world”. it wasn’t set to NOAUTO, but it didn’t run, and didn’t produce any output in the WebUI logs. please file a bug.

Hi @billwear, I will do the tests again with the version 3.2.2 and create the bug report.

Thanks for your help and time.

I am not sure if it’s related, but I’m starting to get errors recommissioning a server with some of the built-in scripts. They just say Aborted. No logs or errors that I can see.

I should add, I tried deleting the server from MAAS and re-booting it, and it commissioned just fine.

hmm. that’s interesting.

@tobias-mcnulty, any luck with this so far? just following up here.