forked from chaos/powerman
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
etc: add device file for HPE Cray EX Chassis
Add device file for a HPE Cray Supercomputing EX Chassis. Fixes chaos#128
- Loading branch information
Showing
2 changed files
with
303 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
302 changes: 302 additions & 0 deletions
302
etc/devices/redfishpower-hpe-cray-supercomputing-ex-chassis.dev
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,302 @@ | ||
# Support for Redfish Rest Interface | ||
# | ||
# How blades and switches in a HPE Cray Supercomputing EX Chassis | ||
# (abbreviated CrayEX) are populated has a large effect on | ||
# configuration. Tweaks to this device file may be needed. See the | ||
# section "UPDATING REDFISHPOWER DEVICE FILES" in redfishpower(8) for | ||
# additional tips. | ||
# | ||
# - Set your system's username/password in the login section of | ||
# each specification below. | ||
# | ||
# General Configuration with "CrayEX" specification | ||
# | ||
# - assuming all blades populated with nodes, all switches populated. | ||
# Take special notice to the order of hosts listed with `-h` as the | ||
# order matters (plugnames are mapped to hosts via indices). cmm | ||
# should be listed first with the 16 nodes second. | ||
# | ||
# include "/etc/powerman/redfishpower-hpe-cray-supercomputing-ex-chassis.dev" | ||
# device "redfishpower" "CrayEX" "/usr/sbin/redfishpower -h -h cmm0,pmynode[0-15] |&" | ||
# node "cmm0,myperif[0-7],myblade[0-7],mynode[0-15]" "redfishpower" "Enclosure,Perif[0-7],Blade[0-7],Node[0-15]" | ||
# | ||
# - If your chassis is not fully populated, put placeholder hosts in | ||
# the redfishpower hosts configuration. Adjust plugs when | ||
# configuring specific targets. For example, let's say perif[4-7] | ||
# and blades[4-7] are not populated (thus nodes[8-15] also do not exist). | ||
# | ||
# device "redfishpower" "redfishpower-CrayEX" "/usr/sbin/redfishpower -h cmm0,pnode[0-7],unused[0-7] |&" | ||
# node "cmm0,myperif[0-3],myblade[0-3],mynode[0-7]" "redfishpower" "Enclosure,Perif[0-3],Blade[0-3],Node[0-7]" | ||
# | ||
# Rabbit Configuration with "CrayEX-rabbit-s4s7" specification | ||
# | ||
# - assuming all blades populated, switches 0-3 populated, rabbit in | ||
# switch 4 & 7, rabbit drive in switch 4, rabbit blade in switch 7. | ||
# Take special notice to the order of hosts listed with `-h` as the | ||
# order matters (plugnames are mapped to hosts via indices). cmm | ||
# should be listed first, the 16 nodes second, and the rabbit last. | ||
# Take note that the plugname "Node16" is used for the rabbit. | ||
# | ||
# include "/etc/powerman/redfishpower-hpe-cray-supercomputing-ex-chassis.dev" | ||
# device "redfishpower" "CrayEX-rabbit-s4s7" "/usr/sbin/redfishpower -h -h cmm0,pmynode[0-15],pmyrabbit0 |&" | ||
# node "cmm0,myperif[0-4,7],myblade[0-7],mynode[0-15],myrabbit0" "redfishpower" "Enclosure,Perif[0-4,7],Blade[0-7],Node[0-16]" | ||
# | ||
# - If your chassis is not fully populated, again put placeholder | ||
# hosts in the redfishpower hosts configuration and adjust plugs | ||
# when configuring specific targets. Let's say blades[4-7] (and | ||
# thus nodes[8-15]) are not populated. | ||
# | ||
# device "redfishpower" "redfishpower-CrayEX-rabbit-s4s7" "/usr/sbin/redfishpower -h cmm0,pmynode[0-7],unused[0-7],pmyrabbit0 |&" | ||
# node "cmm0,myperif[0-4,7],myblade[0-3],mynode[0-7],myrabbit0" "redfishpower" "Enclosure,Perif[0-4,7],Blade[0-3],Node[0-7,16]" | ||
# | ||
specification "redfishpower-CrayEX" { | ||
timeout 100 | ||
|
||
plug name { | ||
"Enclosure" | ||
"Perif0" | ||
"Perif1" | ||
"Perif2" | ||
"Perif3" | ||
"Perif4" | ||
"Perif5" | ||
"Perif6" | ||
"Perif7" | ||
"Blade0" | ||
"Blade1" | ||
"Blade2" | ||
"Blade3" | ||
"Blade4" | ||
"Blade5" | ||
"Blade6" | ||
"Blade7" | ||
"Node0" | ||
"Node1" | ||
"Node2" | ||
"Node3" | ||
"Node4" | ||
"Node5" | ||
"Node6" | ||
"Node7" | ||
"Node8" | ||
"Node9" | ||
"Node10" | ||
"Node11" | ||
"Node12" | ||
"Node13" | ||
"Node14" | ||
"Node15" | ||
} | ||
|
||
script login { | ||
expect "redfishpower> " | ||
send "auth USER:PASS\n" | ||
expect "redfishpower> " | ||
send "setheader Content-Type:application/json\n" | ||
expect "redfishpower> " | ||
send "setplugs Enclosure 0\n" | ||
expect "redfishpower> " | ||
send "setplugs Perif[0-7],Blade[0-7] 0 Enclosure\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[0-1] [1-2] Blade0\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[2-3] [3-4] Blade1\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[4-5] [5-6] Blade2\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[6-7] [7-8] Blade3\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[8-9] [9-10] Blade4\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[10-11] [11-12] Blade5\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[12-13] [13-14] Blade6\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[14-15] [15-16] Blade7\n" | ||
expect "redfishpower> " | ||
send "setpath Enclosure,Perif[0-7],Blade[0-7] stat redfish/v1/Chassis/{{plug}}\n" | ||
expect "redfishpower> " | ||
send "setpath Enclosure,Perif[0-7],Blade[0-7] on redfish/v1/Chassis/{{plug}}/Actions/Chassis.Reset {\"ResetType\":\"On\"}\n" | ||
expect "redfishpower> " | ||
send "setpath Enclosure,Perif[0-7],Blade[0-7] off redfish/v1/Chassis/{{plug}}/Actions/Chassis.Reset {\"ResetType\":\"ForceOff\"}\n" | ||
expect "redfishpower> " | ||
send "setpath Node[0-15] stat redfish/v1/Systems/Node0\n" | ||
expect "redfishpower> " | ||
send "setpath Node[0-15] on redfish/v1/Systems/Node0/Actions/ComputerSystem.Reset {\"ResetType\":\"On\"}\n" | ||
expect "redfishpower> " | ||
send "setpath Node[0-15] off redfish/v1/Systems/Node0/Actions/ComputerSystem.Reset {\"ResetType\":\"ForceOff\"}\n" | ||
expect "redfishpower> " | ||
send "settimeout 60\n" | ||
expect "redfishpower> " | ||
} | ||
script logout { | ||
send "quit\n" | ||
} | ||
# status script used if not targeting all plugs | ||
# - needed if chassis is not fully populated | ||
script status { | ||
send "stat %s\n" | ||
expect "([^\n:]+): ([^\n]+\n)" | ||
setplugstate $1 $2 on="^on\n" off="^off\n" | ||
expect "redfishpower> " | ||
} | ||
script status_all { | ||
send "stat\n" | ||
foreachnode { | ||
expect "([^\n:]+): ([^\n]+\n)" | ||
setplugstate $1 $2 on="^on\n" off="^off\n" | ||
} | ||
expect "redfishpower> " | ||
} | ||
script on_ranged { | ||
send "on %s\n" | ||
foreachnode { | ||
expect "([^\n:]+): ([^\n]+\n)" | ||
setresult $1 $2 success="^ok\n" | ||
} | ||
expect "redfishpower> " | ||
} | ||
script off_ranged { | ||
send "off %s\n" | ||
foreachnode { | ||
expect "([^\n:]+): ([^\n]+\n)" | ||
setresult $1 $2 success="^ok\n" | ||
} | ||
expect "redfishpower> " | ||
} | ||
script cycle_ranged { | ||
send "off %s\n" | ||
expect "redfishpower> " | ||
delay 2 | ||
send "on %s\n" | ||
expect "redfishpower> " | ||
} | ||
} | ||
|
||
# Rabbit takes up 4 switch slots but is powered by 4 & 7. 4 powers | ||
# the drives, 7 powers the node, thus 7 parent of rabbit. | ||
|
||
specification "redfishpower-CrayEX-rabbit-s4s7" { | ||
timeout 100 | ||
|
||
plug name { | ||
"Enclosure" | ||
"Perif0" | ||
"Perif1" | ||
"Perif2" | ||
"Perif3" | ||
"Perif4" | ||
"Perif7" | ||
"Blade0" | ||
"Blade1" | ||
"Blade2" | ||
"Blade3" | ||
"Blade4" | ||
"Blade5" | ||
"Blade6" | ||
"Blade7" | ||
"Node0" | ||
"Node1" | ||
"Node2" | ||
"Node3" | ||
"Node4" | ||
"Node5" | ||
"Node6" | ||
"Node7" | ||
"Node8" | ||
"Node9" | ||
"Node10" | ||
"Node11" | ||
"Node12" | ||
"Node13" | ||
"Node14" | ||
"Node15" | ||
"Node16" | ||
} | ||
|
||
script login { | ||
expect "redfishpower> " | ||
send "auth USER:PASS\n" | ||
expect "redfishpower> " | ||
send "setheader Content-Type:application/json\n" | ||
expect "redfishpower> " | ||
send "setplugs Enclosure 0\n" | ||
expect "redfishpower> " | ||
send "setplugs Perif[0-4,7],Blade[0-7] 0 Enclosure\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[0-1] [1-2] Blade0\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[2-3] [3-4] Blade1\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[4-5] [5-6] Blade2\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[6-7] [7-8] Blade3\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[8-9] [9-10] Blade4\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[10-11] [11-12] Blade5\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[12-13] [13-14] Blade6\n" | ||
expect "redfishpower> " | ||
send "setplugs Node[14-15] [15-16] Blade7\n" | ||
expect "redfishpower> " | ||
send "setplugs Node16 17 Perif7\n" | ||
expect "redfishpower> " | ||
send "setpath Enclosure,Perif[0-4,7],Blade[0-7] stat redfish/v1/Chassis/{{plug}}\n" | ||
expect "redfishpower> " | ||
send "setpath Enclosure,Perif[0-4,7],Blade[0-7] on redfish/v1/Chassis/{{plug}}/Actions/Chassis.Reset {\"ResetType\":\"On\"}\n" | ||
expect "redfishpower> " | ||
send "setpath Enclosure,Perif[0-4,7],Blade[0-7] off redfish/v1/Chassis/{{plug}}/Actions/Chassis.Reset {\"ResetType\":\"ForceOff\"}\n" | ||
expect "redfishpower> " | ||
send "setpath Node[0-16] stat redfish/v1/Systems/Node0\n" | ||
expect "redfishpower> " | ||
send "setpath Node[0-16] on redfish/v1/Systems/Node0/Actions/ComputerSystem.Reset {\"ResetType\":\"On\"}\n" | ||
expect "redfishpower> " | ||
send "setpath Node[0-16] off redfish/v1/Systems/Node0/Actions/ComputerSystem.Reset {\"ResetType\":\"ForceOff\"}\n" | ||
expect "redfishpower> " | ||
send "settimeout 60\n" | ||
expect "redfishpower> " | ||
} | ||
script logout { | ||
send "quit\n" | ||
} | ||
# status script used if not targeting all plugs | ||
# - needed if chassis is not fully populated | ||
script status { | ||
send "stat %s\n" | ||
expect "([^\n:]+): ([^\n]+\n)" | ||
setplugstate $1 $2 on="^on\n" off="^off\n" | ||
expect "redfishpower> " | ||
} | ||
script status_all { | ||
send "stat\n" | ||
foreachnode { | ||
expect "([^\n:]+): ([^\n]+\n)" | ||
setplugstate $1 $2 on="^on\n" off="^off\n" | ||
} | ||
expect "redfishpower> " | ||
} | ||
script on_ranged { | ||
send "on %s\n" | ||
foreachnode { | ||
expect "([^\n:]+): ([^\n]+\n)" | ||
setresult $1 $2 success="^ok\n" | ||
} | ||
expect "redfishpower> " | ||
} | ||
script off_ranged { | ||
send "off %s\n" | ||
foreachnode { | ||
expect "([^\n:]+): ([^\n]+\n)" | ||
setresult $1 $2 success="^ok\n" | ||
} | ||
expect "redfishpower> " | ||
} | ||
script cycle_ranged { | ||
send "off %s\n" | ||
expect "redfishpower> " | ||
delay 2 | ||
send "on %s\n" | ||
expect "redfishpower> " | ||
} | ||
} |