-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add redfishpower HPE Cray EX chassis device file #173
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,154 @@ | ||
# 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 "chassis0" "cray-ex" "/usr/sbin/redfishpower -h cmm0,pmynode[0-15] |&" | ||
# node "cmm0,myperif[0-7],myblade[0-7],mynode[0-15]" "chassis0" "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 blades[4-7] | ||
# are not populated (thus nodes[8-15] also do not exist). | ||
# | ||
# device "chassis0" "cray-ex" "/usr/sbin/redfishpower -h cmm0,pnode[0-7],unused[0-7] |&" | ||
# node "cmm0,myperif[0-7],myblade[0-3],mynode[0-7]" "chassis0" "Enclosure,Perif[0-7],Blade[0-3],Node[0-7]" | ||
# | ||
specification "cray-ex" { | ||
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> " | ||
# setplugs plugnames hostindices [parentplug] | ||
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> " | ||
# setpath <plugnames> <cmd> <path> [postdata] | ||
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" | ||
Comment on lines
+98
to
+100
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same with
|
||
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> " | ||
# settimeout <seconds> - on/off operations fail on expiration | ||
send "settimeout 75\n" | ||
expect "redfishpower> " | ||
Comment on lines
+111
to
+112
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This timeout deserves quick comment too like
|
||
} | ||
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> " | ||
} | ||
} |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might improve readability a bit if on the first occurrence of
setplugs
there was a comment listing the positional arguments, e.g.