I launched a Spot Instance but now I can't find it in the Amazon Elastic Compute Cloud (Amazon EC2) console. Or, my Amazon EMR node Spot Instance was terminated.
Amazon EC2 can interrupt your Spot Instance at any time with a two-minute notice for the following reasons:
- Lack of Spot capacity: Amazon EC2 can interrupt your Spot Instance when its capacity is required. Usually, Amazon EC2 reclaims your instance to repurpose capacity. Amazon EC2 might also terminate your Spot Instance for issues such as host maintenance or hardware decommission.
- Amazon EC2 can't meet your Spot Instance request constraints: Some Spot requests include a constraint, such as a launch group or a specific Availability Zone group. The Spot Instances are terminated as a group when the constraint can no longer be met.
- The Spot Price is higher than the maximum price that you set: When you request a Spot Instance, you can specify a maximum price for the instance. By default, this maximum price is equal to the On-Demand pricing for that instance type. When the Spot Price increases beyond your set maximum price, your Spot Instance is interrupted. If the interruption behavior is "stop" or "hibernate", your Spot Instance starts again when the Spot price reduces to under your maximum price. Setting a high maximum price doesn't mean that a Spot Instance is available. For more information, see How Spot Instances work.
Because of these interruptions, it's a best practice to use Spot Instances for workloads that are stateless, fault-tolerant, and flexible enough to withstand interruptions.
Note: When Amazon EC2 interrupts a Spot Instance, the Spot Instance is terminated by default. You can change this default behavior to hibernate, or you can stop the instance instead of terminating it. For more information, see Spot Instance interruptions.
To determine why Amazon EC2 interrupted your Spot Instance, do the following:
- Open the Amazon EC2 console, and then select Spot Requests.
- Select the Request ID of the terminated Spot Instance.
- View the Status field under the Description section to see the reason code for why the instance was terminated. For example, if Amazon EC2 didn’t have enough Spot Capacity, the Status field says "instance-terminated-no-capacity". For a complete list of reason codes, see Spot request status codes.
You can use Spot Instance interruption notices to work around potential interruptions. For more information, see Taking advantage of Amazon EC2 Spot Instance interruption notices.
Spot request status
Spot Instance best practices
Why is my Spot Instance terminating even though the maximum price is higher than the Spot price?
When should you use Spot Instances - Amazon EMR documentation