Initiate a Spot Instance interruption - Amazon Elastic Compute Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Initiate a Spot Instance interruption

You can select a Spot Instance in the Amazon EC2 console and initiate an interruption so that you can test how the applications on your Spot Instances handle being interrupted. When you initiate a Spot Instance interruption, Amazon EC2 notifies you that your Spot Instance will be interrupted in two minutes, and then, after two minutes, Amazon EC2 interrupts the Spot Instance.

The underlying service that performs the Spot Instance interruption is Amazon Fault Injection Simulator (Amazon FIS). For information about Amazon FIS, see Amazon Fault Injection Simulator.

Note

Interruption behaviors are terminate, stop, and hibernate. If you set the interruption behavior to hibernate, when you initiate a Spot Instance interruption, the hibernation process will begin immediately.

Initiating a Spot Instance interruption is supported in all Amazon Web Services Regions except Asia Pacific (Jakarta), Asia Pacific (Osaka), China (Beijing), China (Ningxia), and Middle East (UAE).

Initiate a Spot Instance interruption

You can use the EC2 console to quickly initiate a Spot Instance interruption. For more advanced experiments to test Spot Instance interruptions, you can create your own experiments using the Amazon FIS console.

To initiate a Spot Instance interruption using the EC2 console

  1. Open the Amazon EC2 console at https://console.amazonaws.cn/ec2/.

  2. From the navigation pane, choose Spot Requests.

  3. Select a Spot Instance request, and then choose Actions, Initiate interruption.

    Note

    Selecting a Spot Fleet request to initiate interrupting all the Spot Instances in the fleet at once is currently not supported; you must select each Spot Instance request in the fleet separately. You also can’t select multiple Spot Instance requests to initiate an interruption; you can only initiate an interruption for one Spot Instance at a time.

  4. In the Initiate Spot Instance interruption dialog box, under Service access, either use the default role, or choose an existing role. To choose a role, choose Use an existing service role, and then, for Service role name, select the role to use.

  5. When you're ready to initiate the Spot Instance interruption, choose Initiate interruption.

To create more advanced experiments to test Spot Instance interruptions using the Amazon FIS console

  1. Open the Amazon EC2 console at https://console.amazonaws.cn/ec2/.

  2. From the navigation pane, choose Spot Requests.

  3. Choose Actions, Create advanced experiments.

    The Amazon FIS console opens. For more information, see Tutorial: Test Spot Instance interruptions using Amazon FIS in the Amazon Fault Injection Simulator User Guide.

Verify the Spot Instance interruption

After you initiate the interruption, the following occurs:

To verify that the instance was interrupted after you initiated the interruption

  1. Open the Amazon EC2 console at https://console.amazonaws.cn/ec2/.

  2. From the navigation pane, open Spot Requests and Instances in separate browser tabs or windows.

  3. For Spot Requests, select the Spot Instance request. The initial status is fulfilled. After the instance is interrupted, the status changes as follows, depending on the interruption behavior:

    • terminate – The status changes to instance-terminated-by-experiment.

    • stop – The status changes to marked-for-stop-by-experiment and then instance-stopped-by-experiment.

  4. For Instances, select the Spot Instance. The initial status is Running. Two minutes after you receive the Spot Instance interruption notice, the status changes as follows, depending on the interruption behavior:

    • stop – The status changes to Stopping and then Stopped.

    • terminate – The status changes to Shutting-down and then Terminated.