ACK(ish) - some thoughts:

On 14/02/12 15:10, [email protected] wrote:
> From: Michal Fojtik <[email protected]>
> 
> 
> Signed-off-by: Michal fojtik <[email protected]>
> ---
>  server/lib/deltacloud/drivers/ec2/ec2_driver.rb    |    7 +++++++
 6 files changed, 19 insertions(+), 4 deletions(-)
> 
> diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb 
> b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> index 44db93a..6101bd2 100644
> --- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> +++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> @@ -791,6 +791,8 @@ module Deltacloud
>              :description => image[:aws_description] || image[:aws_location],
>              :owner_id => image[:aws_owner],
>              :architecture => image[:aws_architecture],
> +            # Credentials are not needed for EC2 driver hardware profiles:
> +            :hardware_profiles => image_profiles(image),
>              :state => image[:aws_state]
>            )
>          end
> @@ -854,6 +856,11 @@ module Deltacloud
>            )
>          end
>  
> +        def image_profiles(image)
> +          profiles = hardware_profiles(nil, :architecture => 
> image[:aws_architecture])
> +          profiles.reject { |p| p.name == 't1.micro' } unless 
> image[:aws_root_device_type] == 'ebs'
> +        end

This is the 'safest' way to do it but it seems very costly - for every
image get a list of hw_profiles; we already know that the list of images
is pretty large (and based on recent conversations we might make this
even larger for listing e.g. all images in the worst case).

Right now the above is just 'filtering' on i386 vs x86_64 (i.e.
architecture). So can't we just assemble a hash of {i386=>[profiles],
x86_64=>profiles} once and use that for all images?

I understand that the point is eventually to enable the 'new' profiles
for the high performance computing. I just spent some time looking at
aws API looking for something in e.g. DescribeImage that would tell us
if an image is 'high performance compatible' - i.e. you can use the
'new' hardware profiles to solve
https://issues.apache.org/jira/browse/DTACLOUD-144 . Is this information
available in the fields you added in the AWS pull request
https://github.com/appoxy/aws/pull/106 ? If not, I don't know how are we
going to extend this code to handle jira DTACLOUD_144

> diff --git a/server/views/images/show.xml.haml 
> b/server/views/images/show.xml.haml
> index c1f5348..6f52218 100644
> --- a/server/views/images/show.xml.haml
> +++ b/server/views/images/show.xml.haml
> @@ -1,8 +1,12 @@

+ show.html.haml


marios

Reply via email to