<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I did some cleanup of stop and power_off in the review here.<div><br></div><div><a href="https://review.openstack.org/#/c/8021/">https://review.openstack.org/#/c/8021/</a></div><div><br></div><div>I removed the weird  shutdown_terminate handling. Honestly I feel like</div><div>that is compatibility we don't need. It should be up to the provider whether</div><div>a stop_instances counts as a terminate. In my mind they are two different things.</div><div><br></div><div>Comments welcome on the review.</div><div><br></div><div>Vish</div><div><br><div><div>On May 31, 2012, at 6:40 PM, Yun Mao wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>shutdown, stop, are power_off are synonym in this discussion. They all<br>mean to stop the VM from running, but keep the disk image and network,<br>so that the VM could be started back on again.<br><br>There are three ways to do it: 1) using EC2 stop-instance API. 2) use<br>OS API stop-server. 3) inside the VM, execute halt or equivalent.<br>However, the devil is in the details.<br><br>In EC2 API, a shutdown_terminate flag is checked when a stop-instance<br>call is issued. If it's true, then stop-instances actually means<br>terminate instances. The flag is true by default unless there is block<br>device mapping provided, and it doesn't appear to be configurable by a<br>user.<br><br>In OS API, it's defined in v1.1, neither the specification nor the<br>implementation check the shutdown_terminate flag at all. It will<br>always do stop instead of terminate.<br><br>So, when shutdown_terminate is true (default), the OS API and the EC2<br>API will behave differently. If we accept this, it might still be<br>acceptable. After all they are different APIs and could have different<br>behavior. But the pickle is the case where a user initiates a shutdown<br>inside the VM. What's the expected behavior after it's detected?<br>Should it respect the shutdown_terminate flag or work more like an OS<br>API?  Right now when a shutdown in a VM is detected, the vm state is<br>updated to SHUTOFF and that's pretty much it..<br><br>To summarize, there are 3 ways of doing the same thing, each now has a<br>different behavior. I'd vote to patch the code to be a little more<br>consistent. But what should be the right behavior?<br><br>Yun<br><br>_______________________________________________<br>Mailing list: <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><br>Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>Unsubscribe : <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><br>More help   : <a href="https://help.launchpad.net/ListHelp">https://help.launchpad.net/ListHelp</a><br></div></blockquote></div><br></div></body></html>