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
152 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
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,151 @@ | ||
# 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. | ||
# | ||
# - Assuming all blades are populated with nodes and all switches are | ||
# populated, configure in Powerman like below. | ||
# | ||
# Take special notice to the order of hosts listed with `-h` as the | ||
# order matters (plugnames are mapped to hosts via indices). The cmm | ||
# should be listed first with the 16 nodes second. | ||
# | ||
# include "/etc/powerman/redfishpower-cray-ex.dev" | ||
# device "redfishpower" "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]" | ||
# | ||
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 75\n" | ||
expect "redfishpower> " | ||
} | ||
script logout { | ||
send "quit\n" | ||
} | ||
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> " | ||
} | ||
} |