[host] Host shutdown idle function#45
Conversation
jandryuk
left a comment
There was a problem hiding this comment.
This needs a corresponding xenmgr change, or the build would break, I think?
| <tp:docstring>Shutdown the host device.</tp:docstring> | ||
| </method> | ||
| <method name="shutdown_idle"> | ||
| <tp:docstring>Called when idle period is determined to have passed</tp:docstring> |
There was a problem hiding this comment.
I've only peeked at the xcpmd changes, and this is "Called when idle period is determined to have passed". That reads to me like this method triggers the shutdown_idle action. However it's use in xcpmd looks more like "returns a boolean stating whether or not Shutdown-on-Idle is enabled." I haven't seen the xenmgr piece, but I think the docstring may need clarification.
There was a problem hiding this comment.
I think the naming could definitely be better, but in this case shutdown_idle is the RPC function call. shutdown_idle is also a xcpmd variable that lives in the db, defined in minutes, of how long the system must be idle before calling this function. shutdown_on_idle is the boolean yes/no that tells xcpmd whether to care about the idle timeout.
There was a problem hiding this comment.
Now that I've looked more at the xcpmd changes, I see that shutdown_idle method is called. So the docstring is:
<tp:docstring>Shutdown the host device. Called when idle period is determined to have passed. </tp:docstring>
How is this different than a plain shutdown?
There was a problem hiding this comment.
The shutdown_idle adds a timeout that will forcefully poweroff the box after a set period. The thinking is, no user input for the specified time should shut off the box. First, we should try to do a graceful shutdown and let all the guest domains clean up, but if a VM gets stuck for some reason, the box won't completely turn off. The extra timeout ensures that the box will be poweroff no matter what, after gracefully trying to shutdown.
There was a problem hiding this comment.
Thanks. Makes sense to force shutdown guests.
So the docstring should be something like:
Shutdown the host devices. VMs which fail to gracefully shutdown are forced off.?
There was a problem hiding this comment.
Yes I can update the docstring to reflect that.
You're right. Xenmgr wasn't rebuilt for me locally so I missed it. I can decouple the idle shutdown stuff and make a PR for that. |
to isolate when this case is called. This allows for a configurable option to force the host to be shut down after the set amount of time has passed while it is attempting to do a regular shutdown. Signed-off-by: Chris Rogers <crogers122@gmail.com>
eca30fd to
96d60dd
Compare
|
Updated the docstring in latest push. |
jandryuk
left a comment
There was a problem hiding this comment.
Thanks.
Needs XenMgr PR before it can be merged.
to isolate when this case is called. This allows for a configurable
option to force the host to be shut down after the set amount of time
has passed while it is attempting to do a regular shutdown.
Signed-off-by: Chris Rogers crogers122@gmail.com