Comment 0 for bug 1302828

Revision history for this message
Blake Rouse (blake-rouse) wrote :

How to Reproduce:

Check multiple SM15k nodes in MAAS, using the drop-down select "Start selected nodes". Some nodes will succeed, others will fail with PowerActionFail.

Error Output:

[2014-04-04 20:41:35,135: ERROR/Worker-8] power_on: sm15k failed: Command '# -*- mode: shell-script -*-
#
# Control a system via ipmipower, sending the seamicro specific hex codes
#

# Parameters
power_change=on
power_address=***.***.***.***
power_user=admin
power_pass=******
power_control=restapi2
system_id=48
ipmitool=/usr/bin/ipmitool

# IPMI power mode
power_mode=1

# Control power using IPMI
issue_ipmi_command() {
    ${ipmitool} -I lanplus \
        -H ${power_address} -U ${power_user}\
        -P ${power_pass} raw 0x2E 1 0x00 0x7d 0xab \
        ${power_mode} 0 ${system_id}
}

# Control power using REST v0.9
issue_rest_v09_command() {
python - << END
from provisioningserver.custom_hardware.seamicro import power_control_seamicro15k_v09
power_control_seamicro15k_v09("${power_address}", "${power_user}", "${power_pass}", "${system_id}", "${power_change}")
END
}

# Control power using REST v2
issue_rest_v2_command() {
python - << END
from provisioningserver.custom_hardware.seamicro import power_control_seamicro15k_v2
power_control_seamicro15k_v2("${power_address}", "${power_user}", "${power_pass}", "${system_id}", "${power_change}")
END
}

if [ "${power_control}" = "ipmi" ]
then
    issue_ipmi_command
elif [ "${power_control}" = "restapi" ]
then
    issue_rest_v09_command
elif [ "${power_control}" = "restapi2" ]
then
    issue_rest_v2_command
fi
' returned non-zero exit status 1:
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/lib/python2.7/dist-packages/provisioningserver/custom_hardware/seamicro.py", line 331, in power_control_seamicro15k_v2
    server.power_on()
  File "/usr/lib/python2.7/dist-packages/seamicroclient/v2/servers.py", line 28, in power_on
    self.manager.power_on(self, using_pxe)
  File "/usr/lib/python2.7/dist-packages/seamicroclient/v2/servers.py", line 114, in power_on
    self._action('power-on', server, action_params)
  File "/usr/lib/python2.7/dist-packages/seamicroclient/v2/servers.py", line 219, in _action
    return self.api.client.put(url, body=body)
  File "/usr/lib/python2.7/dist-packages/seamicroclient/client.py", line 194, in put
    return self._cs_request(url, 'PUT', **kwargs)
  File "/usr/lib/python2.7/dist-packages/seamicroclient/client.py", line 185, in _cs_request
    raise e
seamicroclient.exceptions.Unauthorized: Failure: SESSION_INVALID (HTTP 401)
[2014-04-04 20:41:35,138: ERROR/MainProcess] Task provisioningserver.tasks.power_on[de917f8f-2d54-4efd-b541-bdc5fc81acfc] raised unexpected: PowerActionFail()
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/celery/app/trace.py", line 218, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/celery/app/trace.py", line 398, in __protected_call__
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/provisioningserver/tasks.py", line 93, in wrapper
    func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/provisioningserver/tasks.py", line 179, in power_on
    issue_power_action(power_type, 'on', **kwargs)
  File "/usr/lib/python2.7/dist-packages/provisioningserver/tasks.py", line 164, in issue_power_action
    pa.execute(**kwargs)
  File "/usr/lib/python2.7/dist-packages/provisioningserver/power/poweraction.py", line 133, in execute
    self.run_shell(rendered)
  File "/usr/lib/python2.7/dist-packages/provisioningserver/power/poweraction.py", line 121, in run_shell
    raise PowerActionFail(self, e)
PowerActionFail