You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2013/06/28 11:06:30 UTC

[1/9] git commit: Fixed instance state conversion. Tested EBS instance for start/stop/reboot. Works fine

Updated Branches:
  refs/heads/master 9ea3eeb06 -> fd92d39d4


Fixed instance state conversion. Tested EBS instance for start/stop/reboot. Works fine


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/9e53cb09
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/9e53cb09
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/9e53cb09

Branch: refs/heads/master
Commit: 9e53cb09f338a567d1d079c72ca3507ea8bbefb1
Parents: eb329da
Author: David Ellinger <de...@ltionline.com>
Authored: Fri May 24 13:59:42 2013 -0400
Committer: marios <ma...@redhat.com>
Committed: Fri Jun 28 12:05:49 2013 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/9e53cb09/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index f462b37..7c41aeb 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -27,7 +27,6 @@ class Instance
   def authn_feature_failed?
     return true unless authn_error.nil?
   end
-
 end
 
 module Deltacloud
@@ -126,15 +125,21 @@ module Deltacloud
         define_instance_states do
           start.to( :pending )          .automatically
           pending.to( :running )        .automatically
-          pending.to( :stopping )       .on( :stop )
-          pending.to( :stopped )        .automatically
-          stopped.to( :running )        .on( :start )
           running.to( :running )        .on( :reboot )
           running.to( :stopping )       .on( :stop )
           stopping.to(:stopped)         .automatically
-
+          stopped.to( :running )        .on( :start )
           stopped.to(:finish)         .on( :destroy)
 
+          #pending.to( :stopping )       .on( :stop )
+          #pending.to( :stopped )        .automatically
+
+          
+         
+          
+
+          
+
         end
 
         # We do not allow users to set the endpoint through environment
@@ -1248,11 +1253,13 @@ module Deltacloud
         def convert_state(ec2_state)
           case ec2_state
             when "terminated"
-              "STOPPED"
+              "FINISH"
             when "stopped"
               "STOPPED"
             when "running"
               "RUNNING"
+            when "stopping"
+              "STOPPING"
             when "pending"
               "PENDING"
             when "shutting-down"


[3/9] git commit: Added 'stop' functionality to ec2 driver

Posted by ma...@apache.org.
Added 'stop' functionality to ec2 driver

Added new state, added stop method, removed alias.


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/4d62d3c4
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/4d62d3c4
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/4d62d3c4

Branch: refs/heads/master
Commit: 4d62d3c4fdd27164899df41b28b5f964598414ed
Parents: 9ea3eeb
Author: David Ellinger <de...@ltionline.com>
Authored: Mon Apr 29 09:43:59 2013 -0400
Committer: marios <ma...@redhat.com>
Committed: Fri Jun 28 12:05:49 2013 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/4d62d3c4/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index f258dfb..b740254 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -132,8 +132,9 @@ module Deltacloud
           running.to( :running )        .on( :reboot )
           running.to( :stopping )       .on( :stop )
           stopping.to(:stopped)         .automatically
-          stopping.to(:finish)          .automatically
-          stopped.to( :finish )         .automatically
+
+          stopped.to(:finish)         .on( :destroy)
+
         end
 
         # We do not allow users to set the endpoint through environment
@@ -319,6 +320,16 @@ module Deltacloud
           end
         end
 
+        def stop_instance(credentials, instance_id)
+          ec2 = new_client(credentials)
+          if ec2.stop_instances([instance_id])
+            instance(credentials, :id => instance_id)
+          else
+            raise Deltacloud::BackendError.new(500, "Instance", "Instance stop failed", "")
+          end
+        end
+
+
         def destroy_instance(credentials, instance_id)
           ec2 = new_client(credentials)
           if ec2.terminate_instances([instance_id])
@@ -328,8 +339,6 @@ module Deltacloud
           end
         end
 
-        alias :stop_instance :destroy_instance
-
         def metrics(credentials, opts={})
           cw = new_client(credentials, :mon)
           metrics_arr = []


[6/9] git commit: Added note

Posted by ma...@apache.org.
Added note


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/a426922e
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/a426922e
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/a426922e

Branch: refs/heads/master
Commit: a426922e289d45c541b81bc628660f02db0ff2b4
Parents: 4776726
Author: David Ellinger <de...@ltionline.com>
Authored: Tue Jun 4 15:59:38 2013 -0400
Committer: marios <ma...@redhat.com>
Committed: Fri Jun 28 12:05:50 2013 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a426922e/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 16d7d18..da627c5 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -332,9 +332,7 @@ module Deltacloud
 
         def stop_instance(credentials, instance_id)
           ec2 = new_client(credentials)
