deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@redhat.com
Subject [PATCH 3/3] EC2: allow launching instances into a subnet
Date Tue, 28 Aug 2012 23:35:35 GMT
From: David Lutterkort <lutter@redhat.com>

---
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb    |   15 +-
 .../drivers/ec2/fixtures/create_resources.yml      |   36 +-
 .../drivers/ec2/fixtures/destroy_resources.yml     |   30 +-
 .../test_0005_must_list_VPC_subnets_as_realms.yml  |   42 ++-
 ...ust_allow_creating_instance_in_a_VPC_subnet.yml |  192 +++++++++
 ...llow_to_reboot_instance_in_running_state-10.yml |   76 ----
 ...allow_to_reboot_instance_in_running_state-7.yml |   88 -----
 ...allow_to_reboot_instance_in_running_state-8.yml |   88 -----
 ...allow_to_reboot_instance_in_running_state-9.yml |   88 -----
 ...reboot_instance_in_running_state-stopped-10.yml |   92 -----
 ...t_allow_to_reboot_instance_in_running_state.yml |  411 --------------------
 ...llow_to_reboot_instance_in_running_state-10.yml |   76 ++++
 ...allow_to_reboot_instance_in_running_state-8.yml |   88 +++++
 ...allow_to_reboot_instance_in_running_state-9.yml |   76 ++++
 ...reboot_instance_in_running_state-stopped-10.yml |   92 +++++
 ...t_allow_to_reboot_instance_in_running_state.yml |  411 ++++++++++++++++++++
 ...allow_to_reboot_instance_in_running_state-9.yml |   88 +++++
 server/tests/drivers/ec2/instance_test.rb          |   10 +
 18 files changed, 1104 insertions(+), 895 deletions(-)
 create mode 100644 server/tests/drivers/ec2/fixtures/test_0007_must_allow_creating_instance_in_a_VPC_subnet.yml
 delete mode 100644 server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-10.yml
 delete mode 100644 server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-7.yml
 delete mode 100644 server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-8.yml
 delete mode 100644 server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-9.yml
 delete mode 100644 server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-stopped-10.yml
 delete mode 100644 server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state.yml
 create mode 100644 server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-10.yml
 create mode 100644 server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-8.yml
 create mode 100644 server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-9.yml
 create mode 100644 server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-stopped-10.yml
 create mode 100644 server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state.yml
 create mode 100644 server/tests/drivers/ec2/fixtures/test_0009_must_allow_to_reboot_instance_in_running_state-9.yml

diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 31fcfa5..b275f98 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -263,8 +263,15 @@ module Deltacloud
           if opts[:metrics] and !opts[:metrics].empty?
             instance_options[:monitoring_enabled] = true
           end
+          if opts[:realm_id]
+            az, sn = opts[:realm_id].split(":")
+            if sn
+              instance_options[:subnet_id] = sn
+            else
+              instance_options[:availability_zone] = az
+            end
+          end
           instance_options[:key_name] = opts[:keyname] if opts[:keyname]
-          instance_options[:availability_zone] = opts[:realm_id] if opts[:realm_id]
           instance_options[:instance_type] = opts[:hwp_id] if opts[:hwp_id] && opts[:hwp_id].length > 0
           firewalls = opts.inject([]){|res, (k,v)| res << v if k =~ /firewalls\d+$/; res}
           instance_options[:group_ids] = firewalls unless firewalls.empty?
@@ -919,6 +926,10 @@ module Deltacloud
           if instance[:aws_instance_type] == "t1.micro"
             inst_profile_opts[:hwp_architecture]=instance[:architecture]
           end
