当我的 Spot 实例被 AWS 终止时,我是否需要为开始的小时数付费?

Do I pay for the started hour when my spot instance is terminated by AWS?

假设我使用的是 Linux 现货实例,由于现货市场价格上涨,该实例在 30 分钟后被 AWS 终止。

在 2017 年 10 月之前,实例按小时收费,实例不会按开始的小时收费。 参见:https://aws.amazon.com/ec2/spot/pricing/

“With Spot instances, you will never be charged more than the maximum price you specified. While your instance runs, you are charged the Spot price that is in effect for that period. If the Spot price exceeds your specified price, your instance will receive a two-minute notification before it is terminated, and you will not be charged for the partial hour that your instance has run.”

现在,自 2017 年 10 月以来,实例按秒收费。 参见 https://aws.amazon.com/blogs/aws/new-per-second-billing-for-ec2-instances-and-ebs-volumes/

List prices and Spot Market prices are still listed on a per-hour basis, but bills are calculated down to the second, as is Reserved Instance usage (you can launch, use, and terminate multiple instances within an hour and get the Reserved Instance Benefit for all of the instances).

问题
这是否意味着即使 Spot 实例被终止,也要为 30 分钟的使用付费?

当您 运行 一个 Amazon Linux Spot 实例 在新的每秒收费模式下:

  • 如果 AWS 在第一个小时终止您的实例,则不收费
  • 如果 AWS 在第一个小时后终止您的实例,您将按实例运行(精确到秒)的实际时间付费

来自Spot Instances

At the start of each instance hour, you are charged based on the Spot price. If Amazon EC2 terminates your Spot Instance in the first instance hour because the Spot price exceeded your bid, you are not charged for the partial hour of usage. If Amazon EC2 terminates your Spot Instance in any subsequent hour, you are charged for your usage to the nearest second. If you terminate your Spot Instance in the middle of an instance hour—be it the first or any subsequent hour—you are charged for your usage rounded to the nearest second.

更新(2019):以上信息现在已经从文档中消失,所以事情可能已经改变了。