Unable to control power using SNMP on APC AP8941

Bug #1471025 reported by Mathieu Mitchell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Mathieu Mitchell

Bug Description

It is not possible to control a node's power state using SNMP driver on APC AP8941.

~$ ./ironic.sh node-set-power-state 91857852-dc1e-433f-86ca-cfca0748f42e on
~$ ./ironic.sh node-show 91857852-dc1e-433f-86ca-cfca0748f42e
+------------------------+--------------------------------------------------------------------------+
| Property | Value |
+------------------------+--------------------------------------------------------------------------+
| target_power_state | None |
| extra | {u'vif_port_ids': u'["699edfb5-cad4-49a1-992c-572003d5443e", |
| | "48845978-cc2d-4295-a2c7-c499f397f109"]'} |
| last_error | Failed to change power state to 'power on'. Error: SNMP operation 'SET' |
| | failed: 'genErr' |

The power state is affected (it it brought on/off) but Ironic is unhappy with the response. snmpset gives similar results:
# snmpset -Os -c write -v1 pdu_ip_address 1.3.6.1.4.1.318.1.1.4.4.2.1.3.12 int 2
Error in packet.
Reason: (genError) A general failure occured
Failed object: iso.3.6.1.4.1.318.1.1.4.4.2.1.3.12

# snmpset -Os -c write -v1 pdu_ip_address 1.3.6.1.4.1.318.1.1.4.4.2.1.3.12 int 1
Error in packet.
Reason: (genError) A general failure occured
Failed object: iso.3.6.1.4.1.318.1.1.4.4.2.1.3.12

Using rPDUOutletControlOutletCommand (1.3.6.1.4.1.318.1.1.12.3.3.1.1.4) instead of sPDUOutletCtl (1.3.6.1.4.1.318.1.1.4.4.2.1.3) works perfectly on this device. This is also the OID we have been using in the past, for a bunch of APC devices.

sPDU appears to be related to APC's older devices, the MasterSwitch series. APC's current line is called APC Switched Rack PDU (rPDU).

snmpset is happy when using rPDUOutletControlOutletCommand
(USER:ironic/TENANT:services):/opt/ironic# snmpset -Os -c write -v1 pdu_ip_address 1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.12 int 1
iso.3.6.1.4.1.318.1.1.12.3.3.1.1.4.12 = INTEGER: 1

After changing the OID in snmp.py, Ironic is happy to change the power state:

~$ ./ironic.sh node-set-power-state co-r031-140 on
~$ ./ironic.sh node-show co-r031-140
+------------------------+--------------------------------------------------------------------------+
| Property | Value |
+------------------------+--------------------------------------------------------------------------+
| target_power_state | None |
| extra | {u'vif_port_ids': u'["ba6cfe6f-e466-4fcb-b6b4-b72f175ea35c", "027a40b7 |
| | -7c7e-443e-b773-7d9bf4699f51"]'}
| last_error | None | power_state | power on

description: updated
Changed in ironic:
assignee: nobody → Mathieu Mitchell (mat128)
status: New → In Progress
Dmitry Tantsur (divius)
Changed in ironic:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/198149
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=61f2f075694b88f1f5dd8cc8f055d868640ab3d3
Submitter: Jenkins
Branch: master

commit 61f2f075694b88f1f5dd8cc8f055d868640ab3d3
Author: Mathieu Mitchell <email address hidden>
Date: Thu Jul 2 17:59:39 2015 -0400

    Introduce support for APC MasterSwitchPlus and Rack PDU

    Provide 3 new snmp_driver values for different APC product families:
      - apc_masterswitch
      - apc_masterswitchplus
      - apc_rackpdu

    The "apc" snmp_driver is still supported and maps to the MasterSwitch driver
    to avoid breaking backwards compatibility.

    Different APC product families support different OIDs for power control.
      - APC MasterSwitch uses sPDUOutletCtl
      - APC MasterSwitchPlus uses sPDUOutletControlMSPOutletCommand
      - APC Rack PDU uses rPDUOutletControlOutletCommand

    Change-Id: I9d8724543d7da7b1c9cdc180c3396d131ed52615
    Closes-Bug: #1471025

Changed in ironic:
status: In Progress → Fix Committed
Changed in ironic:
milestone: none → 4.0.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.