I have been working on modifying the EC2 Driver to accommodate "EBS" backed
instance ("persistent") and "S3 backed" instances (transient). At the moment
the deltacloud actions are for S3 backed instanced. So when "STOP" is used, the
instance is terminated.
I have a requirement to make it so I can perform a "STOP" on EBS backed
instances.
So I've modified the EC2 driver to have a new Finite State Machine for
"instance states", now when STOP is performed, the state goes to "stopped"
instead of "finish", and then when DESTROY is performed the instance state goes
to "finish".
This works great with persistent instances, but now I have an issue with
transient instances. Since STOP is not an applicable EC2 action for these
instances, I get an EC2 error.
My solution ---
I would like to make it so when "STOP" is performed, it checks to see if the
instance is persistent or transient. If it is persistent, then I would like to
perform the STOP action, otherwise if it is transient I would like to perform
the DESTROY action.
I unfortunately am not familiar enough with Ruby to make this particular
change. So I'm asking if anyone knows of a better solution, or how to check the
instance type and where that should be implemented in the driver.
I appreciate any assistance on this,
Thank you