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

redfishpower: drop native "cycle" support #148

Closed
chu11 opened this issue Feb 24, 2024 · 4 comments
Closed

redfishpower: drop native "cycle" support #148

chu11 opened this issue Feb 24, 2024 · 4 comments

Comments

@chu11
Copy link
Member

chu11 commented Feb 24, 2024

Consider if redfishpower should drop native "cycle" support.

Unlike power on, we cannot "wait until on" because with power cycle b/c it is racy. You don't know if the "on" you got is before or after the cycle happened.

Normally no big deal, this is the nature of things, and we support it anyways, just like with ipmipower.

BUT with parent/hierarchy support via #81, this is more problematic. pm --on parentNode,childNode can work, pm --off parentNode,childNode can work, but we just have to outright just not allow pm --cycle parentNode,childNode b/c we can't trust if the parent is actually on after it has been cycled.

Note that "cycle" can still be supported at the powerman level, which will simply define cycle as "off" followed by "on".

@chu11 chu11 changed the title redfishpower: drop "cycle" support redfishpower: drop native "cycle" support Feb 24, 2024
@garlick
Copy link
Member

garlick commented Feb 24, 2024

Unlike power on, we cannot "wait until on" because with power cycle b/c it is racy. You don't know if the "on" you got is before or after the cycle happened.

I'm not sure I follow. What is the sequence of events that is racy?

@chu11
Copy link
Member Author

chu11 commented Feb 25, 2024

I'm not sure I follow. What is the sequence of events that is racy?

  • you send power cycle to node, get response
  • node starts up process to power cycle itself, this can sometimes take a second to start
  • you send power status to node, get "on"

is the status "on" before the power cycle began (i.e. before it was off) or after it was "off" and it is now back "on"?

Remember I'm referring to "native" power cycle of redfish. Powerman may define a "cycle" as an "off" followed by an "on".

For example in redfishpower-supermicro.dev

		expect "redfishpower> "
		send "setonpath redfish/v1/Systems/1/Actions/ComputerSystem.Reset {\"ResetType\":\"On\"}\n"
		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"

b/c native "cycle" is implemented, we do

	script cycle_ranged {
		send "cycle %s\n"
		expect "redfishpower> "
	}

vs in cray-windom, native cycle isn't supported so

	script cycle_ranged {
		send "off %s\n"
		expect "redfishpower> "
		send "on %s\n"
		expect "redfishpower> "
	}

Edit: FWIW, I now see that we made cycle_ranged off and then on in ipmipower.dev, b/c of this exact same reason. ipmipower still supports cycle natively, b/c why not, that's in a different project. But since redfishpower lives inside powerman, the need to support it natively is not as strong.

@garlick
Copy link
Member

garlick commented Feb 25, 2024

Oh sorry, I didn't realize you meant the native redfish protocol. I thought you meant in the redfish program.

Gotcha! Seems fine to just do this in the device script then (off, delay, on).

Thanks for taking the time to explain!

@chu11
Copy link
Member Author

chu11 commented Feb 25, 2024

yeah, i think in device scripts we should just do off, delay, on. But if we do that, we don't need all the cycle stuff in redfishpower anymore (i.e. "setcyclepath", "cycle %s", etc.). Then all future code can be cleaner too, like in my hierarchy support.

Issue is we've released device files with "cycle" in them before. Should redfishpower still support all the cycle stuff (setcyclepath, etc.) for backwards compatibility?

chu11 added a commit to chu11/powerman that referenced this issue Feb 25, 2024
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 chaos#148
@mergify mergify bot closed this as completed in d991241 Feb 25, 2024
chu11 added a commit to chu11/powerman that referenced this issue Apr 4, 2024
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 chaos#148
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants