You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2010/12/07 17:15:22 UTC

very minor fix for ec2 driver - instance state

This is literally a one line fix... talking about this with Michal got me interested so I looked at the ec2 driver. Basically, in the 'convert_state' method we are translating the 'terminated' state reported by amazon into 'stopped' in the deltacloud ec2 state machine. This means that the 'start' action is still available, and the instance is reported as 'stopped' rather than 'terminated' (which is what you would see in the aws console). Eventually Amazon removes the instance alltogether but is very slow to do that,

marios

Re: [PATCH] very minor fix to ec2 driver for reporting when instance is terminated - removes the ability to 'start' a terminated instance

Posted by Chris Lalancette <cl...@redhat.com>.
On 12/07/10 - 06:15:23PM, marios@redhat.com wrote:
> From: marios <ma...@redhat.com>
> 
> ---
>  server/lib/deltacloud/drivers/ec2/ec2_driver.rb |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> index fff3663..fb5a0f4 100644
> --- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> +++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> @@ -574,7 +574,7 @@ class EC2Driver < Deltacloud::BaseDriver
>    def convert_state(ec2_state)
>      case ec2_state
>      when "terminated"
> -      "STOPPED"
> +      "TERMINATED"
>      when "stopped"
>        "STOPPED"
>      when "running"

As we discussed on IRC, we do want to introduce a TERMINATED state back, but
I think we need to do it in a slightly less ad-hoc fashion.  These states
are visible to the clients, and as such, they need to be consistently defined
across all of the drivers.  If we are going to add this back, what I would
like to see is:

1)  This applied consistently to all of the drivers where it makes sense
2)  The meaning of the various client-visible states documented for future
driver writers
3)  Some sort of ruby construct to try to enforce a consistent set of
externally visible states (this may not be possible).

NACK for now.

-- 
Chris Lalancette

[PATCH] very minor fix to ec2 driver for reporting when instance is terminated - removes the ability to 'start' a terminated instance

Posted by ma...@redhat.com.
From: marios <ma...@redhat.com>

---
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index fff3663..fb5a0f4 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -574,7 +574,7 @@ class EC2Driver < Deltacloud::BaseDriver
   def convert_state(ec2_state)
     case ec2_state
     when "terminated"
-      "STOPPED"
+      "TERMINATED"
     when "stopped"
       "STOPPED"
     when "running"
-- 
1.7.2.3