Trying to find a solution to ‘instance terminates immediately error’ in AWS? We can help you with it.
Here at Bobcares, we have seen several such AWS related queries as part of our AWS Support Services for AWS users, and online service providers.
Today we’ll take a look at the causes for this error and see how to fix it.
Why does ‘instance terminates immediately’ error occurs in AWS
There are different reasons for an instance to terminate immediately after launching or starting it. Here are some of them.
- Reaching the EBS volume limit.
- Corruption of EBS snapshot
- You do not have permission to access the KMS key for decryption since the root EBS volume is encrypted.
- The instance store-backed AMI that you used to launch the instance is missing a required part (an image.part.xx file).
How to fix ‘Instance terminates immediately’ error in AWS
First, we need to find the reason for this error in order to resolve it. We can find it through the Amazon EC2 console or AWS Command Line Interface to get the termination reason.
Here are the steps to find the termination reason through the Amazon EC2 console
- First, open the Amazon EC2 console using the link: https://console.aws.amazon.com/ec2/
- Then in the left navigation pane, choose Instances, and select the instance.
- After that, from the Description tab, you can find the reason next to the State transition reason label. Now, note it down.
Here are the steps to find the termination reason through the AWS Command Line Interface
- Run the below describe-instances command and specify the instance ID.
- aws ec2 describe-instances –instance-id instance_id
- As a result, of the above command, a JSON result is received. Now, please note down the values in the StateReason response element.
For example, here is a code of ‘StateReason’ response element.
“StateReason”: {
“Message”: “Client.VolumeLimitExceeded: Volume limit exceeded”,
“Code”: “Server.InternalError”
},
The solution to ‘Instance terminates immediately’ error in AWS
Now let’s see the solution part of this error.
For instance, if the reason for the error is “Client.VolumeLimitExceeded: Volume limit exceeded” then you have reached the EBS volume limit.
In case, if the reason for the error is “Client.InternalError: Client error on launch” then it indicates that the root volume is encrypted but you have no permissions to access the KMS key for decryption. To get permission to access the required KMS key, add the appropriate KMS permissions to your IAM user.
[Need any further assistance in fixing AWS errors? – We are here to help you.]
Conclusion
In short, this immediate termination error occurs due to different reasons. Today, we saw how to find the reason for this error and solve it accordingly.
0 Comments