Skip to content
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 2 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions etc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pkgsysconf_DATA = \
devices/redfishpower-cray-r272z30.dev \
devices/redfishpower-supermicro.dev \
devices/redfishpower-cray-windom.dev \
devices/redfishpower-cray-ex.dev \
devices/phantom.dev \
devices/plmpower.dev \
devices/powerman.dev \
Expand Down
154 changes: 154 additions & 0 deletions etc/devices/redfishpower-cray-ex.dev
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> "
Comment on lines +77 to +80
Copy link
Member

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.

# setplugs pluglist hostindex [parent plug]

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with setpath e.g.

# setpath pluglist {stat|on|off} path

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This timeout deserves quick comment too like

# settimeout [seconds] - on/off operations fail on expiration

}
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> "
}
}
3 changes: 2 additions & 1 deletion t/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ TESTSCRIPTS = \
t0033-valgrind.t \
t0034-redfishpower.t \
t0035-power-result.t \
t0036-diagnostics.t
t0036-diagnostics.t \
t0037-cray-ex.t

# make check runs these TAP tests directly (both scripts and programs)
TESTS = \
Expand Down
Loading
Loading