-          #TODO: If image root is ebs (or persistent) then stop instance otherwise need to run "destroy_instance"
-          #ec2_instance = ec2.instances[:instance_id]
-          #if ec2_instance.root_device_type == "ebs"
+          # Non EBS backed instances cannot be stopped and only can be terminated.
           ec2_inst = ec2.describe_instances([instance_id]).first
           if ec2_inst[:root_device_type] == "ebs"
             if ec2.stop_instances([instance_id])


[2/9] git commit: Added start functionality to stopped EC2 instances

Posted by ma...@apache.org.
Added start functionality to stopped EC2 instances


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/eb329da1
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/eb329da1
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/eb329da1

Branch: refs/heads/master
Commit: eb329da1b5c7f9f17f80c6ae70da1e1d5c0d15b1
Parents: 4d62d3c
Author: David Ellinger <da...@me.com>
Authored: Tue Apr 30 07:00:40 2013 -0400
Committer: marios <ma...@redhat.com>
Committed: Fri Jun 28 12:05:49 2013 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/eb329da1/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index b740254..f462b37 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -297,6 +297,16 @@ module Deltacloud
           end
         end
 
+
+        def start_instance(credentials, instance_id)
+          ec2 = new_client(credentials)
+          if ec2.start_instances([instance_id])
+            instance(credentials, :id => instance_id)
+          else
+            raise Deltacloud::BackendError.new(500, "Instance", "Instance start failed", "")
+          end
+        end
+
         def run_on_instance(credentials, opts={})
           target = instance(credentials, :id => opts[:id])
           param = {}


[7/9] git commit: EC2 driver - modify instance actions depending on transient root (ebs/root_store)

Posted by ma...@apache.org.
EC2 driver - modify instance actions depending on transient root (ebs/root_store)

related to https://github.com/deltacloud/deltacloud-core/pull/44


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/6307f267
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/6307f267
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/6307f267

Branch: refs/heads/master
Commit: 6307f267e7dbc0dca2a2f972a341ce02eb8fb0f9
Parents: a426922
Author: marios <ma...@redhat.com>
Authored: Fri Jun 7 11:25:49 2013 +0300
Committer: marios <ma...@redhat.com>
Committed: Fri Jun 28 12:05:50 2013 +0300

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


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/6307f267/server/lib/deltacloud/drivers/base_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/base_driver.rb b/server/lib/deltacloud/drivers/base_driver.rb
index 8e1c6df..439f099 100644
--- a/server/lib/deltacloud/drivers/base_driver.rb
+++ b/server/lib/deltacloud/drivers/base_driver.rb
@@ -135,7 +135,7 @@ module Deltacloud
       self.class.instance_state_machine
     end
 
-    def instance_actions_for(state)
+    def instance_actions_for(state, instance = nil)
       actions = []
       states = instance_state_machine.states()
       current_state = states.find{|e| e.name == state.underscore.to_sym }

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/6307f267/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index da627c5..fdc282b 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -137,6 +137,31 @@ module Deltacloud
 
         end
 
+        def instance_actions_for(state, instance = nil)
+          if instance
+            ebs = (instance[:root_device_type] == "ebs") ? true : false
+          end
+          actions = []
+          states = instance_state_machine.states()
+          current_state = states.find{|e| e.name == state.underscore.to_sym }
+          if ( current_state )
+            actions = current_state.transitions.collect{|e|e.action}
+            actions.reject!{|e| e.nil?}
+          end
+          if ebs
+            actions
+          else
+            # hax :( :stop becomes :destroy, :start is not possible
+            actions.inject([]) do |res, cur|
+              res << cur unless [:stop, :start].include? cur
+              if cur == :stop
+                res << :destroy
+              end
+              res
+            end
+          end
+        end
+
         # We do not allow users to set the endpoint through environment
         # variables. That that would work is an implementation detail.
         ENV.delete("EC2_URL")
@@ -342,7 +367,7 @@ module Deltacloud
             end
           else
             destroy_instance(credentials,instance_id)
-          end  
+          end
         end
 
         def destroy_instance(credentials, instance_id)
