From b6e434feae8a55ac218b617d8c8d3c379f3ff529 Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Sat, 24 Feb 2024 18:50:08 -0800 Subject: [PATCH] etc: do not use native cycle with redfishpower Problem: A native power cycle with the redfish protocol is inherently racy. After performing a power cycle and immediately getting the power status, there is no way to know if the power status of "on" is from before or after the cycle. This can be confusing to users. In all redfishpower devices files, define power cycles as an off, delay, and on. Do not use native redfish cycle/restart. Fixes #148 --- etc/devices/redfishpower-cray-r272z30.dev | 6 +++--- etc/devices/redfishpower-supermicro.dev | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/etc/devices/redfishpower-cray-r272z30.dev b/etc/devices/redfishpower-cray-r272z30.dev index 23811d0e..f833cd0b 100644 --- a/etc/devices/redfishpower-cray-r272z30.dev +++ b/etc/devices/redfishpower-cray-r272z30.dev @@ -29,8 +29,6 @@ specification "redfishpower-cray-r272z30" { expect "redfishpower> " send "setoffpath redfish/v1/Systems/Self/Actions/ComputerSystem.Reset {\"ResetType\":\"ForceOff\"}\n" expect "redfishpower> " - send "setcyclepath redfish/v1/Systems/Self/Actions/ComputerSystem.Reset {\"ResetType\":\"ForceRestart\"}\n" - expect "redfishpower> " send "settimeout 60\n" expect "redfishpower> " } @@ -54,7 +52,9 @@ specification "redfishpower-cray-r272z30" { expect "redfishpower> " } script cycle_ranged { - send "cycle %s\n" + send "off %s\n" + expect "redfishpower> " + send "on %s\n" expect "redfishpower> " } } diff --git a/etc/devices/redfishpower-supermicro.dev b/etc/devices/redfishpower-supermicro.dev index c73b39dc..91b1e336 100644 --- a/etc/devices/redfishpower-supermicro.dev +++ b/etc/devices/redfishpower-supermicro.dev @@ -29,8 +29,6 @@ specification "redfishpower-supermicro" { expect "redfishpower> " send "setoffpath redfish/v1/Systems/1/Actions/ComputerSystem.Reset {\"ResetType\":\"ForceOff\"}\n" expect "redfishpower> " - send "setcyclepath redfish/v1/Systems/1/Actions/ComputerSystem.Reset {\"ResetType\":\"ForceRestart\"}\n" - expect "redfishpower> " send "settimeout 60\n" expect "redfishpower> " } @@ -54,7 +52,9 @@ specification "redfishpower-supermicro" { expect "redfishpower> " } script cycle_ranged { - send "cycle %s\n" + send "off %s\n" + expect "redfishpower> " + send "on %s\n" expect "redfishpower> " } }