【问题标题】:listing other than windows images from amazon using fog使用雾列出来自亚马逊的 Windows 图像以外的其他图像
【发布时间】:2014-04-22 09:59:14
【问题描述】:

我一直在为我的一个项目使用雾,我使用了带有过滤器参数的 describe_images,但现在我只获取 Windows 图像,那么有没有办法通过更改参数(平台)来获取其他 AMI? .举个例子 'platform => linux' 类似的东西

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 

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-4 fog


    【解决方案1】:

    根据API documentation for the DescribeInstances call...

    如果您有基于 Windows 的实例,请使用 Windows;否则,离开 空白。

    因此“windows”是该过滤器的唯一有效值,目前,根据the AWS developer forums,目前还没有过滤非 Windows 实例的方法:

    目前似乎没有办法过滤 linux 实例 使用 ec2-describe-instances。这是预期的行为,并不容易 此时的解决方法。我们将更新我们的文档以 反映这一点。对于给您带来的不便,我深表歉意。

    【讨论】:

    • 谢谢,实际上我没有找到一种通过雾填充这些 AMI 的正确方法。有什么建议吗?我的意思是用户可以选择操作系统和图像来创建新实例。
    • 其实这是 describe_instance,但我说的是使用雾的 describe_images?
    • 似乎描述图像存在相同的状态(docs.aws.amazon.com/AWSEC2/latest/APIReference/…)。也就是说,不幸的是,他们所说的唯一可以指定的平台是 windows。如果你只是省略了平台过滤器,你应该得到所有东西(如果你不想要它,你可能只需要在事后跳过窗口)。
    猜你喜欢
    • 2012-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-07
    • 2015-06-15
    相关资源
    最近更新 更多