Amazon Elastic Compute Cloud
API Reference (API Version 2014-06-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

DescribeInstanceStatus

Description

Describes the status of one or more instances, including any scheduled events.

Instance status has two main components:

  • System Status reports impaired functionality that stems from issues related to the systems that support an instance, such as such as hardware failures and network connectivity problems. The DescribeInstanceStatus response elements report such problems as impaired reachability..

  • Instance Status reports impaired functionality that arises from problems internal to the instance. The DescribeInstanceStatus response elements report such problems as impaired reachability.

Instance status provides information about four types of scheduled events for an instance that may require your attention:

  • Scheduled Reboot: When Amazon EC2 determines that an instance must be rebooted, the instances status returns one of two event codes: system-reboot or instance-reboot. System reboot commonly occurs if certain maintenance or upgrade operations require a reboot of the underlying host that supports an instance. Instance reboot commonly occurs if the instance must be rebooted, rather than the underlying host. Rebooting events include a scheduled start and end time.

  • System Maintenance: When Amazon EC2 determines that an instance requires maintenance that requires power or network impact, the instance's status will return an event code called system-maintenance. System maintenance is either power maintenance or network maintenance. For power maintenance, your instance will be unavailable for a brief period of time and then rebooted. For network maintenance, your instance will experience a brief loss of network connectivity. System maintenance events include a scheduled start and end time. You will also be notified by email if one of your instances is set for system maintenance. The email message indicates when your instance is scheduled for maintenance.

  • Scheduled Retirement: When Amazon EC2 determines that an instance must be shut down, the instance's status returns an event code called instance-retirement. Retirement commonly occurs when the underlying host is degraded and must be replaced. Retirement events include a scheduled start and end time. You will also be notified by email if one of your instances is set to retiring. The email message indicates when your instance will be permanently retired.

  • Scheduled Stop: When Amazon EC2 determines that an instance must be shut down, the instances status returns an event code called instance-stop. Stop events include a scheduled start and end time. You will also be notified by email if one of your instances is set to stop. The email message indicates when your instance will be stopped.

When your instance is retired, it will either be terminated (if its root device type is the instance-store) or stopped (if its root device type is an EBS volume). Instances stopped due to retirement will not be restarted, but you can do so manually. You can also avoid retirement of EBS-backed instances by manually restarting your instance when its event code is instance-retirement. This ensures that your instance is started on a different underlying host.

For more information about failed status checks, see Troubleshooting Instances with Failed Status Checks in the Amazon Elastic Compute Cloud User Guide for Linux. For more information about working with scheduled events, see Working with an Instance That Has a Scheduled Event in the Amazon Elastic Compute Cloud User Guide for Linux.

Request Parameters

For information about the common parameters that all actions use, see Common Query Parameters.

InstanceId

One or more instance IDs.

Type: String

Default: Describes all your instances.

Constraints: Maximum 100 explicitly specified instance IDs.

Required: No

IncludeAllInstances

When true, includes the health status for all instances. When false, includes the health status for running instances only.

Type: Boolean

Default: false

Required: No

MaxResults

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Type: Integer

Default: The call returns all items.

Constraint: If the value is greater than 1000, we return only 1000 items.

Required: No

NextToken

The token for the next set of items to return. (You received this token from a prior call.)

Type: String

Default: None

Required: No

Filter.n.Name

The name of a filter. Filter names are case-sensitive. For more information about supported filter names, see the Supported Filters section.

Type: String

Default: None

Required: No

Filter.n.Value.m

A value for the filter. Filter values are case-sensitive. For more information about supported values for each filter, see the Supported Filters section.

Type: String

Default: None

Required: No

Supported Filters

You can specify filters so that the response includes information for only certain instances. For example, you can use a filter to specify that you're interested in instances in a specific Availability Zone. You can specify multiple values for a filter. The response includes information for an instance only if it matches at least one of the filter values that you specified.

You can specify multiple filters; for example, specify instances that are in a specific Availability Zone and have a status of retiring. The response includes information for an instance only if it matches all the filters that you specified. If there's no match, no special message is returned; the response is simply empty.

You can use wildcards in a filter value. An asterisk (*) matches zero or more characters, and a question mark (?) matches exactly one character. You can escape special characters using a backslash (\) before the character. For example, a value of \*amazon\?\\ searches for the literal string *amazon?\.

The following are the available filters.

availability-zone

The Availability Zone of the instance.

Type: String

event.code

The code identifying the type of event.

Type: String

Valid values: instance-reboot | system-reboot | system-maintenance | instance-retirement | instance-stop

event.description

A description of the event.

Type: String

event.not-after

The latest end time for the scheduled event.

Type: DateTime

event.not-before

The earliest start time for the scheduled event.

Type: DateTime

instance-state-name

The state of the instance.

Type: String

Valid values: pending | running | shutting-down | terminated | stopping | stopped

instance-state-code

A code representing the state of the instance. The high byte is an opaque internal value and should be ignored. The low byte is set based on the state represented

Type: Integer (16-bit unsigned integer)

Valid values: 0 (pending) | 16 (running) | 32 (shutting-down) | 48 (terminated) | 64 (stopping) | 80 (stopped)

system-status.status

The system status of the instance.

Type: String

Valid values: ok | impaired | initializing | insufficient-data | not-applicable

system-status.reachability

Filters on system status where the name is reachability.

Type: String

Valid values: passed | failed | initializing | insufficient-data

instance-status.status

The status of the instance.

Type: String

Valid values: ok | impaired | initializing | insufficient-data | not-applicable

instance-status.reachability

Filters on instance status where the name is reachability.

Type: String

Valid values: passed | failed | initializing | insufficient-data

Response Elements

The following elements are returned in a DescribeInstanceStatusResponse element.

requestId

The ID of the request.

Type: xsd:string

instanceStatusSet

A list of instances status descriptions, each one wrapped in an item element.

Type: InstanceStatusItemType

nextToken

The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Type: xsd:string

Errors

The following are some of the client API errors you might encounter when using this request. For more information about common API errors, see Common Causes of Client Errors. For a summary of API error codes, see Client Error Codes.

Examples

Example Request

This example returns instance status descriptions for all instances.

https://ec2.amazonaws.com/?
Action=DescribeInstanceStatus
&AUTHPARAMS

Example Request

This example returns instance status descriptions for the specified instances.

https://ec2.amazonaws.com/?
Action=DescribeInstanceStatus
&InstanceId.0=i-1a2b3c4d
&InstanceId.1=i-2a2b3c4d
&AUTHPARAMS

Example Request

This example returns instance status descriptions for all instances specified by supported DescribeInstanceStatus filters.

https://ec2.amazonaws.com/?
Action=DescribeInstanceStatus
&Filter.0.Name=system-status.reachability
&Filter.0.Value.failed
&AUTHPARAMS

Example Response

<DescribeInstanceStatusResponse xmlns="http://ec2.amazonaws.com/doc/2014-06-15/">
    <requestId>3be1508e-c444-4fef-89cc-0b1223c4f02fEXAMPLE</requestId>
    <instanceStatusSet>
        <item>
            <instanceId>i-1a2b3c4d</instanceId>
            <availabilityZone>us-east-1d</availabilityZone>
            <instanceState>
                <code>16</code>
                <name>running</name>
            </instanceState>
            <systemStatus>
                <status>impaired</status>
                <details>
                    <item>
                        <name>reachability</name>
                        <status>failed</status>
                        <impairedSince>YYYY-MM-DDTHH:MM:SS.000Z</impairedSince>
                    </item>
                </details>
            </systemStatus>
            <instanceStatus>
                <status>impaired</status>
                <details>
                    <item>
                        <name>reachability</name>
                        <status>failed</status>
                        <impairedSince>YYYY-MM-DDTHH:MM:SS.000Z</impairedSince>
                    </item>
                </details>
            </instanceStatus>
            <eventsSet>
              <item>
                <code>instance-retirement</code>
                <description>The instance is running on degraded hardware</description>
                <notBefore>YYYY-MM-DDTHH:MM:SS+0000</notBefore>
                <notAfter>YYYY-MM-DDTHH:MM:SS+0000</notAfter>
              </item>
            </eventsSet>
        </item>
        <item>
            <instanceId>i-2a2b3c4d</instanceId>
            <availabilityZone>us-east-1d</availabilityZone>
            <instanceState>
                <code>16</code>
                <name>running</name>
            </instanceState>
            <systemStatus>
                <status>ok</status>
                <details>
                    <item>
                        <name>reachability</name>
                        <status>passed</status>
                    </item>
                </details>
            </systemStatus>
            <instanceStatus>
                <status>ok</status>
                <details>
                    <item>
                        <name>reachability</name>
                        <status>passed</status>
                    </item>
                </details>
            </instanceStatus>
            <eventsSet>
              <item>
                <code>instance-reboot</code>
                <description>The instance is scheduled for a reboot</description>
                <notBefore>YYYY-MM-DDTHH:MM:SS+0000</notBefore>
                <notAfter>YYYY-MM-DDTHH:MM:SS+0000</notAfter>
              </item>
            </eventsSet>
        </item>
        <item>
            <instanceId>i-3a2b3c4d</instanceId>
            <availabilityZone>us-east-1c</availabilityZone>
            <instanceState>
                <code>16</code>
                <name>running</name>
            </instanceState>
            <systemStatus>
                <status>ok</status>
                <details>
                    <item>
                        <name>reachability</name>
                        <status>passed</status>
                    </item>
                </details>
            </systemStatus>
            <instanceStatus>
                <status>ok</status>
                <details>
                    <item>
                        <name>reachability</name>
                        <status>passed</status>
                    </item>
                </details>
            </instanceStatus>
        </item>
        <item>
            <instanceId>i-4a2b3c4d</instanceId>
            <availabilityZone>us-east-1c</availabilityZone>
            <instanceState>
                <code>16</code>
                <name>running</name>
            </instanceState>
            <systemStatus>
                <status>ok</status>
                <details>
                    <item>
                        <name>reachability</name>
                        <status>passed</status>
                    </item>
                </details>
            </systemStatus>
            <instanceStatus>
                <status>insufficient-data</status>
                <details>
                    <item>
                        <name>reachability</name>
                        <status>insufficient-data</status>
                    </item>
                </details>
            </instanceStatus>
         </item>
    </instanceStatusSet>
</DescribeInstanceStatusResponse>