@@ -1075,7 +1100,7 @@ module Deltacloud
             :state => convert_state(instance[:aws_state]),
             :image_id => instance[:aws_image_id],
             :owner_id => instance[:aws_owner],
-            :actions => instance_actions_for(convert_state(instance[:aws_state])),
+            :actions => instance_actions_for(convert_state(instance[:aws_state]), instance),
             :keyname => instance[:ssh_key_name],
             :launch_time => instance[:aws_launch_time],
             :instance_profile => InstanceProfile.new(instance[:aws_instance_type], inst_profile_opts),


[8/9] git commit: Modified 'stop_instance' method to check if instance root type is ebs or instance_store. If ebs -- stop instance otherwise destroy instance

Posted by ma...@apache.org.
Modified 'stop_instance' method to check if instance root type is ebs or instance_store. If ebs -- stop instance otherwise destroy instance


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/1a26f6ac
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/1a26f6ac
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/1a26f6ac

Branch: refs/heads/master
Commit: 1a26f6ac73cd6db3c1a5842190f8b9734422a71e
Parents: b75f0a4
Author: David Ellinger <de...@ltionline.com>
Authored: Tue Jun 4 15:48:47 2013 -0400
Committer: marios <ma...@redhat.com>
Committed: Fri Jun 28 12:05:50 2013 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/1a26f6ac/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 71539b3..81e5832 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -333,11 +333,18 @@ module Deltacloud
         def stop_instance(credentials, instance_id)
           ec2 = new_client(credentials)
           #TODO: If image root is ebs (or persistent) then stop instance otherwise need to run "destroy_instance"
-          if ec2.stop_instances([instance_id])
-            instance(credentials, :id => instance_id)
+          #ec2_instance = ec2.instances[:instance_id]
+          #if ec2_instance.root_device_type == "ebs"
+          ec2_inst = ec2.describe_instances([instance_id]).first
+          if ec2_inst[:root_device_type] == "ebs"
+            if ec2.stop_instances([instance_id])
+              instance(credentials, :id => instance_id)
+            else
+              raise Deltacloud::BackendError.new(500, "Instance", "Instance stop failed", "")
+            end
           else
-            raise Deltacloud::BackendError.new(500, "Instance", "Instance stop failed", "")
-          end
+            destroy_instance(credentials,instance_id)
+          end  
         end
 
 


[9/9] git commit: Cleaned up code

Posted by ma...@apache.org.
Cleaned up code


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/47767269
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/47767269
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/47767269

Branch: refs/heads/master
Commit: 477672699c5e7a3245e9d66bf952ac214a248d1b
Parents: 1a26f6a
Author: David Ellinger <de...@ltionline.com>
Authored: Tue Jun 4 15:58:41 2013 -0400
Committer: marios <ma...@redhat.com>
Committed: Fri Jun 28 12:05:50 2013 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/47767269/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 81e5832..16d7d18 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -347,7 +347,6 @@ module Deltacloud
           end  
         end
 
-
         def destroy_instance(credentials, instance_id)
           ec2 = new_client(credentials)
           if ec2.terminate_instances([instance_id])


[4/9] git commit: EC2 driver - Fix for determining instance_actions on ebs/root_store instances

Posted by ma...@apache.org.
EC2 driver - Fix for determining instance_actions on ebs/root_store instances

https://github.com/deltacloud/deltacloud-core/pull/47


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/fd92d39d
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/fd92d39d
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/fd92d39d

Branch: refs/heads/master
Commit: fd92d39d4efd9491322697a54950fc0685518015
Parents: 6307f26
Author: marios <ma...@redhat.com>
Authored: Tue Jun 18 12:31:59 2013 +0300
Committer: marios <ma...@redhat.com>
Committed: Fri Jun 28 12:05:50 2013 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/base_driver.rb       |  2 +-
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb    | 16 ++++++++++++----
 server/lib/deltacloud/helpers/deltacloud_helper.rb |  2 +-
 3 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/fd92d39d/server/lib/deltacloud/drivers/base_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/base_driver.rb b/server/lib/deltacloud/drivers/base_driver.rb
index 439f099..8fa58b2 100644
--- a/server/lib/deltacloud/drivers/base_driver.rb
+++ b/server/lib/deltacloud/drivers/base_driver.rb
@@ -135,7 +135,7 @@ module Deltacloud
       self.class.instance_state_machine
     end
 
