
Sam Johnston <samj@samj.net> writes:
So the question is do you ask a "RUNNING" resource to "STOP" by pressing a button in order to get it to the "STOPPED" state or do you update its status from "RUNNING" to "STOPPED". To me the latter is unclean because who are you to say you're going to get to that state immediately, or indeed that you'll even get there at all
Indeed. We have a classic example of this in our own public cloud. For us, guests can go away by being 'destroyed' (hard kill) or because the operating system inside has executed an ACPI power-down, essentially asking to be destroyed. We have an action 'shutdown' which sends an ACPI power-button event to the guest OS. This may result in a successful shutdown (leading to an ACPI power-down and guest destruction), it may be ignored, or it may trigger something completely different. (I've used it for server-wide SIGHUP-type behaviour before.) Because of this, even ignoring the delay in state change, it's not clear that our 'shutdown' event meaningfully maps to any particular state change because from outside the vm abstraction: we don't know what effect on state the power-button event will actually have! Cheers, Chris.