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

What To Do If An Instance Immediately Terminates

We recommend that when you launch an instance, you immediately check its status to confirm that it goes to the running status and not terminated.

The following are a few reasons why an Amazon EBS-backed instance might immediately terminate:

  • You've reached your volume limit. For information about the volume limit, and to submit a request to increase your volume limit, see Request to Increase the Amazon EBS Volume Limit.

  • The AMI is missing a required part.

  • The snapshot is corrupt.

This section describes how to get information about the reason that the instance terminated.

AWS Management Console

To get information about the reason that the instance terminated

  1. Sign in to the AWS Management Console and open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the Navigation pane, click Instances to display the instance details.

  3. Select your instance.

  4. In the Description tab, locate the reason next to the label State Transition Reason. If the instance has remained running since it was launched, typically no reason is listed. If you've explicitly stopped or terminated the instance, the reason is User initiated shutdown.

Command Line Tools

To get information about why the instance terminated

  1. Use the ec2-describe-instances command in verbose mode:

    PROMPT>  ec2-describe-instances instance_id -v
  2. In the XML response that's displayed, locate the stateReason element. It looks similar to the following example.

    <stateReason>
       <code>Client.UserInitiatedShutdown</code>
       <message>Client.UserInitiatedShutdown: User initiated shutdown</message>
    </stateReason>

    The preceding example shows what's displayed for a normal instance that you've stopped. For the instance that terminated immediately, the code and message elements will describe the reason for the termination (e.g., VolumeLimitExceeded).

API

To get information about why the instance terminated

  1. Construct the following Query request. For information about AUTHPARAMS, see Common Query Parameters in the Amazon Elastic Compute Cloud API Reference.

    https://ec2.amazonaws.com/
    ?Action=DescribeInstances
    &AUTHPARAMS
  2. In the XML response that's displayed, locate the stateReason element. It looks similar to the following example.

    <stateReason>
       <code>Client.UserInitiatedShutdown</code>
       <message>Client.UserInitiatedShutdown: User initiated shutdown</message>
    </stateReason>

    The preceding example shows what's displayed for a normal instance that you've stopped. For the instance that terminated immediately, the code and message elements will describe the reason for the termination (e.g., VolumeLimitExceeded).