deltacloud/deltacloud-core — pull request #44 by dellinger (2013-06-04 19:56:11+00:00)
Title: Provided "Start" and "Stop" support for EC2 Instances

I changed the Finite State Machine for Instance States to include a "STOPPED" state, instead of automatically going to "FINISH".

In Amazon's world, there are "Instance Store" instances which cannot be stopped, only terminated and there are "EBS" instances which can be stopped, started,rebooted. To handle these two types, in the "stop_instance" method I check the EC2 instance to see what 'root_device_type' it has and if it is "EBS", the instance runs the original stop code. Otherwise, if it is not EBS I call the "destroy_instance" method on the instance.

It would be better to be able to change the actual states to reflect this logic.