EC2 stops after Start Instance is initiated

0

Hello Team,

I'm trying to understand and remediate whats causing one of my ec2 instances to stop after start is selected. I'd recently detached some volumes from a previous instance that has been terminated and attached them to a new instance recently created.

The state reason doesn't give any real details as to what is causing this.
"SourceDestCheck": true,
"StateReason": {
"Code": "Client.InstanceInitiatedShutdown",
"Message": "Client.InstanceInitiatedShutdown: Instance initiated shutdown"
}

The instance id is i-07fdde796e2cd519b

Edited by: mcollins on Jun 7, 2021 12:19 PM

Edited by: mcollins on Jun 7, 2021 12:21 PM

asked 3 years ago3759 views
7 Answers
0

Hi mcollins

Thanks for reaching out :)

To my understanding, you did not receive an error code when attempting to start the instance. Did you run the describe-instances command in the AWS Command Line Interface (AWS CLI)?
aws ec2 describe-instances --instance-id MYINSTANCE --output json

As you have mentioned detaching EBS volumes, I suspect that you might have a Client.InternalError which could be for the following reasons:

  1. An Amazon Elastic Block Store (Amazon EBS) volume isn't correctly attached to the instance.
  2. An EBS volume that's attached to the instance is in an ERROR state.
  3. An encrypted EBS volume is attached to the instance. However, you don't have permissions to access the AWS Key Management Services (AWS KMS) for decryption.

For more information on how to resolve this, please see the below link:
https://aws.amazon.com/premiumsupport/knowledge-center/ec2-client-internal-error/

I hope this helps!

naz97
answered 3 years ago
0

Hello Naz97,

Thanks for your response.

I did run a describe on my instance and it does look like the volumes attached with no immediate error. Here is the json output for the Block Device Mappings associated with the instance.

This is what was ran.
aws ec2 describe-instances --instance-ids i-019381bb15b76e622 | cat

"BlockDeviceMappings": [
{
"DeviceName": "/dev/xvda",
"Ebs": {
"AttachTime": "2021-06-08T16:40:00+00:00",
"DeleteOnTermination": false,
"Status": "attached",
"VolumeId": "vol-09b5cf4d16d7963f5"
}
},
{
"DeviceName": "/dev/xvdb",
"Ebs": {
"AttachTime": "2021-06-08T16:40:14+00:00",
"DeleteOnTermination": false,
"Status": "attached",
"VolumeId": "vol-08ace4d37be668dc6"
}
}

Below is the StateReason from the ec2 describe.
"StateReason": {
"Code": "Client.InstanceInitiatedShutdown",
"Message": "Client.InstanceInitiatedShutdown: Instance initiated shutdown"
},

I don't see any errors with the volumes; that said one of the volumes is encrypted with aws/ebs kms. Could you point me to some documentation going over the process for getting the instance to use the encrypted volume?

answered 3 years ago
0

Hi mcollins

Thanks for your response :)

Amazon EBS encryption uses AWS KMS keys when creating encrypted volumes and snapshots. In my previous message, I have listed:
3. An encrypted EBS volume is attached to the instance. However, you don't have permissions to access the AWS Key Management Services (AWS KMS) for decryption.

Please see the last resolution in the below link called "Attached volumes are encrypted"
For more information on how to resolve this, please see the below link:
https://aws.amazon.com/premiumsupport/knowledge-center/ec2-client-internal-error/

Additionally, I have found another link that may help:
https://aws.amazon.com/premiumsupport/knowledge-center/encrypted-volumes-stops-immediately/

I hope this helps!

naz97
answered 3 years ago
0

For the link that was provided: https://aws.amazon.com/premiumsupport/knowledge-center/encrypted-volumes-stops-immediately/

We're not getting a "Client.InternalError: Client error on launch" error; we are instead only seeing "Client.InstanceInitiatedShutdown: Instance initiated shutdown". Are they generally one and the same?

We've done this with a different ec2 prior to the one we're having issues with and that one started fine. It is also using an encrypted device using the same kms encryption key.

The process was done exactly the same only the instance we're having issues with starting has an elastic ip attached.

answered 3 years ago
0

For the link that was provided: https://aws.amazon.com/premiumsupport/knowledge-center/encrypted-volumes-stops-immediately/

We're not getting a "Client.InternalError: Client error on launch" error; we are instead only seeing "Client.InstanceInitiatedShutdown: Instance initiated shutdown". Are they generally one and the same?

We've done this with a different ec2 prior to the one we're having issues with and that one started fine. It is also using an encrypted device using the same kms encryption key.

The process was done exactly the same only the instance we're having issues with starting has an elastic ip attached.

answered 3 years ago
0

Hi mcollins

Thanks for your response.

Client.UserInitiatedShutdown: The instance was shut down using the Amazon EC2 API.

Operating system shutdown commands always terminate an instance store-backed instance. You can control whether operating system shutdown commands stop or terminate an Amazon EBS-backed instance. For more information, see Change the instance initiated shutdown behavior:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior

Also, check if your AMI type (PV or HVM) and the volumes are compatible and you are mounting the volumes to the correct device.

I hope this helps!

naz97
answered 3 years ago
0

Thanks for all of your assistance; I will verify the amis and volumes are compatible.

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions