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

질문됨 3년 전3897회 조회
7개 답변
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
답변함 3년 전
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?

답변함 3년 전
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
답변함 3년 전
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.

답변함 3년 전
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.

답변함 3년 전
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
답변함 3년 전
0

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

답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