incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Crawley <tcraw...@redhat.com>
Subject Some testing of the proposed new ec2_driver w/aws gem
Date Wed, 24 Nov 2010 21:53:47 GMT
Michal:

I converted SteamCannon to use a version of Deltacloud based off of your
recently proposed ec2_driver rewrite. I realize it has been NACKed as it
exists now, but I wanted to test it a bit, and see if it would meet our
needs. This also gets SteamCannon closer to using the official
Deltacloud, assuming the patchset is reworked and eventually ACKed.

To get it working, I had to take the following steps:
- build a custom aws gem (based off of the fork at
http://github.com/tobias/aws that includes the fixes for it to run on
1.8.6)
- apply the my security group feature patch that is still pending
- make the CDATA changes for the error reporting XML (see the patch from
earlier today - this is required for error reporting to work properly
under JRuby)
- make the following fixes to Deltacloud (this patch probably won't
apply cleanly for you):
diff --git a/client/lib/deltacloud.rb b/client/lib/deltacloud.rb
index c632594..b4a28eb 100644
--- a/client/lib/deltacloud.rb
+++ b/client/lib/deltacloud.rb
@@ -167,7 +167,7 @@ module DeltaCloud
         end
 
         if attribute.name == 'mount'
-          obj.add_link!("instance", (attribute/"./instance/@id").first)
+          obj.add_link!("instance",
(attribute/"./instance/@id").first.value)
           obj.add_text!("device",
(attribute/"./device/@name").first.value)
           next
         end
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index c58c1b4..35d514e 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -168,8 +169,8 @@ module Deltacloud
           instance_options = {}
           instance_options.merge!(:user_data => opts[:user_data]) if
opts[:user_data]
           instance_options.merge!(:key_name => opts[:key_name]) if
opts[:key_name]
-          instance_options.merge!(:availability_zone =>
opts[:availability_zone]) if opts[:availability_zone]
+          instance_options.merge!(:availability_zone =>
opts[:realm_id]) if opts[:realm_id]
           instance_options.merge!(:instance_type => opts[:hwp_id]) if
opts[:hwp_id]
           safely do
             convert_instance(ec2.launch_instances(image_id,
instance_options).first)
           end
@@ -409,7 +411,7 @@ module Deltacloud
             :instance_profile =>
InstanceProfile.new(instance[:aws_instance_type]),
             :realm_id => instance[:aws_availability_zone],
             :private_addresses => instance[:private_dns_name],
-            :public_addresses => instance[:public_addresses]
+            :public_addresses => instance[:dns_name]
           )
         end
 
Other than that, it was changes to SteamCannon - the biggest 'gotcha'
being that the aws gem Base64 encodes user_data passed to EC2 on launch,
whereas amazon-ec2 did not, which meant we were doing it at the
application level.

SteamCannon seems to be working fine with these changes, but I have a
little more testing to do. Note that this only exercises instance and
storage_volume management - we don't use any of the bucket/blob Dc
features, only list keys & realms, and don't use any of the image
features.

Toby


Mime
View raw message