0
votes

Assumed I am using a Linux spot instance, which was terminated after 30 minutes by AWS, due to increased Spot Market prices.

Before Oktober 2017 the instances were charged per hour, and the instance wouldnt have been charged for the started hour. See: 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.”

Now, since Oktober 2017 the instances are charged per second. See 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).

Question
Does it mean, that one would pay for the 30 Minutes usage of the Spot instance, even if it was terminated?

1

1 Answers

8
votes

When you are running an Amazon Linux Spot instance under the new per-second charging model:

  • If AWS terminates your instance in the first hour, there is no charge
  • If AWS terminates your instance after the first hour, you will be charged for the actual time that the instance was running (down to the second)

From 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.

UPDATE (2019): The above information has now disappeared from the documentation, so things might have changed.