-    def instance_actions_for(state, instance = nil)
+    def instance_actions_for(state, params={})
       actions = []
       states = instance_state_machine.states()
       current_state = states.find{|e| e.name == state.underscore.to_sym }

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/fd92d39d/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index fdc282b..cc3878a 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -137,9 +137,9 @@ module Deltacloud
 
         end
 
-        def instance_actions_for(state, instance = nil)
-          if instance
-            ebs = (instance[:root_device_type] == "ebs") ? true : false
+        def instance_actions_for(state, params={})
+          unless params.empty?
+            ebs = is_ebs_instance?(params)
           end
           actions = []
           states = instance_state_machine.states()
@@ -1084,6 +1084,14 @@ module Deltacloud
           type == 'ebs' ? 'persistent' : 'transient'
         end
 
+        #params: {:image_id => 123, :persistent_image=>true, :credentials => creds}
+        def is_ebs_instance?(params)
+          return params[:persistent_image] unless params[:persistent_image].nil?
+          (image(params[:credentials], {:id=>params[:image_id]}).root_type == "persistent") ? true : false
+        end
+
+
+
         def convert_instance(instance)
           can_create_image = 'ebs'.eql?(instance[:root_device_type]) and 'RUNNING'.eql?(convert_state(instance[:aws_state]))
           inst_profile_opts={}
@@ -1100,7 +1108,7 @@ module Deltacloud
             :state => convert_state(instance[:aws_state]),
             :image_id => instance[:aws_image_id],
             :owner_id => instance[:aws_owner],
-            :actions => instance_actions_for(convert_state(instance[:aws_state]), instance),
+            :actions => instance_actions_for(convert_state(instance[:aws_state]), {:persistent_image => (instance[:root_device_type] == "ebs")}),
             :keyname => instance[:ssh_key_name],
             :launch_time => instance[:aws_launch_time],
             :instance_profile => InstanceProfile.new(instance[:aws_instance_type], inst_profile_opts),

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/fd92d39d/server/lib/deltacloud/helpers/deltacloud_helper.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/helpers/deltacloud_helper.rb b/server/lib/deltacloud/helpers/deltacloud_helper.rb
index 2b5d347..64f68f8 100644
--- a/server/lib/deltacloud/helpers/deltacloud_helper.rb
+++ b/server/lib/deltacloud/helpers/deltacloud_helper.rb
@@ -150,7 +150,7 @@ module Deltacloud::Helpers
 
       # If original instance doesn't include called action
       # return with 405 error (Method is not Allowed)
-      unless driver.instance_actions_for(original_instance.state).include?(name.to_sym)
+      unless driver.instance_actions_for(original_instance.state, {:image_id=>original_instance.image_id, :credentials=>credentials}).include?(name.to_sym)
         return report_error(405)
       end
 


[5/9] git commit: Fixed formatting

Posted by ma...@apache.org.
Fixed formatting


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/b75f0a44
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/b75f0a44
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/b75f0a44

Branch: refs/heads/master
Commit: b75f0a44b6e9c364ef5dcf1945735446caf53bcf
Parents: 9e53cb0
Author: David Ellinger <de...@ltionline.com>
Authored: Fri May 24 14:38:54 2013 -0400
Committer: marios <ma...@redhat.com>
Committed: Fri Jun 28 12:05:50 2013 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/b75f0a44/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 7c41aeb..71539b3 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -123,23 +123,18 @@ module Deltacloud
         end
 
         define_instance_states do
+
           start.to( :pending )          .automatically
           pending.to( :running )        .automatically
           running.to( :running )        .on( :reboot )
           running.to( :stopping )       .on( :stop )
           stopping.to(:stopped)         .automatically
           stopped.to( :running )        .on( :start )
-          stopped.to(:finish)         .on( :destroy)
+          stopped.to(:finish)           .on( :destroy)
 
           #pending.to( :stopping )       .on( :stop )
           #pending.to( :stopped )        .automatically
 
-          
-         
-          
-
-          
-
         end
 
         # We do not allow users to set the endpoint through environment
@@ -337,6 +332,7 @@ module Deltacloud
 
         def stop_instance(credentials, instance_id)
           ec2 = new_client(credentials)
+          #TODO: If image root is ebs (or persistent) then stop instance otherwise need to run "destroy_instance"
           if ec2.stop_instances([instance_id])
             instance(credentials, :id => instance_id)
           else