← Back to team overview

openstack team mailing list archive

Understanding shutdown VM behavior

 

shutdown, stop, are power_off are synonym in this discussion. They all
mean to stop the VM from running, but keep the disk image and network,
so that the VM could be started back on again.

There are three ways to do it: 1) using EC2 stop-instance API. 2) use
OS API stop-server. 3) inside the VM, execute halt or equivalent.
However, the devil is in the details.

In EC2 API, a shutdown_terminate flag is checked when a stop-instance
call is issued. If it's true, then stop-instances actually means
terminate instances. The flag is true by default unless there is block
device mapping provided, and it doesn't appear to be configurable by a
user.

In OS API, it's defined in v1.1, neither the specification nor the
implementation check the shutdown_terminate flag at all. It will
always do stop instead of terminate.

So, when shutdown_terminate is true (default), the OS API and the EC2
API will behave differently. If we accept this, it might still be
acceptable. After all they are different APIs and could have different
behavior. But the pickle is the case where a user initiates a shutdown
inside the VM. What's the expected behavior after it's detected?
Should it respect the shutdown_terminate flag or work more like an OS
API?  Right now when a shutdown in a VM is detected, the vm state is
updated to SHUTOFF and that's pretty much it..

To summarize, there are 3 ways of doing the same thing, each now has a
different behavior. I'd vote to patch the code to be a little more
consistent. But what should be the right behavior?

Yun


Follow ups