Amazon Elastic Compute Cloud
User Guide (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Tracking Spot Requests with Bid Status Codes

Bid statuses can help you track your Amazon Elastic Compute Cloud (EC2) Spot Instance requests, plan your use of Spot Instances, and bid strategically. Spot bid status information is composed of a status code, the update time, and a status message. Together, they help you determine the disposition of your Spot request. For example, a bid status can tell you the reason why your Spot request isn't fulfilled yet or list the constraints that are impeding the fulfillment of your Spot request.

Note

A bid is a request that is conditionally tied to a price. The terms are used interchangeably in this documentation.

You can use any of the Amazon EC2 Spot Instance tools to obtain status information about your Spot requests. Spot bid status information will be available for new Spot requests as well as bid requests that you already have open. However, if you're using either the Amazon EC2 CLI or API tools to obtain bid status information, you need to use version 2012-10-01 or later of the API tools. The following table summarizes how you can get bid status information using the Amazon EC2 tools.

ToolUse To get

Spot Requests page in the Amazon EC2 console

Status column

Bottom pane, tooltip

Status code

Status message

Amazon EC2 CLI

ec2-request-spot-instances or

ec2-describe-spot-instance-requests

Status code, status message,

and update time

Amazon EC2 API

RequestSpotInstances or

DescribeSpotInstanceRequests

Status code, status message,

and update time


The Life Cycle of a Spot Request

This diagram shows you the paths your Spot request can follow throughout its life cycle. Following the diagram, we explain each step of the life cycle—from making a request to the terminal state.

The Life Cycle of a Spot Request

When you request a Spot Instance, your request goes through an evaluation process. At each step of the process—also called the Spot request life cycle—specific events dictate successive request states. In the life cycle diagram, each step is depicted as a node, and each node's status code describes the status of your Spot request and Spot Instance.

  1. Pending evaluation – As soon as you make your Spot Instance request, it goes into the pending-evaluation state.

    Status CodeRequest StateInstance State

    pending-evaluation

    open

    (none)


    The only reason your Spot bid request does not proceed to this pending-evaluation state is that at least one of the parameters is invalid (bad-parameters).

    Status CodeRequest StateInstance State

    bad-parameters

    closed

    (none)


  2. Pending evaluation holding state – Your Spot Instance request will report a status code in the holding state if one or more options you specified are valid but not met, or if we encounter a Spot capacity constraint. The options defined by your request affect the likelihood of it being fulfilled. For example, if you specified a max bid price below the current Spot price, or requested that your Spot Instances be launched together in one Availability Zone (AZ), your Spot request will stay in a holding state until the Spot price goes below your bid or the Availability Zone constraint is met.

    The following table lists the status codes reported when your bid is in a holding state waiting for a constraint to be met.

    Status CodeRequest StateInstance State

    capacity-not-available

    open

    (none)

    capacity-oversubscribed

    open

    (none)

    price-too-low

    open

    (none)

    not-scheduled-yet

    open

    (none)

    launch-group-constraint

    open

    (none)

    az-group-constraint

    open

    (none)

    placement-group-constraint

    open

    (none)

    constraint-not-fulfillable

    open

    (none)


  3. Pending evaluation/fulfillment terminal state – Before your request reaches the pending fulfillment phase, your Spot Instance request may end up in a terminal state if the valid dates you specified for the bid expired, you canceled the bid yourself, or a system error occurred.

    Note

    A canceled Spot request does not necessarily mean that the Spot Instance is terminated. In contrast, a closed Spot request means the request will no longer be considered and the Spot Instance is terminated.

    The following table lists the status codes reported when your bid ends up in the terminal state after pending evaluation or pending fulfillment.

    Status CodeRequest StateInstance State

    schedule-expired

    closed

    (none)

    canceled-before-fulfillment*

    canceled

    (none)

    bad-parameters

    failed

    (none)

    system-error

    closed

    (none)


    * This status results from a cancellation initiated by a user.

  4. Pending fulfillment – When the constraints you specified (if any) are met, and your bid price is equal to or higher than the current Spot market price, your Spot request goes into the pending-fulfillment state.

    Status CodeRequest StateInstance State

    pending-fulfillment

    open

    (none)


    At this point, the Amazon EC2 Spot service is getting ready to provision the instances that you requested. If the process stops at this point, it would likely be due to cancellation by the user before a Spot Instance was launched, or an unexpected system error (see Pending evaluation/fulfillment terminal state).

  5. Fulfilled – When all the specifications for your Spot Instance are met, your Spot request is fulfilled. The Amazon EC2 Spot service launches the Spot Instance, which may take a few minutes.

    Status CodeRequest StateInstance State

    fulfilled

    active

    starting up → running


    At this point, your instance launches, and your bid request is active. Your instance will continue to run as long as your bid price is at or above the Spot market price, EC2 has spare Spot capacity for your instance type, and you don't terminate the instance.

    Note

    If your bid price is equal to the market price, your request can stay fulfilled, but you run the risk of your Spot Instance getting terminated at any time that the market price goes up. In some cases, your Spot Instance could be evicted even if your bid equaled the Spot price because Spot Instances were oversubscribed at that price. In such cases, you will get the instance-terminated-capacity-oversubscribed status code. See Fulfilled terminal state.

  6. Fulfilled terminal state – Your Spot request will report a status code in the terminal state if a change in Spot price or capacity requires the Spot service to terminate your Spot Instance. You will also get a terminal state status code if you cancel the Spot request or terminate the Spot Instance.

    The following table lists the status codes reported when your instance is in the terminal state after the bid was fulfilled.

    Status CodeRequest StateInstance State

    request-canceled-and-instance-running

    canceled[c]

    running

    marked-for-termination

    closed

    running

    instance-terminated-by-price

    closed[a]

    (Spot) terminated

    instance-terminated-by-user (or spot-instance-terminated-by-user, which will be deprecated)

    closed[b]

    terminated[c]

    instance-terminated-no-capacity

    closed[a]

    (Spot) terminated

    instance-terminated-capacity-oversubscribed

    closed[a]

    (Spot) terminated

    instance-terminated-launch-group-constraint

    closed[a]

    (Spot) terminated


    [a] If the Spot bid request is persistent, the state of the request becomes open. See the next item, Persistent requests.

    [b] If you terminate your instance first, there may be a delay before the Spot service realizes that your Spot Instance was terminated. For persistent requests, this means that for user-terminated instances it could take some time before your Spot request re-enters the pending-evaluation state.

    [c] Actions are initiated by the user.

  7. Persistent requests – When your Spot Instances are terminated (either by you or the Amazon EC2 Spot service), if you specified a persistent Spot request, then the request will be considered again. This request returns to the pending-evaluation state. Your Spot bid request will undergo the same evaluation process that it originally went through, and an entirely new Spot Instance will be launched for the persistent Spot request.

Spot Bid Status Code Reference

The following list contains Spot bid status codes and explanations about what the code means for your Spot request:

  • az-group-constraint

    The Spot service cannot launch all the instances you requested in the same Availability Zone.

  • bad-parameters

    One or more of the parameters of your Spot request was invalid or malformed (for example, the AMI you specified may not exist). The bid status message will tell you which parameter is invalid.

  • canceled-before-fulfillment

    The user canceled the Spot request before it was fulfilled.

  • capacity-not-available

    There is no capacity available for the instances you requested.

  • capacity-oversubscribed

    The number of Spot requests with bid prices equal to or higher than your bid price exceeds the available capacity in this pool.

  • constraint-not-fulfillable

    The Spot request cannot be fulfilled because one or more constraints are invalid. For example, you provided an invalid from or to or an invalid Availability Zone. The bid status message will tell you which constraint was invalid.

  • fulfilled

    Your bid request was fulfilled, so your Spot request is active, and the Amazon EC2 Spot service is launching (or has launched) your Spot Instance.

  • instance-terminated-by-user (or spot-instance-terminated-by-user)

    You terminated a Spot instance that had been fulfilled, so the bid state becomes closed (unless it's a persistent bid), and the instance state is terminated.

    Note

    The status codes instance-terminated-by-user and spot-instance-terminated-by-user represent the same status. The code spot-instance-terminated-by-user will be deprecated.

  • instance-terminated-by-price

    The Spot price rose above your bid price. If your request is a persistent bid, the process—or life cycle—restarts and your bid will again be pending evaluation.

  • instance-terminated-capacity-oversubscribed

    Your instance was terminated because the number of Spot requests with bid prices equal to or higher than your bid price has exceeded the available capacity in this pool. This means that your instance was interrupted even though the Spot price may not have changed because your bid was at the Spot price.

    Note

    When there are several requests at a certain bid price and only some of them need to be terminated, the Spot service randomly selects the requests to be terminated.

  • instance-terminated-launch-group-constraint

    One of the instances in your launch group was terminated, so the launch group constraint is no longer fulfilled.

  • instance-terminated-no-capacity

    There is no longer any Spot capacity available for the instance.

  • launch-group-constraint

    The Spot service cannot launch all the instances you requested at the same time.

  • marked-for-termination

    Your Spot Instance is marked for termination.

  • not-scheduled-yet

    Your Spot request will not be evaluated until the scheduled date.

  • pending-evaluation

    As soon as you make your Spot Instance request, it goes into the pending-evaluation state while the system evaluates the parameters of your request.

  • pending-fulfillment

    Your Spot request is pending fulfillment while the system tries to provision your Spot Instance.

  • placement-group-constraint

    Your Spot request cannot be fulfilled yet because a new Spot Instance cannot currently be added to the placement group you specified.

  • price-too-low

    You have a bid request that cannot be fulfilled because the bid price is below the Spot price. In this case, no instance is launched, and your bid remains open.

  • request-canceled-instance-running

    You canceled your Spot request while the Spot instance was still running, so the request is canceled, but the instance remains running.

  • schedule-expired

    Your Spot request has expired because it was not fulfilled before the valid to date.

  • system-error

    There was an unexpected system error. If this is a recurring issue, please contact customer support for assistance.