On Feb 14, 2012, at 5:21 PM, [email protected] wrote:
> 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).
I agree, I'll rework it in way where I pass hardware_profiles as parameter
to image_profiles. I did not noticed any delay, maybe because the
hardware_profiles
are defined statically so there is no additional overheat by querying EC2.
But fair point.
> 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?
Agree. Will be fixed in rev-2.
> 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
Yes, you're right. I double checked DescribeImages and there is no way how to
know if the image is HPC or not (maybe from the image id/name, I need to look).
Right now this patch will just tell you if you can use t1.micro HWP for
launching
the image, which according to Aeolus guys would be very useful.
-- michal
------------------------------------------------------
Michal Fojtik, [email protected]
Deltacloud API: http://deltacloud.org