+          realm_id = instance[:aws_availability_zone]
+          unless instance[:subnet_id].empty?
+            realm_id = "#{realm_id}:#{instance[:subnet_id]}"
+          end
          Instance.new(
             :id => instance[:aws_instance_id],
             :name => instance[:aws_image_id],
@@ -929,7 +940,7 @@ module Deltacloud
             :keyname => instance[:ssh_key_name],
             :launch_time => instance[:aws_launch_time],
             :instance_profile => InstanceProfile.new(instance[:aws_instance_type], inst_profile_opts),
-            :realm_id => instance[:aws_availability_zone],
+            :realm_id => realm_id,
             :public_addresses => [InstanceAddress.new(instance[:dns_name], :type => :hostname)],
             :private_addresses => [InstanceAddress.new(instance[:private_dns_name], :type => :hostname)],
             :firewalls => instance[:aws_groups],
diff --git a/server/tests/drivers/ec2/fixtures/create_resources.yml b/server/tests/drivers/ec2/fixtures/create_resources.yml
index fb14d7b..85ea7c0 100644
--- a/server/tests/drivers/ec2/fixtures/create_resources.yml
+++ b/server/tests/drivers/ec2/fixtures/create_resources.yml
@@ -1,8 +1,9 @@
 --- 
+recorded_with: VCR 2.2.4
 http_interactions: 
 - request: 
     method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=CreateVpc&CidrBlock=172.16.0.0/16&Signature=1v+DVE5pE5wAGscby85h5Phi5O5OEl+3WgxOn/BgNaE=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T22:36:42.000Z&Version=2010-08-31
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=CreateVpc&CidrBlock=172.16.0.0/16&Signature=62kOuCAxVbNEYwqtW1kFLpUEVu4eJk91xpk3InvdGsY=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:23:35.000Z&Version=2010-08-31
     body: 
       string: ""
     headers: 
@@ -15,31 +16,31 @@ http_interactions:
       code: 200
       message: OK
     headers: 
-      Server: 
-      - AmazonEC2
+      Date: 
+      - Tue, 28 Aug 2012 23:23:36 GMT
       Transfer-Encoding: 
       - chunked
-      Date: 
-      - Tue, 28 Aug 2012 22:36:42 GMT
       Content-Type: 
       - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
     body: 
       string: |-
         <?xml version="1.0" encoding="UTF-8"?>
         <CreateVpcResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>12201e58-4637-4663-a0da-a9c3bcf49d5c</requestId>
+            <requestId>b4feaef5-9df4-4f49-8e61-83b95f78684a</requestId>
             <vpc>
-                <vpcId>vpc-6a952301</vpcId>
+                <vpcId>vpc-a276c0c9</vpcId>
                 <state>pending</state>
                 <cidrBlock>172.16.0.0/16</cidrBlock>
                 <dhcpOptionsId>default</dhcpOptionsId>
             </vpc>
         </CreateVpcResponse>
     http_version: 
-  recorded_at: Tue, 28 Aug 2012 22:36:42 GMT
+  recorded_at: Tue, 28 Aug 2012 23:23:36 GMT
 - request: 
     method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=CreateSubnet&AvailabilityZone=us-east-1b&CidrBlock=172.16.3.0/24&Signature=EIzFCEEuL0/0E/GVatWByMC0qybmPTw0+kd2xHnOGuw=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T22:36:42.000Z&Version=2010-08-31&VpcId=vpc-6a952301
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=CreateSubnet&AvailabilityZone=us-east-1b&CidrBlock=172.16.3.0/24&Signature=0K1m0h3jPi5++y2eYjVPf/tbX3iD1+XzALm8gtiG57M=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:23:36.000Z&Version=2010-08-31&VpcId=vpc-a276c0c9
     body: 
       string: ""
     headers: 
@@ -52,28 +53,27 @@ http_interactions:
       code: 200
       message: OK
     headers: 
-      Server: 
-      - AmazonEC2
+      Date: 
+      - Tue, 28 Aug 2012 23:23:36 GMT
       Transfer-Encoding: 
       - chunked
-      Date: 
-      - Tue, 28 Aug 2012 22:36:43 GMT
       Content-Type: 
       - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
     body: 
       string: |-
         <?xml version="1.0" encoding="UTF-8"?>
         <CreateSubnetResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>e3939c15-3c67-4e33-b1d8-88242dd2317c</requestId>
+            <requestId>8e6c33e3-f805-46ba-801e-2ca76cf1b3e5</requestId>
             <subnet>
-                <subnetId>subnet-62952309</subnetId>
+                <subnetId>subnet-a676c0cd</subnetId>
                 <state>pending</state>
-                <vpcId>vpc-6a952301</vpcId>
+                <vpcId>vpc-a276c0c9</vpcId>
                 <cidrBlock>172.16.3.0/24</cidrBlock>
                 <availableIpAddressCount>251</availableIpAddressCount>
                 <availabilityZone>us-east-1b</availabilityZone>
             </subnet>
         </CreateSubnetResponse>
     http_version: 
-  recorded_at: Tue, 28 Aug 2012 22:36:43 GMT
-recorded_with: VCR 2.2.4
+  recorded_at: Tue, 28 Aug 2012 23:23:36 GMT
diff --git a/server/tests/drivers/ec2/fixtures/destroy_resources.yml b/server/tests/drivers/ec2/fixtures/destroy_resources.yml
index 61020fa..1e9784f 100644
--- a/server/tests/drivers/ec2/fixtures/destroy_resources.yml
+++ b/server/tests/drivers/ec2/fixtures/destroy_resources.yml
@@ -1,8 +1,9 @@
 --- 
+recorded_with: VCR 2.2.4
 http_interactions: 
 - request: 
     method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DeleteSubnet&Signature=kpx0IU+viAUHCJMSNE+VAc/Hl0oqHdr08cFN7jwJW38=&SignatureMethod=HmacSHA256&SignatureVersion=2&SubnetId=subnet-62952309&Timestamp=2012-08-28T22:36:45.000Z&Version=2010-08-31
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DeleteSubnet&Signature=a4Q/5UWqc9RjkMvHxay5BIx2Hi5wASHEH1snK5KLruQ=&SignatureMethod=HmacSHA256&SignatureVersion=2&SubnetId=subnet-a676c0cd&Timestamp=2012-08-28T23:25:25.000Z&Version=2010-08-31
     body: 
       string: ""
     headers: 
@@ -15,26 +16,26 @@ http_interactions:
       code: 200
       message: OK
     headers: 
-      Server: 
-      - AmazonEC2
+      Date: 
+      - Tue, 28 Aug 2012 23:25:25 GMT
       Transfer-Encoding: 
       - chunked
-      Date: 
-      - Tue, 28 Aug 2012 22:36:46 GMT
       Content-Type: 
       - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
     body: 
       string: |-
         <?xml version="1.0" encoding="UTF-8"?>
         <DeleteSubnetResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>342eac4f-3687-4d89-92b7-0484b618947e</requestId>
+            <requestId>6797ff99-f447-4011-b5ac-7550fd4b16de</requestId>
             <return>true</return>
         </DeleteSubnetResponse>
     http_version: 
-  recorded_at: Tue, 28 Aug 2012 22:36:46 GMT
+  recorded_at: Tue, 28 Aug 2012 23:25:26 GMT
 - request: 
     method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DeleteVpc&Signature=OzOLWsGU2ZIwhaA46jecA/wwUeV+hFMu9d1XeUysvG0=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T22:36:46.000Z&Version=2010-08-31&VpcId=vpc-6a952301
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DeleteVpc&Signature=5khnoyyAahGeiGBPdWIxWJl/NITCPVvCb3QYyRJVK1A=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:26.000Z&Version=2010-08-31&VpcId=vpc-a276c0c9
     body: 
       string: ""
     headers: 
@@ -47,21 +48,20 @@ http_interactions:
       code: 200
       message: OK
     headers: 
-      Server: 
-      - AmazonEC2
+      Date: 
+      - Tue, 28 Aug 2012 23:25:26 GMT
       Transfer-Encoding: 
       - chunked
-      Date: 
-      - Tue, 28 Aug 2012 22:36:46 GMT
       Content-Type: 
       - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
     body: 
       string: |-
         <?xml version="1.0" encoding="UTF-8"?>
         <DeleteVpcResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>d3b55d09-5ece-4b07-a81a-5e9ef3b1d750</requestId>
+            <requestId>596e3e6f-0aa3-44f2-94ff-5b3959fed84b</requestId>
             <return>true</return>
         </DeleteVpcResponse>
     http_version: 
-  recorded_at: Tue, 28 Aug 2012 22:36:47 GMT
-recorded_with: VCR 2.2.4
+  recorded_at: Tue, 28 Aug 2012 23:25:26 GMT
diff --git a/server/tests/drivers/ec2/fixtures/test_0005_must_list_VPC_subnets_as_realms.yml b/server/tests/drivers/ec2/fixtures/test_0005_must_list_VPC_subnets_as_realms.yml
index fdce4eb..3cb6039 100644
--- a/server/tests/drivers/ec2/fixtures/test_0005_must_list_VPC_subnets_as_realms.yml
+++ b/server/tests/drivers/ec2/fixtures/test_0005_must_list_VPC_subnets_as_realms.yml
@@ -1,8 +1,9 @@
 --- 
+recorded_with: VCR 2.2.4
 http_interactions: 
 - request: 
     method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeAvailabilityZones&Signature=v93MQI1cGoYMFByjuzOvr9DZAbE50n6cNkgTf4g8rJs=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T22:36:44.000Z&Version=2010-08-31
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeAvailabilityZones&Signature=ubo/K69ZBrM5BTXwk5mcGytDQ2KSbwHD2hWLh67rejw=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:07.000Z&Version=2010-08-31
     body: 
       string: ""
     headers: 
@@ -15,19 +16,19 @@ http_interactions:
       code: 200
       message: OK
     headers: 
-      Server: 
-      - AmazonEC2
+      Date: 
+      - Tue, 28 Aug 2012 23:25:06 GMT
       Transfer-Encoding: 
       - chunked
-      Date: 
-      - Tue, 28 Aug 2012 22:36:45 GMT
       Content-Type: 
       - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
     body: 
       string: |-
         <?xml version="1.0" encoding="UTF-8"?>
         <DescribeAvailabilityZonesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>aa77686e-b8b2-4870-8f1e-6232077dbade</requestId>
+            <requestId>9ffa9aed-b47f-4a5a-96ab-1c6e554e0cb0</requestId>
             <availabilityZoneInfo>
                 <item>
                     <zoneName>us-east-1a</zoneName>
@@ -56,10 +57,10 @@ http_interactions:
             </availabilityZoneInfo>
         </DescribeAvailabilityZonesResponse>
     http_version: 
-  recorded_at: Tue, 28 Aug 2012 22:36:45 GMT
+  recorded_at: Tue, 28 Aug 2012 23:25:07 GMT
 - request: 
     method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeSubnets&Signature=r2v7oE4F8OoTHhXc1NYAdJTr6giszS8MSsQ7prKHM4g=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T22:36:45.000Z&Version=2010-08-31
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeSubnets&Signature=li4JSzmstzaJIi+7xN5T9sHaPEKIuqAjn4As7Gz8TfU=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:07.000Z&Version=2010-08-31
     body: 
       string: ""
     headers: 
@@ -72,21 +73,29 @@ http_interactions:
       code: 200
       message: OK
     headers: 
-      Server: 
-      - AmazonEC2
+      Date: 
+      - Tue, 28 Aug 2012 23:25:07 GMT
       Transfer-Encoding: 
       - chunked
-      Date: 
-      - Tue, 28 Aug 2012 22:36:45 GMT
       Content-Type: 
       - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
     body: 
       string: |-
         <?xml version="1.0" encoding="UTF-8"?>
         <DescribeSubnetsResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>c95921ad-17a4-4262-b877-2d357f6873f6</requestId>
+            <requestId>c0d2d063-8928-439c-a0cf-daabc07e7e5f</requestId>
             <subnetSet>
                 <item>
+                    <subnetId>subnet-6a9a2c01</subnetId>
+                    <state>available</state>
+                    <vpcId>vpc-979d2bfc</vpcId>
+                    <cidrBlock>172.16.3.0/24</cidrBlock>
+                    <availableIpAddressCount>251</availableIpAddressCount>
+                    <availabilityZone>us-east-1b</availabilityZone>
+                </item>
+                <item>
                     <subnetId>subnet-dd5bfcb6</subnetId>
                     <state>available</state>
                     <vpcId>vpc-0b40e760</vpcId>
@@ -95,9 +104,9 @@ http_interactions:
                     <availabilityZone>us-east-1a</availabilityZone>
                 </item>
                 <item>
-                    <subnetId>subnet-62952309</subnetId>
+                    <subnetId>subnet-a676c0cd</subnetId>
                     <state>available</state>
-                    <vpcId>vpc-6a952301</vpcId>
+                    <vpcId>vpc-a276c0c9</vpcId>
                     <cidrBlock>172.16.3.0/24</cidrBlock>
                     <availableIpAddressCount>251</availableIpAddressCount>
                     <availabilityZone>us-east-1b</availabilityZone>
@@ -105,5 +114,4 @@ http_interactions:
             </subnetSet>
         </DescribeSubnetsResponse>
     http_version: 
-  recorded_at: Tue, 28 Aug 2012 22:36:45 GMT
-recorded_with: VCR 2.2.4
+  recorded_at: Tue, 28 Aug 2012 23:25:08 GMT
diff --git a/server/tests/drivers/ec2/fixtures/test_0007_must_allow_creating_instance_in_a_VPC_subnet.yml b/server/tests/drivers/ec2/fixtures/test_0007_must_allow_creating_instance_in_a_VPC_subnet.yml
new file mode 100644
index 0000000..97ad021
--- /dev/null
+++ b/server/tests/drivers/ec2/fixtures/test_0007_must_allow_creating_instance_in_a_VPC_subnet.yml
@@ -0,0 +1,192 @@
+--- 
+recorded_with: VCR 2.2.4
+http_interactions: 
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=RunInstances&AddressingType=public&ImageId=ami-aecd60c7&InstanceType=m1.small&MaxCount=1&MinCount=1&Signature=8KuMolwNObUd9CL93vD9hi/dLwMOLpdUioRuVSbLnhg=&SignatureMethod=HmacSHA256&SignatureVersion=2&SubnetId=subnet-a676c0cd&Timestamp=2012-08-28T23:24:34.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:24:35 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <RunInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>af525302-cdcb-47a5-b9bc-1d9b0743b46f</requestId>
+            <reservationId>r-39f4045e</reservationId>
+            <ownerId>122214243412</ownerId>
+            <groupSet/>
+            <instancesSet>
+                <item>
+                    <instanceId>i-9c8b63e6</instanceId>
+                    <imageId>ami-aecd60c7</imageId>
+                    <instanceState>
+                        <code>0</code>
+                        <name>pending</name>
+                    </instanceState>
+                    <privateDnsName/>
+                    <dnsName/>
+                    <reason/>
+                    <amiLaunchIndex>0</amiLaunchIndex>
+                    <productCodes/>
+                    <instanceType>m1.small</instanceType>
+                    <launchTime>2012-08-28T23:24:35.000Z</launchTime>
+                    <placement>
+                        <availabilityZone>us-east-1b</availabilityZone>
+                        <groupName/>
+                    </placement>
+                    <kernelId>aki-88aa75e1</kernelId>
+                    <monitoring>
+                        <state>disabled</state>
+                    </monitoring>
+                    <subnetId>subnet-a676c0cd</subnetId>
+                    <vpcId>vpc-a276c0c9</vpcId>
+                    <privateIpAddress>172.16.3.53</privateIpAddress>
+                    <stateReason>
+                        <code>pending</code>
+                        <message>pending</message>
+                    </stateReason>
+                    <architecture>x86_64</architecture>
+                    <rootDeviceType>ebs</rootDeviceType>
+                    <rootDeviceName>/dev/sda1</rootDeviceName>
+                    <blockDeviceMapping/>
+                    <virtualizationType>paravirtual</virtualizationType>
+                    <clientToken/>
+                </item>
+            </instancesSet>
+        </RunInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:24:35 GMT
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=TerminateInstances&InstanceId.1=i-9c8b63e6&Signature=MCDFU/zjM7SzZRsIsmn5pdrcb66dYcLsj8o4741mACU=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:24:36.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:24:36 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <TerminateInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>76d82ca5-79ee-4e77-a7a7-f5d20d016228</requestId>
+            <instancesSet>
+                <item>
+                    <instanceId>i-9c8b63e6</instanceId>
+                    <currentState>
+                        <code>32</code>
+                        <name>shutting-down</name>
+                    </currentState>
+                    <previousState>
+                        <code>0</code>
+                        <name>pending</name>
+                    </previousState>
+                </item>
+            </instancesSet>
+        </TerminateInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:24:36 GMT
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeInstances&InstanceId.1=i-9c8b63e6&Signature=Gj7jewLjorlJWC42TDAkXcG5AnX4AwrmmXHQicnzuK4=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:24:36.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:24:37 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>0781fc7a-4676-4eb5-b619-932f99b1544f</requestId>
+            <reservationSet>
+                <item>
+                    <reservationId>r-39f4045e</reservationId>
+                    <ownerId>122214243412</ownerId>
+                    <groupSet/>
+                    <instancesSet>
+                        <item>
+                            <instanceId>i-9c8b63e6</instanceId>
+                            <imageId>ami-aecd60c7</imageId>
+                            <instanceState>
+                                <code>48</code>
+                                <name>terminated</name>
+                            </instanceState>
+                            <privateDnsName/>
+                            <dnsName/>
+                            <reason>User initiated (2012-08-28 23:24:36 GMT)</reason>
+                            <amiLaunchIndex>0</amiLaunchIndex>
+                            <productCodes/>
+                            <instanceType>m1.small</instanceType>
+                            <launchTime>2012-08-28T23:24:35.000Z</launchTime>
+                            <placement>
+                                <availabilityZone>us-east-1b</availabilityZone>
+                                <groupName/>
+                            </placement>
+                            <kernelId>aki-88aa75e1</kernelId>
+                            <monitoring>
+                                <state>disabled</state>
+                            </monitoring>
+                            <stateReason>
+                                <code>Client.UserInitiatedShutdown</code>
+                                <message>Client.UserInitiatedShutdown: User initiated shutdown</message>
+                            </stateReason>
+                            <architecture>x86_64</architecture>
+                            <rootDeviceType>ebs</rootDeviceType>
+                            <rootDeviceName>/dev/sda1</rootDeviceName>
+                            <blockDeviceMapping/>
+                            <virtualizationType>paravirtual</virtualizationType>
+                            <clientToken/>
+                        </item>
+                    </instancesSet>
+                </item>
+            </reservationSet>
+        </DescribeInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:24:37 GMT
diff --git a/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-10.yml b/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-10.yml
deleted file mode 100644
index c8f0776..0000000
--- a/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-10.yml
+++ /dev/null
@@ -1,76 +0,0 @@
---- 
-http_interactions: 
-- request: 
-    method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJYOQYLLOIWN5LQ3A&Action=DescribeInstances&InstanceId.1=i-7177920a&Signature=DHxm7p2CMHn5fzkybhIzC977iJ/i59rnLEIXVWdrTVE=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
-    body: 
-      string: ""
-    headers: 
-      User-Agent: 
-      - ""
-      Accept: 
-      - "*/*"
-  response: 
-    status: 
-      code: 200
-      message: OK
-    headers: 
-      Content-Type: 
-      - text/xml;charset=UTF-8
-      Server: 
-      - AmazonEC2
-      Transfer-Encoding: 
-      - chunked
-      Date: 
-      - Mon, 30 Jul 2012 11:07:18 GMT
-    body: 
-      string: |-
-        <?xml version="1.0" encoding="UTF-8"?>
-        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>5e2c9e6e-25f1-4874-8370-e3a4791d19b2</requestId>
-            <reservationSet>
-                <item>
-                    <reservationId>r-362c9d52</reservationId>
-                    <ownerId>293787749884</ownerId>
-                    <groupSet>
-                        <item>
-                            <groupId>default</groupId>
-                        </item>
-                    </groupSet>
-                    <instancesSet>
-                        <item>
-                            <instanceId>i-7177920a</instanceId>
-                            <imageId>ami-aecd60c7</imageId>
-                            <instanceState>
-                                <code>0</code>
-                                <name>pending</name>
-                            </instanceState>
-                            <privateDnsName/>
-                            <dnsName/>
-                            <reason/>
-                            <amiLaunchIndex>0</amiLaunchIndex>
-                            <productCodes/>
-                            <instanceType>t1.micro</instanceType>
-                            <launchTime>2012-07-30T11:07:18.000Z</launchTime>
-                            <placement>
-                                <availabilityZone>us-east-1a</availabilityZone>
-                                <groupName/>
-                            </placement>
-                            <kernelId>aki-88aa75e1</kernelId>
-                            <monitoring>
-                                <state>disabled</state>
-                            </monitoring>
-                            <architecture>x86_64</architecture>
-                            <rootDeviceType>ebs</rootDeviceType>
-                            <rootDeviceName>/dev/sda1</rootDeviceName>
-                            <blockDeviceMapping/>
-                            <virtualizationType>paravirtual</virtualizationType>
-                            <clientToken/>
-                        </item>
-                    </instancesSet>
-                </item>
-            </reservationSet>
-        </DescribeInstancesResponse>
-    http_version: 
-  recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
-recorded_with: VCR 2.2.4
diff --git a/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-7.yml b/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-7.yml
deleted file mode 100644
index 20af4ba..0000000
--- a/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-7.yml
+++ /dev/null
@@ -1,88 +0,0 @@
---- 
-http_interactions: 
-- request: 
-    method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJYOQYLLOIWN5LQ3A&Action=DescribeInstances&InstanceId.1=i-7177920a&Signature=DHxm7p2CMHn5fzkybhIzC977iJ/i59rnLEIXVWdrTVE=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
-    body: 
-      string: ""
-    headers: 
-      User-Agent: 
-      - ""
-      Accept: 
-      - "*/*"
-  response: 
-    status: 
-      code: 200
-      message: OK
-    headers: 
-      Content-Type: 
-      - text/xml;charset=UTF-8
-      Server: 
-      - AmazonEC2
-      Transfer-Encoding: 
-      - chunked
-      Date: 
-      - Mon, 30 Jul 2012 11:07:51 GMT
-    body: 
-      string: |-
-        <?xml version="1.0" encoding="UTF-8"?>
-        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>98f9d892-c605-4f89-b06f-5ff2841a3964</requestId>
-            <reservationSet>
-                <item>
-                    <reservationId>r-362c9d52</reservationId>
-                    <ownerId>293787749884</ownerId>
-                    <groupSet>
-                        <item>
-                            <groupId>default</groupId>
-                        </item>
-                    </groupSet>
-                    <instancesSet>
-                        <item>
-                            <instanceId>i-7177920a</instanceId>
-                            <imageId>ami-aecd60c7</imageId>
-                            <instanceState>
-                                <code>16</code>
-                                <name>running</name>
-                            </instanceState>
-                            <privateDnsName>domU-12-31-39-02-75-62.compute-1.internal</privateDnsName>
-                            <dnsName>ec2-23-20-114-135.compute-1.amazonaws.com</dnsName>
-                            <reason/>
-                            <amiLaunchIndex>0</amiLaunchIndex>
-                            <productCodes/>
-                            <instanceType>t1.micro</instanceType>
-                            <launchTime>2012-07-30T11:07:18.000Z</launchTime>
-                            <placement>
-                                <availabilityZone>us-east-1a</availabilityZone>
-                                <groupName/>
-                            </placement>
-                            <kernelId>aki-88aa75e1</kernelId>
-                            <monitoring>
-                                <state>disabled</state>
-                            </monitoring>
-                            <privateIpAddress>10.248.122.144</privateIpAddress>
-                            <ipAddress>23.20.114.135</ipAddress>
-                            <architecture>x86_64</architecture>
-                            <rootDeviceType>ebs</rootDeviceType>
-                            <rootDeviceName>/dev/sda1</rootDeviceName>
-                            <blockDeviceMapping>
-                                <item>
-                                    <deviceName>/dev/sda1</deviceName>
-                                    <ebs>
-                                        <volumeId>vol-ba6f60db</volumeId>
-                                        <status>attached</status>
-                                        <attachTime>2012-07-30T11:07:42.000Z</attachTime>
-                                        <deleteOnTermination>true</deleteOnTermination>
-                                    </ebs>
-                                </item>
-                            </blockDeviceMapping>
-                            <virtualizationType>paravirtual</virtualizationType>
-                            <clientToken/>
-                        </item>
-                    </instancesSet>
-                </item>
-            </reservationSet>
-        </DescribeInstancesResponse>
-    http_version: 
-  recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
-recorded_with: VCR 2.2.4
diff --git a/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-8.yml b/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-8.yml
deleted file mode 100644
index d199283..0000000
--- a/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-8.yml
+++ /dev/null
@@ -1,88 +0,0 @@
---- 
-http_interactions: 
-- request: 
-    method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJYOQYLLOIWN5LQ3A&Action=DescribeInstances&InstanceId.1=i-7177920a&Signature=DHxm7p2CMHn5fzkybhIzC977iJ/i59rnLEIXVWdrTVE=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
-    body: 
-      string: ""
-    headers: 
-      User-Agent: 
-      - ""
-      Accept: 
-      - "*/*"
-  response: 
-    status: 
-      code: 200
-      message: OK
-    headers: 
-      Content-Type: 
-      - text/xml;charset=UTF-8
-      Server: 
-      - AmazonEC2
-      Transfer-Encoding: 
-      - chunked
-      Date: 
-      - Mon, 30 Jul 2012 11:07:40 GMT
-    body: 
-      string: |-
-        <?xml version="1.0" encoding="UTF-8"?>
-        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>979b5d58-f354-45c4-9d83-24eedc45d653</requestId>
-            <reservationSet>
-                <item>
-                    <reservationId>r-362c9d52</reservationId>
-                    <ownerId>293787749884</ownerId>
-                    <groupSet>
-                        <item>
-                            <groupId>default</groupId>
-                        </item>
-                    </groupSet>
-                    <instancesSet>
-                        <item>
-                            <instanceId>i-7177920a</instanceId>
-                            <imageId>ami-aecd60c7</imageId>
-                            <instanceState>
-                                <code>0</code>
-                                <name>pending</name>
-                            </instanceState>
-                            <privateDnsName>domU-12-31-39-02-75-62.compute-1.internal</privateDnsName>
-                            <dnsName>ec2-23-20-114-135.compute-1.amazonaws.com</dnsName>
-                            <reason/>
-                            <amiLaunchIndex>0</amiLaunchIndex>
-                            <productCodes/>
-                            <instanceType>t1.micro</instanceType>
-                            <launchTime>2012-07-30T11:07:18.000Z</launchTime>
-                            <placement>
-                                <availabilityZone>us-east-1a</availabilityZone>
-                                <groupName/>
-                            </placement>
-                            <kernelId>aki-88aa75e1</kernelId>
-                            <monitoring>
-                                <state>disabled</state>
-                            </monitoring>
-                            <privateIpAddress>10.248.122.144</privateIpAddress>
-                            <ipAddress>23.20.114.135</ipAddress>
-                            <architecture>x86_64</architecture>
-                            <rootDeviceType>ebs</rootDeviceType>
-                            <rootDeviceName>/dev/sda1</rootDeviceName>
-                            <blockDeviceMapping>
-                                <item>
-                                    <deviceName>/dev/sda1</deviceName>
-                                    <ebs>
-                                        <volumeId>vol-ba6f60db</volumeId>
-                                        <status>attaching</status>
-                                        <attachTime>2012-07-30T11:07:24.000Z</attachTime>
-                                        <deleteOnTermination>true</deleteOnTermination>
-                                    </ebs>
-                                </item>
-                            </blockDeviceMapping>
-                            <virtualizationType>paravirtual</virtualizationType>
-                            <clientToken/>
-                        </item>
-                    </instancesSet>
-                </item>
-            </reservationSet>
-        </DescribeInstancesResponse>
-    http_version: 
-  recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
-recorded_with: VCR 2.2.4
diff --git a/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-9.yml b/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-9.yml
deleted file mode 100644
index b6f1760..0000000
--- a/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-9.yml
+++ /dev/null
@@ -1,88 +0,0 @@
---- 
-http_interactions: 
-- request: 
-    method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJYOQYLLOIWN5LQ3A&Action=DescribeInstances&InstanceId.1=i-7177920a&Signature=DHxm7p2CMHn5fzkybhIzC977iJ/i59rnLEIXVWdrTVE=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
-    body: 
-      string: ""
-    headers: 
-      User-Agent: 
-      - ""
-      Accept: 
-      - "*/*"
-  response: 
-    status: 
-      code: 200
-      message: OK
-    headers: 
-      Content-Type: 
-      - text/xml;charset=UTF-8
-      Server: 
-      - AmazonEC2
-      Transfer-Encoding: 
-      - chunked
-      Date: 
-      - Mon, 30 Jul 2012 11:07:29 GMT
-    body: 
-      string: |-
-        <?xml version="1.0" encoding="UTF-8"?>
-        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>c28d5a60-c784-4b86-976a-da4ad72f3b57</requestId>
-            <reservationSet>
-                <item>
-                    <reservationId>r-362c9d52</reservationId>
-                    <ownerId>293787749884</ownerId>
-                    <groupSet>
-                        <item>
-                            <groupId>default</groupId>
-                        </item>
-                    </groupSet>
-                    <instancesSet>
-                        <item>
-                            <instanceId>i-7177920a</instanceId>
-                            <imageId>ami-aecd60c7</imageId>
-                            <instanceState>
-                                <code>0</code>
-                                <name>pending</name>
-                            </instanceState>
-                            <privateDnsName>domU-12-31-39-02-75-62.compute-1.internal</privateDnsName>
-                            <dnsName>ec2-23-20-114-135.compute-1.amazonaws.com</dnsName>
-                            <reason/>
-                            <amiLaunchIndex>0</amiLaunchIndex>
-                            <productCodes/>
-                            <instanceType>t1.micro</instanceType>
-                            <launchTime>2012-07-30T11:07:18.000Z</launchTime>
-                            <placement>
-                                <availabilityZone>us-east-1a</availabilityZone>
-                                <groupName/>
-                            </placement>
-                            <kernelId>aki-88aa75e1</kernelId>
-                            <monitoring>
-                                <state>disabled</state>
-                            </monitoring>
-                            <privateIpAddress>10.248.122.144</privateIpAddress>
-                            <ipAddress>23.20.114.135</ipAddress>
-                            <architecture>x86_64</architecture>
-                            <rootDeviceType>ebs</rootDeviceType>
-                            <rootDeviceName>/dev/sda1</rootDeviceName>
-                            <blockDeviceMapping>
-                                <item>
-                                    <deviceName>/dev/sda1</deviceName>
-                                    <ebs>
-                                        <volumeId>vol-ba6f60db</volumeId>
-                                        <status>attaching</status>
-                                        <attachTime>2012-07-30T11:07:24.000Z</attachTime>
-                                        <deleteOnTermination>true</deleteOnTermination>
-                                    </ebs>
-                                </item>
-                            </blockDeviceMapping>
-                            <virtualizationType>paravirtual</virtualizationType>
-                            <clientToken/>
-                        </item>
-                    </instancesSet>
-                </item>
-            </reservationSet>
-        </DescribeInstancesResponse>
-    http_version: 
-  recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
-recorded_with: VCR 2.2.4
diff --git a/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-stopped-10.yml b/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-stopped-10.yml
deleted file mode 100644
index 668cb51..0000000
--- a/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state-stopped-10.yml
+++ /dev/null
@@ -1,92 +0,0 @@
---- 
-http_interactions: 
-- request: 
-    method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJYOQYLLOIWN5LQ3A&Action=DescribeInstances&InstanceId.1=i-7177920a&Signature=DHxm7p2CMHn5fzkybhIzC977iJ/i59rnLEIXVWdrTVE=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
-    body: 
-      string: ""
-    headers: 
-      User-Agent: 
-      - ""
-      Accept: 
-      - "*/*"
-  response: 
-    status: 
-      code: 200
-      message: OK
-    headers: 
-      Content-Type: 
-      - text/xml;charset=UTF-8
-      Server: 
-      - AmazonEC2
-      Transfer-Encoding: 
-      - chunked
-      Date: 
-      - Mon, 30 Jul 2012 11:07:55 GMT
-    body: 
-      string: |-
-        <?xml version="1.0" encoding="UTF-8"?>
-        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>88fa32f8-44ac-4fc7-b796-6d962c59a72e</requestId>
-            <reservationSet>
-                <item>
-                    <reservationId>r-362c9d52</reservationId>
-                    <ownerId>293787749884</ownerId>
-                    <groupSet>
-                        <item>
-                            <groupId>default</groupId>
-                        </item>
-                    </groupSet>
-                    <instancesSet>
-                        <item>
-                            <instanceId>i-7177920a</instanceId>
-                            <imageId>ami-aecd60c7</imageId>
-                            <instanceState>
-                                <code>32</code>
-                                <name>shutting-down</name>
-                            </instanceState>
-                            <privateDnsName>domU-12-31-39-02-75-62.compute-1.internal</privateDnsName>
-                            <dnsName>ec2-23-20-114-135.compute-1.amazonaws.com</dnsName>
-                            <reason>User initiated (2012-07-30 11:07:54 GMT)</reason>
-                            <amiLaunchIndex>0</amiLaunchIndex>
-                            <productCodes/>
-                            <instanceType>t1.micro</instanceType>
-                            <launchTime>2012-07-30T11:07:18.000Z</launchTime>
-                            <placement>
-                                <availabilityZone>us-east-1a</availabilityZone>
-                                <groupName/>
-                            </placement>
-                            <kernelId>aki-88aa75e1</kernelId>
-                            <monitoring>
-                                <state>disabled</state>
-                            </monitoring>
-                            <privateIpAddress>10.248.122.144</privateIpAddress>
-                            <ipAddress>23.20.114.135</ipAddress>
-                            <stateReason>
-                                <code>Client.UserInitiatedShutdown</code>
-                                <message>Client.UserInitiatedShutdown: User initiated shutdown</message>
-                            </stateReason>
-                            <architecture>x86_64</architecture>
-                            <rootDeviceType>ebs</rootDeviceType>
-                            <rootDeviceName>/dev/sda1</rootDeviceName>
-                            <blockDeviceMapping>
-                                <item>
-                                    <deviceName>/dev/sda1</deviceName>
-                                    <ebs>
-                                        <volumeId>vol-ba6f60db</volumeId>
-                                        <status>attached</status>
-                                        <attachTime>2012-07-30T11:07:42.000Z</attachTime>
-                                        <deleteOnTermination>true</deleteOnTermination>
-                                    </ebs>
-                                </item>
-                            </blockDeviceMapping>
-                            <virtualizationType>paravirtual</virtualizationType>
-                            <clientToken/>
-                        </item>
-                    </instancesSet>
-                </item>
-            </reservationSet>
-        </DescribeInstancesResponse>
-    http_version: 
-  recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
-recorded_with: VCR 2.2.4
diff --git a/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state.yml b/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state.yml
deleted file mode 100644
index 2bbb880..0000000
--- a/server/tests/drivers/ec2/fixtures/test_0007_must_allow_to_reboot_instance_in_running_state.yml
+++ /dev/null
@@ -1,411 +0,0 @@
---- 
-http_interactions: 
-- request: 
-    method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJYOQYLLOIWN5LQ3A&Action=RunInstances&AddressingType=public&ImageId=ami-aecd60c7&InstanceType=t1.micro&MaxCount=1&MinCount=1&Placement.AvailabilityZone=us-east-1a&Signature=5QeyXEroD8vgxShp1x92wRRrNzaPgEg4ZK59eoUX9kU=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
-    body: 
-      string: ""
-    headers: 
-      User-Agent: 
-      - ""
-      Accept: 
-      - "*/*"
-  response: 
-    status: 
-      code: 200
-      message: OK
-    headers: 
-      Content-Type: 
-      - text/xml;charset=UTF-8
-      Server: 
-      - AmazonEC2
-      Transfer-Encoding: 
-      - chunked
-      Date: 
-      - Mon, 30 Jul 2012 11:07:18 GMT
-    body: 
-      string: |-
-        <?xml version="1.0" encoding="UTF-8"?>
-        <RunInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>cf80633e-256f-470a-a83d-88abb5c1560b</requestId>
-            <reservationId>r-362c9d52</reservationId>
-            <ownerId>293787749884</ownerId>
-            <groupSet>
-                <item>
-                    <groupId>default</groupId>
-                </item>
-            </groupSet>
-            <instancesSet>
-                <item>
-                    <instanceId>i-7177920a</instanceId>
-                    <imageId>ami-aecd60c7</imageId>
-                    <instanceState>
-                        <code>0</code>
-                        <name>pending</name>
-                    </instanceState>
-                    <privateDnsName/>
-                    <dnsName/>
-                    <reason/>
-                    <amiLaunchIndex>0</amiLaunchIndex>
-                    <productCodes/>
-                    <instanceType>t1.micro</instanceType>
-                    <launchTime>2012-07-30T11:07:18.000Z</launchTime>
-                    <placement>
-                        <availabilityZone>us-east-1a</availabilityZone>
-                        <groupName/>
-                    </placement>
-                    <kernelId>aki-88aa75e1</kernelId>
-                    <monitoring>
-                        <state>disabled</state>
-                    </monitoring>
-                    <stateReason>
-                        <code>pending</code>
-                        <message>pending</message>
-                    </stateReason>
-                    <architecture>x86_64</architecture>
-                    <rootDeviceType>ebs</rootDeviceType>
-                    <rootDeviceName>/dev/sda1</rootDeviceName>
-                    <blockDeviceMapping/>
-                    <virtualizationType>paravirtual</virtualizationType>
-                    <clientToken/>
-                </item>
-            </instancesSet>
-        </RunInstancesResponse>
-    http_version: 
-  recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
-- request: 
-    method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJYOQYLLOIWN5LQ3A&Action=RebootInstances&InstanceId.1=i-7177920a&Signature=MHKArgLDFZXKcn5R94a0OKfRSglhuh7nQVGDCHne7bo=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
-    body: 
-      string: ""
-    headers: 
-      User-Agent: 
-      - ""
-      Accept: 
-      - "*/*"
-  response: 
-    status: 
-      code: 200
-      message: OK
-    headers: 
-      Content-Type: 
-      - text/xml;charset=UTF-8
-      Server: 
-      - AmazonEC2
-      Transfer-Encoding: 
-      - chunked
-      Date: 
-      - Mon, 30 Jul 2012 11:07:52 GMT
-    body: 
-      string: |-
-        <?xml version="1.0" encoding="UTF-8"?>
-        <RebootInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>dac6168f-fbdc-4deb-9eae-5a2b115acaaa</requestId>
-            <return>true</return>
-        </RebootInstancesResponse>
-    http_version: 
-  recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
-- request: 
-    method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJYOQYLLOIWN5LQ3A&Action=DescribeInstances&InstanceId.1=i-7177920a&Signature=DHxm7p2CMHn5fzkybhIzC977iJ/i59rnLEIXVWdrTVE=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
-    body: 
-      string: ""
-    headers: 
-      User-Agent: 
-      - ""
-      Accept: 
-      - "*/*"
-  response: 
-    status: 
-      code: 200
-      message: OK
-    headers: 
-      Content-Type: 
-      - text/xml;charset=UTF-8
-      Server: 
-      - AmazonEC2
-      Transfer-Encoding: 
-      - chunked
-      Date: 
-      - Mon, 30 Jul 2012 11:07:53 GMT
-    body: 
-      string: |-
-        <?xml version="1.0" encoding="UTF-8"?>
-        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>61ad04de-03cc-43c1-b9b0-dac06751e2b7</requestId>
-            <reservationSet>
-                <item>
-                    <reservationId>r-362c9d52</reservationId>
-                    <ownerId>293787749884</ownerId>
-                    <groupSet>
-                        <item>
-                            <groupId>default</groupId>
-                        </item>
-                    </groupSet>
-                    <instancesSet>
-                        <item>
-                            <instanceId>i-7177920a</instanceId>
-                            <imageId>ami-aecd60c7</imageId>
-                            <instanceState>
-                                <code>16</code>
-                                <name>running</name>
-                            </instanceState>
-                            <privateDnsName>domU-12-31-39-02-75-62.compute-1.internal</privateDnsName>
-                            <dnsName>ec2-23-20-114-135.compute-1.amazonaws.com</dnsName>
-                            <reason/>
-                            <amiLaunchIndex>0</amiLaunchIndex>
-                            <productCodes/>
-                            <instanceType>t1.micro</instanceType>
-                            <launchTime>2012-07-30T11:07:18.000Z</launchTime>
-                            <placement>
-                                <availabilityZone>us-east-1a</availabilityZone>
-                                <groupName/>
-                            </placement>
-                            <kernelId>aki-88aa75e1</kernelId>
-                            <monitoring>
-                                <state>disabled</state>
-                            </monitoring>
-                            <privateIpAddress>10.248.122.144</privateIpAddress>
-                            <ipAddress>23.20.114.135</ipAddress>
-                            <architecture>x86_64</architecture>
-                            <rootDeviceType>ebs</rootDeviceType>
-                            <rootDeviceName>/dev/sda1</rootDeviceName>
-                            <blockDeviceMapping>
-                                <item>
-                                    <deviceName>/dev/sda1</deviceName>
-                                    <ebs>
-                                        <volumeId>vol-ba6f60db</volumeId>
-                                        <status>attached</status>
-                                        <attachTime>2012-07-30T11:07:42.000Z</attachTime>
-                                        <deleteOnTermination>true</deleteOnTermination>
-                                    </ebs>
-                                </item>
-                            </blockDeviceMapping>
-                            <virtualizationType>paravirtual</virtualizationType>
-                            <clientToken/>
-                        </item>
-                    </instancesSet>
-                </item>
-            </reservationSet>
-        </DescribeInstancesResponse>
-    http_version: 
-  recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
-- request: 
-    method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJYOQYLLOIWN5LQ3A&Action=DescribeInstances&InstanceId.1=i-7177920a&Signature=DHxm7p2CMHn5fzkybhIzC977iJ/i59rnLEIXVWdrTVE=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
-    body: 
-      string: ""
-    headers: 
-      User-Agent: 
-      - ""
-      Accept: 
-      - "*/*"
-  response: 
-    status: 
-      code: 200
-      message: OK
-    headers: 
-      Content-Type: 
-      - text/xml;charset=UTF-8
-      Server: 
-      - AmazonEC2
-      Transfer-Encoding: 
-      - chunked
-      Date: 
-      - Mon, 30 Jul 2012 11:07:53 GMT
-    body: 
-      string: |-
-        <?xml version="1.0" encoding="UTF-8"?>
-        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>ee6ecedd-45e9-4d42-9168-391a87e556f0</requestId>
-            <reservationSet>
-                <item>
-                    <reservationId>r-362c9d52</reservationId>
-                    <ownerId>293787749884</ownerId>
-                    <groupSet>
-                        <item>
-                            <groupId>default</groupId>
-                        </item>
-                    </groupSet>
-                    <instancesSet>
-                        <item>
-                            <instanceId>i-7177920a</instanceId>
-                            <imageId>ami-aecd60c7</imageId>
-                            <instanceState>
-                                <code>16</code>
-                                <name>running</name>
-                            </instanceState>
-                            <privateDnsName>domU-12-31-39-02-75-62.compute-1.internal</privateDnsName>
-                            <dnsName>ec2-23-20-114-135.compute-1.amazonaws.com</dnsName>
-                            <reason/>
-                            <amiLaunchIndex>0</amiLaunchIndex>
-                            <productCodes/>
-                            <instanceType>t1.micro</instanceType>
-                            <launchTime>2012-07-30T11:07:18.000Z</launchTime>
-                            <placement>
-                                <availabilityZone>us-east-1a</availabilityZone>
-                                <groupName/>
-                            </placement>
-                            <kernelId>aki-88aa75e1</kernelId>
-                            <monitoring>
-                                <state>disabled</state>
-                            </monitoring>
-                            <privateIpAddress>10.248.122.144</privateIpAddress>
-                            <ipAddress>23.20.114.135</ipAddress>
-                            <architecture>x86_64</architecture>
-                            <rootDeviceType>ebs</rootDeviceType>
-                            <rootDeviceName>/dev/sda1</rootDeviceName>
-                            <blockDeviceMapping>
-                                <item>
-                                    <deviceName>/dev/sda1</deviceName>
-                                    <ebs>
-                                        <volumeId>vol-ba6f60db</volumeId>
-                                        <status>attached</status>
-                                        <attachTime>2012-07-30T11:07:42.000Z</attachTime>
-                                        <deleteOnTermination>true</deleteOnTermination>
-                                    </ebs>
-                                </item>
-                            </blockDeviceMapping>
-                            <virtualizationType>paravirtual</virtualizationType>
-                            <clientToken/>
-                        </item>
-                    </instancesSet>
-                </item>
-            </reservationSet>
-        </DescribeInstancesResponse>
-    http_version: 
-  recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
-- request: 
-    method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJYOQYLLOIWN5LQ3A&Action=TerminateInstances&InstanceId.1=i-7177920a&Signature=nGpU/fD4fCQiwW7gRirEQ4ZlzZ/Fdo7Wl9g0IGT1oLI=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
-    body: 
-      string: ""
-    headers: 
-      User-Agent: 
-      - ""
-      Accept: 
-      - "*/*"
-  response: 
-    status: 
-      code: 200
-      message: OK
-    headers: 
-      Content-Type: 
-      - text/xml;charset=UTF-8
-      Server: 
-      - AmazonEC2
-      Transfer-Encoding: 
-      - chunked
-      Date: 
-      - Mon, 30 Jul 2012 11:07:54 GMT
-    body: 
-      string: |-
-        <?xml version="1.0" encoding="UTF-8"?>
-        <TerminateInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>7e42a612-937d-43e4-8750-eac942ccfe5d</requestId>
-            <instancesSet>
-                <item>
-                    <instanceId>i-7177920a</instanceId>
-                    <currentState>
-                        <code>32</code>
-                        <name>shutting-down</name>
-                    </currentState>
-                    <previousState>
-                        <code>16</code>
-                        <name>running</name>
-                    </previousState>
-                </item>
-            </instancesSet>
-        </TerminateInstancesResponse>
-    http_version: 
-  recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
-- request: 
-    method: get
-    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJYOQYLLOIWN5LQ3A&Action=DescribeInstances&InstanceId.1=i-7177920a&Signature=DHxm7p2CMHn5fzkybhIzC977iJ/i59rnLEIXVWdrTVE=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
-    body: 
-      string: ""
-    headers: 
-      User-Agent: 
-      - ""
-      Accept: 
-      - "*/*"
-  response: 
-    status: 
-      code: 200
-      message: OK
-    headers: 
-      Content-Type: 
-      - text/xml;charset=UTF-8
-      Server: 
-      - AmazonEC2
-      Transfer-Encoding: 
-      - chunked
-      Date: 
-      - Mon, 30 Jul 2012 11:07:54 GMT
-    body: 
-      string: |-
-        <?xml version="1.0" encoding="UTF-8"?>
-        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
-            <requestId>dacf4f94-b784-49c7-93c2-95e8b6b69aa4</requestId>
-            <reservationSet>
-                <item>
-                    <reservationId>r-362c9d52</reservationId>
-                    <ownerId>293787749884</ownerId>
-                    <groupSet>
-                        <item>
-                            <groupId>default</groupId>
-                        </item>
-                    </groupSet>
-                    <instancesSet>
-                        <item>
-                            <instanceId>i-7177920a</instanceId>
-                            <imageId>ami-aecd60c7</imageId>
-                            <instanceState>
-                                <code>32</code>
-                                <name>shutting-down</name>
-                            </instanceState>
-                            <privateDnsName>domU-12-31-39-02-75-62.compute-1.internal</privateDnsName>
-                            <dnsName>ec2-23-20-114-135.compute-1.amazonaws.com</dnsName>
-                            <reason>User initiated (2012-07-30 11:07:54 GMT)</reason>
-                            <amiLaunchIndex>0</amiLaunchIndex>
-                            <productCodes/>
-                            <instanceType>t1.micro</instanceType>
-                            <launchTime>2012-07-30T11:07:18.000Z</launchTime>
-                            <placement>
-                                <availabilityZone>us-east-1a</availabilityZone>
-                                <groupName/>
-                            </placement>
-                            <kernelId>aki-88aa75e1</kernelId>
-                            <monitoring>
-                                <state>disabled</state>
-                            </monitoring>
-                            <privateIpAddress>10.248.122.144</privateIpAddress>
-                            <ipAddress>23.20.114.135</ipAddress>
-                            <stateReason>
-                                <code>Client.UserInitiatedShutdown</code>
-                                <message>Client.UserInitiatedShutdown: User initiated shutdown</message>
-                            </stateReason>
-                            <architecture>x86_64</architecture>
-                            <rootDeviceType>ebs</rootDeviceType>
-                            <rootDeviceName>/dev/sda1</rootDeviceName>
-                            <blockDeviceMapping>
-                                <item>
-                                    <deviceName>/dev/sda1</deviceName>
-                                    <ebs>
-                                        <volumeId>vol-ba6f60db</volumeId>
-                                        <status>attached</status>
-                                        <attachTime>2012-07-30T11:07:42.000Z</attachTime>
-                                        <deleteOnTermination>true</deleteOnTermination>
-                                    </ebs>
-                                </item>
-                            </blockDeviceMapping>
-                            <virtualizationType>paravirtual</virtualizationType>
-                            <clientToken/>
-                        </item>
-                    </instancesSet>
-                </item>
-            </reservationSet>
-        </DescribeInstancesResponse>
-    http_version: 
-  recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
-recorded_with: VCR 2.2.4
diff --git a/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-10.yml b/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-10.yml
new file mode 100644
index 0000000..0769203
--- /dev/null
+++ b/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-10.yml
@@ -0,0 +1,76 @@
+--- 
+recorded_with: VCR 2.2.4
+http_interactions: 
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeInstances&InstanceId.1=i-768c640c&Signature=shomJVeFPrz90AAOdMTk8Zb+9bZy7WUxKgoQWf4KSLs=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:24:40.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:24:40 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>2be56170-2b04-499f-a9be-3e21de9f2a26</requestId>
+            <reservationSet>
+                <item>
+                    <reservationId>r-1ff40478</reservationId>
+                    <ownerId>122214243412</ownerId>
+                    <groupSet>
+                        <item>
+                            <groupId>default</groupId>
+                        </item>
+                    </groupSet>
+                    <instancesSet>
+                        <item>
+                            <instanceId>i-768c640c</instanceId>
+                            <imageId>ami-aecd60c7</imageId>
+                            <instanceState>
+                                <code>0</code>
+                                <name>pending</name>
+                            </instanceState>
+                            <privateDnsName/>
+                            <dnsName/>
+                            <reason/>
+                            <amiLaunchIndex>0</amiLaunchIndex>
+                            <productCodes/>
+                            <instanceType>t1.micro</instanceType>
+                            <launchTime>2012-08-28T23:24:39.000Z</launchTime>
+                            <placement>
+                                <availabilityZone>us-east-1a</availabilityZone>
+                                <groupName/>
+                            </placement>
+                            <kernelId>aki-88aa75e1</kernelId>
+                            <monitoring>
+                                <state>disabled</state>
+                            </monitoring>
+                            <architecture>x86_64</architecture>
+                            <rootDeviceType>ebs</rootDeviceType>
+                            <rootDeviceName>/dev/sda1</rootDeviceName>
+                            <blockDeviceMapping/>
+                            <virtualizationType>paravirtual</virtualizationType>
+                            <clientToken/>
+                        </item>
+                    </instancesSet>
+                </item>
+            </reservationSet>
+        </DescribeInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:24:40 GMT
diff --git a/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-8.yml b/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-8.yml
new file mode 100644
index 0000000..e8922c1
--- /dev/null
+++ b/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-8.yml
@@ -0,0 +1,88 @@
+--- 
+recorded_with: VCR 2.2.4
+http_interactions: 
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeInstances&InstanceId.1=i-768c640c&Signature=FWu1FLJ8Rx57569ZJEcQrj+wbU8mQ/NBiE7fYTWr290=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:01.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:25:01 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>e1f6400b-c8ca-40a2-bb45-fe13b42dd0ce</requestId>
+            <reservationSet>
+                <item>
+                    <reservationId>r-1ff40478</reservationId>
+                    <ownerId>122214243412</ownerId>
+                    <groupSet>
+                        <item>
+                            <groupId>default</groupId>
+                        </item>
+                    </groupSet>
+                    <instancesSet>
+                        <item>
+                            <instanceId>i-768c640c</instanceId>
+                            <imageId>ami-aecd60c7</imageId>
+                            <instanceState>
+                                <code>16</code>
+                                <name>running</name>
+                            </instanceState>
+                            <privateDnsName>domU-12-31-39-03-CA-6E.compute-1.internal</privateDnsName>
+                            <dnsName>ec2-23-22-221-103.compute-1.amazonaws.com</dnsName>
+                            <reason/>
+                            <amiLaunchIndex>0</amiLaunchIndex>
+                            <productCodes/>
+                            <instanceType>t1.micro</instanceType>
+                            <launchTime>2012-08-28T23:24:39.000Z</launchTime>
+                            <placement>
+                                <availabilityZone>us-east-1a</availabilityZone>
+                                <groupName/>
+                            </placement>
+                            <kernelId>aki-88aa75e1</kernelId>
+                            <monitoring>
+                                <state>disabled</state>
+                            </monitoring>
+                            <privateIpAddress>10.249.201.152</privateIpAddress>
+                            <ipAddress>23.22.221.103</ipAddress>
+                            <architecture>x86_64</architecture>
+                            <rootDeviceType>ebs</rootDeviceType>
+                            <rootDeviceName>/dev/sda1</rootDeviceName>
+                            <blockDeviceMapping>
+                                <item>
+                                    <deviceName>/dev/sda1</deviceName>
+                                    <ebs>
+                                        <volumeId>vol-75aa0f0e</volumeId>
+                                        <status>attached</status>
+                                        <attachTime>2012-08-28T23:25:01.000Z</attachTime>
+                                        <deleteOnTermination>true</deleteOnTermination>
+                                    </ebs>
+                                </item>
+                            </blockDeviceMapping>
+                            <virtualizationType>paravirtual</virtualizationType>
+                            <clientToken/>
+                        </item>
+                    </instancesSet>
+                </item>
+            </reservationSet>
+        </DescribeInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:25:02 GMT
diff --git a/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-9.yml b/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-9.yml
new file mode 100644
index 0000000..5f1043b
--- /dev/null
+++ b/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-9.yml
@@ -0,0 +1,76 @@
+--- 
+recorded_with: VCR 2.2.4
+http_interactions: 
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeInstances&InstanceId.1=i-768c640c&Signature=eDq/2+kVeLxeyHSksc7JDVsk9XUHplUeLHvpXQPUfp4=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:24:50.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:24:50 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>fcfdf0b8-f53a-48f0-996d-b065d21b5ff3</requestId>
+            <reservationSet>
+                <item>
+                    <reservationId>r-1ff40478</reservationId>
+                    <ownerId>122214243412</ownerId>
+                    <groupSet>
+                        <item>
+                            <groupId>default</groupId>
+                        </item>
+                    </groupSet>
+                    <instancesSet>
+                        <item>
+                            <instanceId>i-768c640c</instanceId>
+                            <imageId>ami-aecd60c7</imageId>
+                            <instanceState>
+                                <code>0</code>
+                                <name>pending</name>
+                            </instanceState>
+                            <privateDnsName/>
+                            <dnsName/>
+                            <reason/>
+                            <amiLaunchIndex>0</amiLaunchIndex>
+                            <productCodes/>
+                            <instanceType>t1.micro</instanceType>
+                            <launchTime>2012-08-28T23:24:39.000Z</launchTime>
+                            <placement>
+                                <availabilityZone>us-east-1a</availabilityZone>
+                                <groupName/>
+                            </placement>
+                            <kernelId>aki-88aa75e1</kernelId>
+                            <monitoring>
+                                <state>disabled</state>
+                            </monitoring>
+                            <architecture>x86_64</architecture>
+                            <rootDeviceType>ebs</rootDeviceType>
+                            <rootDeviceName>/dev/sda1</rootDeviceName>
+                            <blockDeviceMapping/>
+                            <virtualizationType>paravirtual</virtualizationType>
+                            <clientToken/>
+                        </item>
+                    </instancesSet>
+                </item>
+            </reservationSet>
+        </DescribeInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:24:51 GMT
diff --git a/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-stopped-10.yml b/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-stopped-10.yml
new file mode 100644
index 0000000..fae02c7
--- /dev/null
+++ b/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state-stopped-10.yml
@@ -0,0 +1,92 @@
+--- 
+recorded_with: VCR 2.2.4
+http_interactions: 
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeInstances&InstanceId.1=i-768c640c&Signature=CaDNHQcCS+m5OWCZLgeRwOa7xGt69trAaPuN8L1/6AM=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:05.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:25:05 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>bdfd429f-e248-4106-8bae-4300893775b2</requestId>
+            <reservationSet>
+                <item>
+                    <reservationId>r-1ff40478</reservationId>
+                    <ownerId>122214243412</ownerId>
+                    <groupSet>
+                        <item>
+                            <groupId>default</groupId>
+                        </item>
+                    </groupSet>
+                    <instancesSet>
+                        <item>
+                            <instanceId>i-768c640c</instanceId>
+                            <imageId>ami-aecd60c7</imageId>
+                            <instanceState>
+                                <code>32</code>
+                                <name>shutting-down</name>
+                            </instanceState>
+                            <privateDnsName>domU-12-31-39-03-CA-6E.compute-1.internal</privateDnsName>
+                            <dnsName>ec2-23-22-221-103.compute-1.amazonaws.com</dnsName>
+                            <reason>User initiated (2012-08-28 23:25:04 GMT)</reason>
+                            <amiLaunchIndex>0</amiLaunchIndex>
+                            <productCodes/>
+                            <instanceType>t1.micro</instanceType>
+                            <launchTime>2012-08-28T23:24:39.000Z</launchTime>
+                            <placement>
+                                <availabilityZone>us-east-1a</availabilityZone>
+                                <groupName/>
+                            </placement>
+                            <kernelId>aki-88aa75e1</kernelId>
+                            <monitoring>
+                                <state>disabled</state>
+                            </monitoring>
+                            <privateIpAddress>10.249.201.152</privateIpAddress>
+                            <ipAddress>23.22.221.103</ipAddress>
+                            <stateReason>
+                                <code>Client.UserInitiatedShutdown</code>
+                                <message>Client.UserInitiatedShutdown: User initiated shutdown</message>
+                            </stateReason>
+                            <architecture>x86_64</architecture>
+                            <rootDeviceType>ebs</rootDeviceType>
+                            <rootDeviceName>/dev/sda1</rootDeviceName>
+                            <blockDeviceMapping>
+                                <item>
+                                    <deviceName>/dev/sda1</deviceName>
+                                    <ebs>
+                                        <volumeId>vol-75aa0f0e</volumeId>
+                                        <status>attached</status>
+                                        <attachTime>2012-08-28T23:25:01.000Z</attachTime>
+                                        <deleteOnTermination>true</deleteOnTermination>
+                                    </ebs>
+                                </item>
+                            </blockDeviceMapping>
+                            <virtualizationType>paravirtual</virtualizationType>
+                            <clientToken/>
+                        </item>
+                    </instancesSet>
+                </item>
+            </reservationSet>
+        </DescribeInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:25:05 GMT
diff --git a/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state.yml b/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state.yml
new file mode 100644
index 0000000..e30571b
--- /dev/null
+++ b/server/tests/drivers/ec2/fixtures/test_0008_must_allow_to_reboot_instance_in_running_state.yml
@@ -0,0 +1,411 @@
+--- 
+recorded_with: VCR 2.2.4
+http_interactions: 
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=RunInstances&AddressingType=public&ImageId=ami-aecd60c7&InstanceType=t1.micro&MaxCount=1&MinCount=1&Placement.AvailabilityZone=us-east-1a&Signature=7TAagHYZvKkM2voACsypZzEVxTRT2pqPougPiTKaePw=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:24:39.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:24:39 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <RunInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>945c368c-8dd3-42c8-8923-b3ced28e763e</requestId>
+            <reservationId>r-1ff40478</reservationId>
+            <ownerId>122214243412</ownerId>
+            <groupSet>
+                <item>
+                    <groupId>default</groupId>
+                </item>
+            </groupSet>
+            <instancesSet>
+                <item>
+                    <instanceId>i-768c640c</instanceId>
+                    <imageId>ami-aecd60c7</imageId>
+                    <instanceState>
+                        <code>0</code>
+                        <name>pending</name>
+                    </instanceState>
+                    <privateDnsName/>
+                    <dnsName/>
+                    <reason/>
+                    <amiLaunchIndex>0</amiLaunchIndex>
+                    <productCodes/>
+                    <instanceType>t1.micro</instanceType>
+                    <launchTime>2012-08-28T23:24:39.000Z</launchTime>
+                    <placement>
+                        <availabilityZone>us-east-1a</availabilityZone>
+                        <groupName/>
+                    </placement>
+                    <kernelId>aki-88aa75e1</kernelId>
+                    <monitoring>
+                        <state>disabled</state>
+                    </monitoring>
+                    <stateReason>
+                        <code>pending</code>
+                        <message>pending</message>
+                    </stateReason>
+                    <architecture>x86_64</architecture>
+                    <rootDeviceType>ebs</rootDeviceType>
+                    <rootDeviceName>/dev/sda1</rootDeviceName>
+                    <blockDeviceMapping/>
+                    <virtualizationType>paravirtual</virtualizationType>
+                    <clientToken/>
+                </item>
+            </instancesSet>
+        </RunInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:24:40 GMT
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=RebootInstances&InstanceId.1=i-768c640c&Signature=i2hVf4DeZwGGOvnnOT3znwTn7XZTnjWhfb1Q3sEGbgs=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:02.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:25:02 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <RebootInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>630ce453-2d41-4c0d-ab27-140db812d4b1</requestId>
+            <return>true</return>
+        </RebootInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:25:02 GMT
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeInstances&InstanceId.1=i-768c640c&Signature=fwLguKJtHglYEbm+ammmPmaXPMAT9sSg1/EG9XEq6fM=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:02.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:25:03 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>a1f18086-624c-4e8e-a81c-ebf736b9f344</requestId>
+            <reservationSet>
+                <item>
+                    <reservationId>r-1ff40478</reservationId>
+                    <ownerId>122214243412</ownerId>
+                    <groupSet>
+                        <item>
+                            <groupId>default</groupId>
+                        </item>
+                    </groupSet>
+                    <instancesSet>
+                        <item>
+                            <instanceId>i-768c640c</instanceId>
+                            <imageId>ami-aecd60c7</imageId>
+                            <instanceState>
+                                <code>16</code>
+                                <name>running</name>
+                            </instanceState>
+                            <privateDnsName>domU-12-31-39-03-CA-6E.compute-1.internal</privateDnsName>
+                            <dnsName>ec2-23-22-221-103.compute-1.amazonaws.com</dnsName>
+                            <reason/>
+                            <amiLaunchIndex>0</amiLaunchIndex>
+                            <productCodes/>
+                            <instanceType>t1.micro</instanceType>
+                            <launchTime>2012-08-28T23:24:39.000Z</launchTime>
+                            <placement>
+                                <availabilityZone>us-east-1a</availabilityZone>
+                                <groupName/>
+                            </placement>
+                            <kernelId>aki-88aa75e1</kernelId>
+                            <monitoring>
+                                <state>disabled</state>
+                            </monitoring>
+                            <privateIpAddress>10.249.201.152</privateIpAddress>
+                            <ipAddress>23.22.221.103</ipAddress>
+                            <architecture>x86_64</architecture>
+                            <rootDeviceType>ebs</rootDeviceType>
+                            <rootDeviceName>/dev/sda1</rootDeviceName>
+                            <blockDeviceMapping>
+                                <item>
+                                    <deviceName>/dev/sda1</deviceName>
+                                    <ebs>
+                                        <volumeId>vol-75aa0f0e</volumeId>
+                                        <status>attached</status>
+                                        <attachTime>2012-08-28T23:25:01.000Z</attachTime>
+                                        <deleteOnTermination>true</deleteOnTermination>
+                                    </ebs>
+                                </item>
+                            </blockDeviceMapping>
+                            <virtualizationType>paravirtual</virtualizationType>
+                            <clientToken/>
+                        </item>
+                    </instancesSet>
+                </item>
+            </reservationSet>
+        </DescribeInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:25:03 GMT
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeInstances&InstanceId.1=i-768c640c&Signature=oOTcViQozv2KBCKISS1arGBbGhi/xMSwpfrgNuBK1co=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:03.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:25:03 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>be67624c-43dd-4f58-a2ed-3ed3358ea70d</requestId>
+            <reservationSet>
+                <item>
+                    <reservationId>r-1ff40478</reservationId>
+                    <ownerId>122214243412</ownerId>
+                    <groupSet>
+                        <item>
+                            <groupId>default</groupId>
+                        </item>
+                    </groupSet>
+                    <instancesSet>
+                        <item>
+                            <instanceId>i-768c640c</instanceId>
+                            <imageId>ami-aecd60c7</imageId>
+                            <instanceState>
+                                <code>16</code>
+                                <name>running</name>
+                            </instanceState>
+                            <privateDnsName>domU-12-31-39-03-CA-6E.compute-1.internal</privateDnsName>
+                            <dnsName>ec2-23-22-221-103.compute-1.amazonaws.com</dnsName>
+                            <reason/>
+                            <amiLaunchIndex>0</amiLaunchIndex>
+                            <productCodes/>
+                            <instanceType>t1.micro</instanceType>
+                            <launchTime>2012-08-28T23:24:39.000Z</launchTime>
+                            <placement>
+                                <availabilityZone>us-east-1a</availabilityZone>
+                                <groupName/>
+                            </placement>
+                            <kernelId>aki-88aa75e1</kernelId>
+                            <monitoring>
+                                <state>disabled</state>
+                            </monitoring>
+                            <privateIpAddress>10.249.201.152</privateIpAddress>
+                            <ipAddress>23.22.221.103</ipAddress>
+                            <architecture>x86_64</architecture>
+                            <rootDeviceType>ebs</rootDeviceType>
+                            <rootDeviceName>/dev/sda1</rootDeviceName>
+                            <blockDeviceMapping>
+                                <item>
+                                    <deviceName>/dev/sda1</deviceName>
+                                    <ebs>
+                                        <volumeId>vol-75aa0f0e</volumeId>
+                                        <status>attached</status>
+                                        <attachTime>2012-08-28T23:25:01.000Z</attachTime>
+                                        <deleteOnTermination>true</deleteOnTermination>
+                                    </ebs>
+                                </item>
+                            </blockDeviceMapping>
+                            <virtualizationType>paravirtual</virtualizationType>
+                            <clientToken/>
+                        </item>
+                    </instancesSet>
+                </item>
+            </reservationSet>
+        </DescribeInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:25:03 GMT
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=TerminateInstances&InstanceId.1=i-768c640c&Signature=kTmPtjoaUUqtXzwg3u3DEiK5i95ENZWKKRnkNJk9+aw=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:03.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:25:03 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <TerminateInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>5f727b94-b7b6-42d7-a91d-656f84614b98</requestId>
+            <instancesSet>
+                <item>
+                    <instanceId>i-768c640c</instanceId>
+                    <currentState>
+                        <code>32</code>
+                        <name>shutting-down</name>
+                    </currentState>
+                    <previousState>
+                        <code>16</code>
+                        <name>running</name>
+                    </previousState>
+                </item>
+            </instancesSet>
+        </TerminateInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:25:04 GMT
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJHMN5TTUKVLK5WCQ&Action=DescribeInstances&InstanceId.1=i-768c640c&Signature=ma4c9NIDY+wOdJZwqEg6JciJwSq6jgj/Ip8G63vrjhk=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-28T23:25:04.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      Accept: 
+      - "*/*"
+      User-Agent: 
+      - ""
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Date: 
+      - Tue, 28 Aug 2012 23:25:04 GMT
+      Transfer-Encoding: 
+      - chunked
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>56a061b3-3d36-459a-80cf-544717a0165f</requestId>
+            <reservationSet>
+                <item>
+                    <reservationId>r-1ff40478</reservationId>
+                    <ownerId>122214243412</ownerId>
+                    <groupSet>
+                        <item>
+                            <groupId>default</groupId>
+                        </item>
+                    </groupSet>
+                    <instancesSet>
+                        <item>
+                            <instanceId>i-768c640c</instanceId>
+                            <imageId>ami-aecd60c7</imageId>
+                            <instanceState>
+                                <code>32</code>
+                                <name>shutting-down</name>
+                            </instanceState>
+                            <privateDnsName>domU-12-31-39-03-CA-6E.compute-1.internal</privateDnsName>
+                            <dnsName>ec2-23-22-221-103.compute-1.amazonaws.com</dnsName>
+                            <reason>User initiated (2012-08-28 23:25:04 GMT)</reason>
+                            <amiLaunchIndex>0</amiLaunchIndex>
+                            <productCodes/>
+                            <instanceType>t1.micro</instanceType>
+                            <launchTime>2012-08-28T23:24:39.000Z</launchTime>
+                            <placement>
+                                <availabilityZone>us-east-1a</availabilityZone>
+                                <groupName/>
+                            </placement>
+                            <kernelId>aki-88aa75e1</kernelId>
+                            <monitoring>
+                                <state>disabled</state>
+                            </monitoring>
+                            <privateIpAddress>10.249.201.152</privateIpAddress>
+                            <ipAddress>23.22.221.103</ipAddress>
+                            <stateReason>
+                                <code>Client.UserInitiatedShutdown</code>
+                                <message>Client.UserInitiatedShutdown: User initiated shutdown</message>
+                            </stateReason>
+                            <architecture>x86_64</architecture>
+                            <rootDeviceType>ebs</rootDeviceType>
+                            <rootDeviceName>/dev/sda1</rootDeviceName>
+                            <blockDeviceMapping>
+                                <item>
+                                    <deviceName>/dev/sda1</deviceName>
+                                    <ebs>
+                                        <volumeId>vol-75aa0f0e</volumeId>
+                                        <status>attached</status>
+                                        <attachTime>2012-08-28T23:25:01.000Z</attachTime>
+                                        <deleteOnTermination>true</deleteOnTermination>
+                                    </ebs>
+                                </item>
+                            </blockDeviceMapping>
+                            <virtualizationType>paravirtual</virtualizationType>
+                            <clientToken/>
+                        </item>
+                    </instancesSet>
+                </item>
+            </reservationSet>
+        </DescribeInstancesResponse>
+    http_version: 
+  recorded_at: Tue, 28 Aug 2012 23:25:05 GMT
diff --git a/server/tests/drivers/ec2/fixtures/test_0009_must_allow_to_reboot_instance_in_running_state-9.yml b/server/tests/drivers/ec2/fixtures/test_0009_must_allow_to_reboot_instance_in_running_state-9.yml
new file mode 100644
index 0000000..b6f1760
--- /dev/null
+++ b/server/tests/drivers/ec2/fixtures/test_0009_must_allow_to_reboot_instance_in_running_state-9.yml
@@ -0,0 +1,88 @@
+--- 
+http_interactions: 
+- request: 
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=AKIAJYOQYLLOIWN5LQ3A&Action=DescribeInstances&InstanceId.1=i-7177920a&Signature=DHxm7p2CMHn5fzkybhIzC977iJ/i59rnLEIXVWdrTVE=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
+    body: 
+      string: ""
+    headers: 
+      User-Agent: 
+      - ""
+      Accept: 
+      - "*/*"
+  response: 
+    status: 
+      code: 200
+      message: OK
+    headers: 
+      Content-Type: 
+      - text/xml;charset=UTF-8
+      Server: 
+      - AmazonEC2
+      Transfer-Encoding: 
+      - chunked
+      Date: 
+      - Mon, 30 Jul 2012 11:07:29 GMT
+    body: 
+      string: |-
+        <?xml version="1.0" encoding="UTF-8"?>
+        <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2010-08-31/">
+            <requestId>c28d5a60-c784-4b86-976a-da4ad72f3b57</requestId>
+            <reservationSet>
+                <item>
+                    <reservationId>r-362c9d52</reservationId>
+                    <ownerId>293787749884</ownerId>
+                    <groupSet>
+                        <item>
+                            <groupId>default</groupId>
+                        </item>
+                    </groupSet>
+                    <instancesSet>
+                        <item>
+                            <instanceId>i-7177920a</instanceId>
+                            <imageId>ami-aecd60c7</imageId>
+                            <instanceState>
+                                <code>0</code>
+                                <name>pending</name>
+                            </instanceState>
+                            <privateDnsName>domU-12-31-39-02-75-62.compute-1.internal</privateDnsName>
+                            <dnsName>ec2-23-20-114-135.compute-1.amazonaws.com</dnsName>
+                            <reason/>
+                            <amiLaunchIndex>0</amiLaunchIndex>
+                            <productCodes/>
+                            <instanceType>t1.micro</instanceType>
+                            <launchTime>2012-07-30T11:07:18.000Z</launchTime>
+                            <placement>
+                                <availabilityZone>us-east-1a</availabilityZone>
+                                <groupName/>
+                            </placement>
+                            <kernelId>aki-88aa75e1</kernelId>
+                            <monitoring>
+                                <state>disabled</state>
+                            </monitoring>
+                            <privateIpAddress>10.248.122.144</privateIpAddress>
+                            <ipAddress>23.20.114.135</ipAddress>
+                            <architecture>x86_64</architecture>
+                            <rootDeviceType>ebs</rootDeviceType>
+                            <rootDeviceName>/dev/sda1</rootDeviceName>
+                            <blockDeviceMapping>
+                                <item>
+                                    <deviceName>/dev/sda1</deviceName>
+                                    <ebs>
+                                        <volumeId>vol-ba6f60db</volumeId>
+                                        <status>attaching</status>
+                                        <attachTime>2012-07-30T11:07:24.000Z</attachTime>
+                                        <deleteOnTermination>true</deleteOnTermination>
+                                    </ebs>
+                                </item>
+                            </blockDeviceMapping>
+                            <virtualizationType>paravirtual</virtualizationType>
+                            <clientToken/>
+                        </item>
+                    </instancesSet>
+                </item>
+            </reservationSet>
+        </DescribeInstancesResponse>
+    http_version: 
+  recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
+recorded_with: VCR 2.2.4
diff --git a/server/tests/drivers/ec2/instance_test.rb b/server/tests/drivers/ec2/instance_test.rb
index ed50c7d..2cbf848 100644
--- a/server/tests/drivers/ec2/instance_test.rb
+++ b/server/tests/drivers/ec2/instance_test.rb
@@ -90,6 +90,16 @@ describe 'Ec2Driver Instances' do
     instances.each { |i| i.is_stopped?.must_equal true }
   end
 
+  it 'must allow creating instance in a VPC subnet' do
+    realm_id = "#{@@subnet[:availability_zone]}:#{@@subnet[:subnet_id]}"
+    instance = @driver.create_instance('ami-aecd60c7',
+                                       :realm_id => realm_id,
+                                       :hwp_id => 'm1.small')
+    instance.must_be_kind_of Instance
+    instance.realm_id.must_equal realm_id
+    @driver.destroy_instance(instance.id)
+  end
+
   it 'must allow to reboot instance in running state' do
     instance = @driver.create_instance('ami-aecd60c7', :realm_id => 'us-east-1a', :hwp_id => 't1.micro')
     instance = instance.wait_for!(@driver, record_retries) { |i| i.is_running? }
-- 
1.7.7.6


Mime
View raw message