What To Do If An Instance Immediately Terminates
After you launch an instance, we recommend that you check its status to confirm that it goes
from the pending state to the running state, not the
terminated state.
The following are a few reasons why an instance might immediately terminate:
You've reached your EBS 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.
An EBS snapshot is corrupt.
The instance store-backed AMI you used to launch the instance is missing a required part (an image.part.xx file).
Getting the Reason for Instance Termination
You can use the Amazon EC2 console, CLI, or API to get information about the reason that the instance terminated.
To get the reason that an instance terminated using the console
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
In the navigation pane, choose Instances, and select your instance.
In the Description tab, locate the reason next to the label State transition reason. If the instance is still running, there's typically no reason listed. If you've explicitly stopped or terminated the instance, the reason is
User initiated shutdown.
To get the reason that an instance terminated using the command line
Use the ec2-describe-instances command in verbose mode as follows:
$ec2-describe-instancesinstance_id-vIn the XML response that's displayed, locate the
stateReasonelement. It looks similar to the following example.<stateReason> <code>Client.UserInitiatedShutdown</code> <message>Client.UserInitiatedShutdown: User initiated shutdown</message> </stateReason>This example response shows the reason code that you'll see after you stop or terminate a running instance. If the instance terminated immediately, you'll see
codeandmessageelements that describe the reason that the instance terminated (for example,VolumeLimitExceeded).

