如何在预留实例市场中查找可用的“二手”AWS EC2 实例?

如何在预留实例市场中查找可用的“二手”AWS EC2 实例?

我需要一个持续运行 1 个月的 AWS EC2 实例,并且正在寻找正常按需价格的替代方案。

有很多文章描述了如何在预留实例市场中选择二手预留实例https://www.metricly.com/aws-reserved-instance-marketplace/或者一篇非常古老的 AWS 博客文章https://aws.amazon.com/blogs/aws/amazon-ec2-reserved-instance-marketplace/

但我永远找不到!从来没有更便宜的预留实例显示“第三方”作为卖方,或者持续时间短于 AWS 的最低 12 个月。我对实例类型很灵活,但我无法在下拉列表中选择多个。我不会每天都检查这个,更改下拉列表(其中包含 100 多个项目)并每次都单击“搜索”。 在此处输入图片描述

有没有更好的办法?

答案1

使用 AWS CLI,我运行此命令

call aws ec2 describe-reserved-instances-offerings --availability-zone us-east-1b --filters Name=marketplace,Values=true

https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/describe-reserved-instances-offerings.html

运行时间太长(超过 5 分钟)。输出如下。这似乎表明整个 us-east-1b 中只有两个二手保留实例?奇怪。我希望有一个错误,或者超时,或者我的命令出了问题。

---------------------------------------------------------------------------
|                   DescribeReservedInstancesOfferings                    |
+-------------------------------------------------------------------------+
||                      ReservedInstancesOfferings                       ||
|+------------------------------+----------------------------------------+|
||  AvailabilityZone            |  us-east-1b                            ||
||  CurrencyCode                |  USD                                   ||
||  Duration                    |  36288000                              ||
||  FixedPrice                  |  218.75                                ||
||  InstanceTenancy             |  default                               ||
||  InstanceType                |  m1.small                              ||
||  Marketplace                 |  True                                  ||
||  OfferingClass               |  standard                              ||
||  OfferingType                |  All Upfront                           ||
||  ProductDescription          |  SUSE Linux                            ||
||  ReservedInstancesOfferingId |  af1959a7-f884-4781-a8d8-25719911daf7  ||
||  Scope                       |  Availability Zone                     ||
||  UsagePrice                  |  0.0                                   ||
|+------------------------------+----------------------------------------+|
|||                           PricingDetails                            |||
||+--------------------------------+------------------------------------+||
|||  Count                         |  1                                 |||
|||  Price                         |  218.75                            |||
||+--------------------------------+------------------------------------+||
|||                          RecurringCharges                           |||
||+--------------------------------------+------------------------------+||
|||  Amount                              |  0.0                         |||
|||  Frequency                           |  Hourly                      |||
||+--------------------------------------+------------------------------+||
||                      ReservedInstancesOfferings                       ||
|+------------------------------+----------------------------------------+|
||  AvailabilityZone            |  us-east-1b                            ||
||  CurrencyCode                |  USD                                   ||
||  Duration                    |  2592000                               ||
||  FixedPrice                  |  58.75                                 ||
||  InstanceTenancy             |  dedicated                             ||
||  InstanceType                |  c4.2xlarge                            ||
||  Marketplace                 |  True                                  ||
||  OfferingClass               |  standard                              ||
||  OfferingType                |  No Upfront                            ||
||  ProductDescription          |  Linux/UNIX (Amazon VPC)               ||
||  ReservedInstancesOfferingId |  73fc138d-d536-4806-b2a3-2cd05752240e  ||
||  Scope                       |  Availability Zone                     ||
||  UsagePrice                  |  0.0                                   ||
|+------------------------------+----------------------------------------+|
|||                           PricingDetails                            |||
||+---------------------------------+-----------------------------------+||
|||  Count                          |  1                                |||
|||  Price                          |  58.75                            |||
||+---------------------------------+-----------------------------------+||
|||                          RecurringCharges                           |||
||+--------------------------------------+------------------------------+||
|||  Amount                              |  0.195                       |||
|||  Frequency                           |  Hourly                      |||
||+--------------------------------------+------------------------------+||

相关内容