Skip to content

Why can't I start or launch my EC2 instance?

7 minute read
1

I can't launch a new Amazon Elastic Compute Cloud (Amazon EC2) instance or start my existing instance.

Resolution

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.

If you don't receive an error code when you try to start the instance, then check for the StartInstances event in AWS CloudTrail Event history. Or, run the following describe-instances AWS CLI command:

aws ec2 describe-instances --instance-id MYINSTANCE --output json

Note: Replace MYINSTANCE with the ID of the instance that you can't start.

In the output, check the StateReason message. In the following example response, the StateReason is Client.InternalError:

"StateReason": {     "Message": "Client.InternalError: Client error on launch",
     "Code": "Client.InternalError"
   },

Based on the error that you receive, take the following troubleshooting actions.

"InsufficientInstanceCapacity"

The following error occurs when there isn't enough On-Demand capacity to launch your new instance or restart your stopped instance:

"An error occurred (InsufficientInstanceCapacity) when calling the StartInstances operation (reached max retries: 4): Insufficient capacity.)"

To troubleshoot this issue, see How do I troubleshoot InsufficientInstanceCapacity errors when I start or launch an EC2 instance?

"InstanceLimitExceeded"

The following error occurs when you launch more than your maximum allowed instances in an AWS Region:

"InstanceLimitExceeded: Your quota allows for 0 more running instance(s)."

To troubleshoot this issue, see How do I troubleshoot InstanceLimitExceeded errors when starting or launching an EC2 instance?

"UnauthorizedOperation"

The "UnauthorizedOperation" error occurs when the user that launched the instance doesn't have the required permissions. To troubleshoot this error, see How do I decode and analyze "UnauthorizedOperation" authorization errors for EC2 instance launch failures?

"The requested configuration is currently not supported"

The "configuration is currently not supported" error message occurs when the Availability Zone that you requested doesn't support the instance type that you specified. To check the availability of the instance types in specific Availability Zones, run the following describe-instance-type-offerings command:

aws ec2 describe-instance-type-offerings --location-type availability-zone --filters Name=instance-type,Values=c5.2xlarge --region us-east-1

Note: Replace c5.2xlarge with your instance type, and us-east-1 with the Region of your Availability Zone.

If needed, then launch the instance in a supported Availability Zone.

The error also occurs if the Amazon Machine Image (AMI) that you used to launch the instance doesn't support the instance type that you selected. Before you select the instance type or family, review the description for the AMI on the AWS Marketplace. This issue typically occurs when you use the AWS CLI to launch an AWS Marketplace AMI. If you use the Amazon EC2 console to launch your instance, then you can't access unsupported instances.

"InternalError"

The "InternalError" error typically occurs for the following reasons:

  • You incorrectly attached the Amazon Elastic Block Store (Amazon EBS) volume to the instance.
  • An EBS volume that's attached to the instance is in an ERROR state.
  • You attached an encrypted EBS volume to the instance, but you don't have permission to access the AWS Key Management Service (AWS KMS) decryption key.

To troubleshoot this error, see How do I troubleshoot an Amazon EC2 instance that stops or terminates when I try to start it with the "InternalError" or "Client.UserInitiatedShutdown" error?

"Disk full"

When you run out of space on an instance and the audit service stops the machine on boot, you receive a "disk full" error message.

Important: Before you stop and start your instance, take the following actions.

Note: When you stop and start an instance, the instance's public IP address changes. It's a best practice to use an Elastic IP address to route external traffic to your instance instead of a public IP address.

To resolve "disk full" errors, complete the following steps:

  1. Open the Amazon EC2 console.

  2. From the navigation pane, choose Instances, and then choose your instance.

  3. Stop the instance.

  4. Detach the /dev/xvda EBS root volume from the stopped instance.

  5. Launch a new rescue EC2 instance in the same Availability Zone as the original instance.

  6. Attach the root volume to the rescue instance as a secondary device.
    Note: When you attach secondary volumes, you can use different device names.

  7. Use SSH to connect to your rescue instance.

  8. To create a mount point directory for the new volume, run the following command:

    sudo mkdir /mnt/rescue

    Note: Replace /mnt/rescue with your mount point directory. You can only use sudo commands for instances that run on Linux.

  9. To mount the volume to the new directory, run the following command:

    sudo mount /dev/xvdf /mnt/rescue

    Note: Replace /dev/xvdf with your device name, and /mnt/rescue with your mount point directory. You can only use sudo commands for instances that run on Linux. If you don't know your device name, then run the following command to view all available disk devices and their mount points:

    lsblk
  10. Increase the root volume size.

  11. Extend the partition.

  12. To unmount the volume, run the following command:

    sudo umount /mnt/rescue

    Note: Replace /mnt/rescue with your mount point directory. You can only use sudo commands for instances that run on Linux.

  13. Detach the volume from the rescue instance.

  14. Attach the volume to the original instance with the /dev/xvda root device name.

  15. Start the instance to confirm that it boots successfully.

  16. Check the /etc/audit/auditd.conf audit configuration file for HALT to make sure that the audit service can't shut down the machine if it runs out of space. For Amazon Linux 1 (AL1), Amazon Linux 2 (AL2), and Amazon Linux 2023 (AL2023), make sure that the audit configuration file includes the following options:

    max_log_file_action = ROTATEadmin_space_left_action = SUSPEND
    disk_full_action = SUSPEND
    disk_error_action = SUSPEND

"InvalidParameterValue"

The "InvalidParameterValue" error message occurs when a parameter in the request isn't valid, is unsupported, or can't be used. The error message includes an explanation. For example, if a root volume isn't attached to the instance at /dev/sda1 or /dev/xvda, then the instance doesn't start. When this occurs, you receive an entry in CloudTrail Event history similar to the following example:

"An error occurred (InvalidParameterValue) when calling the StartInstances operation: Invalid value 'i-abcdefghxyz' for instanceId. Instance does not have a volume attached at root (/dev/sda1)"

To resolve this issue, change the parameter that's listed in the error message. For example, to resolve the preceding error, attach the root volume to the instance at /dev/sda1, and then start the instance. For more information, see Error codes for the Amazon EC2 API.

Related information

Troubleshoot Amazon EC2 instance launch issues

AWS OFFICIALUpdated 6 months ago