The observed behaviour is the machine powers up, commissioning is successful and then MAAS fails to power it off. What actually happens is that MAAS powers up the machine with the used-supplied power-parameters, runs 30-bmc-config with the default parameter values (maas_auto_ipmi_user and maas_auto_ipmi_user_password) and overwrites the user values with the detected ones (changing the power driver to LAN_2), and then it fails to power it off because the new values are invalid.
The fix is to change the script to use existing power parameters if present.
2) the user skips BMC configuration adding skip_bmc_config=1 to the command line
MAAS is running the script even when unsolicited in some scenarios. I'm still looking for what triggers this bug. The observed behaviour is that MAAS crashes when the script reports back its results, which is unexpected because the script status is skipped:
2022-02-04 16:13:35 maasserver: [error] ################################ Exception: ################################
2022-02-04 16:13:35 maasserver: [error] Traceback (most recent call last):
File "/snap/maas/18203/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/snap/maas/18203/lib/python3.8/site-packages/maasserver/utils/views.py", line 284, in view_atomic_with_post_commit_savepoint
return view_atomic(*args, **kwargs)
File "/usr/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/snap/maas/18203/lib/python3.8/site-packages/maasserver/api/support.py", line 56, in __call__
response = super().__call__(request, *args, **kwargs)
File "/snap/maas/18203/usr/lib/python3/dist-packages/django/views/decorators/vary.py", line 20, in inner_func
response = func(*args, **kwargs)
File "/snap/maas/18203/usr/lib/python3.8/dist-packages/piston3/resource.py", line 197, in __call__
result = self.error_handler(e, request, meth, em_format)
File "/snap/maas/18203/usr/lib/python3.8/dist-packages/piston3/resource.py", line 195, in __call__
result = meth(request, *args, **kwargs)
File "/snap/maas/18203/lib/python3.8/site-packages/maasserver/api/support.py", line 308, in dispatch
return function(self, request, *args, **kwargs)
File "/snap/maas/18203/lib/python3.8/site-packages/metadataserver/api.py", line 817, in signal
target_status = process(node, request, status)
File "/snap/maas/18203/lib/python3.8/site-packages/metadataserver/api.py", line 641, in _process_commissioning
self._store_results(
File "/snap/maas/18203/lib/python3.8/site-packages/metadataserver/api.py", line 529, in _store_results
script_result.store_result(
File "/snap/maas/18203/lib/python3.8/site-packages/metadataserver/models/scriptresult.py", line 274, in store_result
assert self.status in SCRIPT_STATUS_RUNNING_OR_PENDING
AssertionError
we found two issues while debugging this:
1) the user forces an IPMI version
maas root machines create hostname=test-13 \ arm64/generic \ addresses= XX:XX:XX: XX:XX:XX \ parameters_ power_address= XXX.XXX. XXX.XXX \ parameters_ power_user= admin \ parameters_ power_pass= admin \ parameters_ power_driver= LAN \ parameters_ power_boot_ type=efi
zone=zone1 architecture=
mac_
power_type=ipmi \
power_
power_
power_
power_
power_
The observed behaviour is the machine powers up, commissioning is successful and then MAAS fails to power it off. What actually happens is that MAAS powers up the machine with the used-supplied power-parameters, runs 30-bmc-config with the default parameter values (maas_auto_ ipmi_user and maas_auto_ ipmi_user_ password) and overwrites the user values with the detected ones (changing the power driver to LAN_2), and then it fails to power it off because the new values are invalid.
The fix is to change the script to use existing power parameters if present.
2) the user skips BMC configuration adding skip_bmc_config=1 to the command line
MAAS is running the script even when unsolicited in some scenarios. I'm still looking for what triggers this bug. The observed behaviour is that MAAS crashes when the script reports back its results, which is unexpected because the script status is skipped:
2022-02-04 16:13:35 maasserver: [error] ####### ####### ####### ####### #### Exception: ####### ####### ####### ####### #### maas/18203/ usr/lib/ python3/ dist-packages/ django/ core/handlers/ base.py" , line 113, in _get_response callback( request, *callback_args, **callback_kwargs) maas/18203/ lib/python3. 8/site- packages/ maasserver/ utils/views. py", line 284, in view_atomic_ with_post_ commit_ savepoint python3. 8/contextlib. py", line 75, in inner maas/18203/ lib/python3. 8/site- packages/ maasserver/ api/support. py", line 56, in __call__ .__call_ _(request, *args, **kwargs) maas/18203/ usr/lib/ python3/ dist-packages/ django/ views/decorator s/vary. py", line 20, in inner_func maas/18203/ usr/lib/ python3. 8/dist- packages/ piston3/ resource. py", line 197, in __call__ handler( e, request, meth, em_format) maas/18203/ usr/lib/ python3. 8/dist- packages/ piston3/ resource. py", line 195, in __call__ maas/18203/ lib/python3. 8/site- packages/ maasserver/ api/support. py", line 308, in dispatch maas/18203/ lib/python3. 8/site- packages/ metadataserver/ api.py" , line 817, in signal maas/18203/ lib/python3. 8/site- packages/ metadataserver/ api.py" , line 641, in _process_ commissioning _store_ results( maas/18203/ lib/python3. 8/site- packages/ metadataserver/ api.py" , line 529, in _store_results result. store_result( maas/18203/ lib/python3. 8/site- packages/ metadataserver/ models/ scriptresult. py", line 274, in store_result STATUS_ RUNNING_ OR_PENDING
2022-02-04 16:13:35 maasserver: [error] Traceback (most recent call last):
File "/snap/
response = wrapped_
File "/snap/
return view_atomic(*args, **kwargs)
File "/usr/lib/
return func(*args, **kwds)
File "/snap/
response = super()
File "/snap/
response = func(*args, **kwargs)
File "/snap/
result = self.error_
File "/snap/
result = meth(request, *args, **kwargs)
File "/snap/
return function(self, request, *args, **kwargs)
File "/snap/
target_status = process(node, request, status)
File "/snap/
self.
File "/snap/
script_
File "/snap/
assert self.status in SCRIPT_
AssertionError