0

I have been using fog for one of my project,i have used describe_images with filter parameters, but now i am getting only the windows images, so is there any way to get the other AMIs with changing the parameter(platform)?. lets an example 'platform => linux' something like that

spec_images = @conn.describe_images('Owner' => 'amazon','platform' => 'windows')
my_images = spec_images.body["imagesSet"]

#  List image ID, architecture and location
for key in 0...my_images.length
  print my_images[key]["imageId"], "\t" , my_images[key]["architecture"] , "\t\t" ,     
my_images[key]["imageLocation"],  "\n";
end 
amtest
  • 690
  • 1
  • 6
  • 26

1 Answers1

2

According to the API documentation for the DescribeInstances call...

Use windows if you have Windows based instances; otherwise, leave blank.

So "windows" is the only valid value for that filter, presently, and according to the AWS developer forums, there isn't currently a way to filter for non-Windows instances:

It appears there is no way currently to filter for linux instances using ec2-describe-instances. This is expected behavior and no easy workaround at this time. We will be updating our documentation to reflect this. I apologize for the inconvenience.

Ash Wilson
  • 22,820
  • 3
  • 34
  • 45
  • thanks, actually i didn't get one proper way to populate these AMIs via fog. is there any suggestion to do that, i mean user can select the os and images to create the new instance. – amtest Apr 22 '14 at 13:23
  • actually this for the describe_instance, but i am talking about describe_images using the fog? – amtest Apr 23 '14 at 10:40
  • 1
    it appears that the same state of things is present for describe images (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeImages.html). Which is to say the only platform they say is valid to specify is, unfortunately, windows. If you simply omit the platform filter you should get everything (you may just have to skip windows after-the-fact if you don't want it). – geemus Apr 23 '14 at 13:56