DMTF / Redfish-Usecase-Checkers

This is a collection of python3 tools to exercise and validate common use cases for Redfish
Other
1 stars 6 forks source link

About power_control ForceRestart #57

Closed FelixD999 closed 1 year ago

FelixD999 commented 2 years ago

Hi, When I sent power control command: python3 power_control.py -r 192.168.0.116 -u -p -S Always

Found 1 system instances Resetting Self using ForceOff Task is Done! Monitoring power state for Self... Resetting Self using ForceRestart Monitoring power state for Self... ERROR: Self was not in the On state after using ForceRestart as the reset type. Resetting Self using GracefulShutdown Monitoring power state for Self... Resetting Self using On Task is Done! Monitoring power state for Self...

I refer the schema ComputerSystem.v1_15_0.json mention "The ForceRestart value shall perform a ForceOff action, followed by an On action.". And refer an example in Specification: Usecase_power_forcerestart

So I think whether the ForceRestart should not be after ForceOff then avoid show Error message.

Thanks.

mraineri commented 2 years ago

The expectation is that the service should perform whatever is necessary to get the system in the end result state. So, in the example you highlighted, since the system was already On, this is a no-operation.

Specifically for what you're encountering, since the system is already powered off, the expectation is the end result of a forced restart would be to bring the system back online. We have this behavior in the long description for ForceRestart:

This value shall indicate the resource will transition to a power on state, after transiting through a restart. The transition will start immediately.

So, even if the system is off, we'd still expect some sort of restart to happen with the system in the "On" state by the end of the operation.

FelixD999 commented 2 years ago

Thanks for your answer. But "The ForceRestart value shall perform a ForceOff action, followed by an On action." I didn't observe host trun on. So I guess ERROR message show "Self was not in the On state after using ForceRestart as the reset type." ascribe to it need ForceOff action again resulting in ForceRestart run not sucess. Maybe whether add On action before ForceRestart action will run more reasonably?

mraineri commented 2 years ago

The problem is we see simple reset scripts that want to just cycle through all systems and perform the same action; they're going to blindly perform a single reset against all systems without doing state checks first.

ForceRestart doesn't need to internally perform a ForceOff prior to bringing the system online; if it's already off, it just needs to turn it on.

mraineri commented 1 year ago

Closing; based on the details seen, the tool is calling out undesirable behavior based on guidance from the Redfish Forum.