Troubleshooting Amazon EC2 Auto Scaling - Amazon EC2 Auto Scaling

Troubleshooting Amazon EC2 Auto Scaling

Amazon EC2 Auto Scaling provides specific and descriptive errors to help you troubleshoot issues. You can find the error messages in the description of the scaling activities.

General troubleshooting issues

Troubleshooting launch template error: "You are not authorized to perform this operation"

The following sections can help you troubleshoot the "You are not authorized to perform this operation" error when creating or updating Auto Scaling groups.

Permissions required for a launch template are missing

If you are attempting to use a launch template, and the IAM credentials you are using do not have sufficient permissions, you receive an error that you're not authorized to use the launch template. For information about the permissions necessary to work with launch templates, see Launch template support.

Permissions required to pass an IAM role are missing

If you are attempting to use a launch template that specifies an instance profile, you must have permission to pass the IAM role that is associated with the instance profile. For more information, see IAM role for applications that run on Amazon EC2 instances. For further troubleshooting topics related to instance profiles, see Troubleshooting Amazon EC2 and IAM in the IAM User Guide.

Troubleshooting instance termination

Amazon EC2 performs status checks on running EC2 instances to identify hardware and software issues. If one or more checks fail, the instance returns a status of impaired to Amazon EC2 Auto Scaling, which then automatically replaces it as part of its health checks. To determine why Amazon EC2 Auto Scaling terminated an instance, see Why did Amazon EC2 Auto Scaling terminate an instance? in the AWS Knowledge Center.

Note that instances launched in an Auto Scaling group require sufficient warm-up time (grace period) to prevent early termination due to a health check replacement. To update the health check grace period for your Auto Scaling group to an appropriate time period for your application, use the update-auto-scaling-group command. Make sure that the health check grace period is longer than the instance startup time. Otherwise, healthy instances can be terminated before they finish starting up.

See also:

Retrieving an error message

To retrieve an error message from the description of scaling activities, use the describe-scaling-activities command as follows:

aws autoscaling describe-scaling-activities --auto-scaling-group-name my-asg

The following is an example response, where StatusCode contains the current status of the activity and StatusMessage contains the error message:

{ "Activities": [ { "Description": "Launching a new EC2 instance: i-4ba0837f", "AutoScalingGroupName": "my-asg", "ActivityId": "f9f2d65b-f1f2-43e7-b46d-d86756459699", "Details": "{"Availability Zone":"us-west-2c"}", "StartTime": "2013-08-19T20:53:29.930Z", "Progress": 100, "EndTime": "2013-08-19T20:54:02Z", "Cause": "At 2013-08-19T20:53:25Z a user request created an AutoScalingGroup...", "StatusCode": "Failed", "StatusMessage": "The image id 'ami-4edb0327' does not exist. Launching EC2 instance failed." } ] }

The following tables list the types of error messages and provide links to the troubleshooting resources that you can use to troubleshoot issues.

Launch issues
Issue Error message
Availability Zone The requested Availability Zone is no longer supported. Please retry your request...
Block device mapping Invalid device name upload. Launching EC2 instance failed.
Block device mapping Value (<name associated with the instance storage device>) for parameter virtualName is invalid...
Block device mapping EBS block device mappings not supported for instance-store AMIs.
Instance configuration The requested configuration is currently not supported.
Instance type and Availability Zone Your requested instance type (<instance type>) is not supported in your requested Availability Zone (<instance Availability Zone>)...
Insufficient instance capacity in Availability Zone We currently do not have sufficient <instance type> capacity in the Availability Zone you requested... Launching EC2 instance failed.
Insufficient instance capacity for a Spot request There is no Spot capacity available that matches your request. Launching EC2 instance failed.
Key pair The key pair <key pair associated with your EC2 instance> does not exist. Launching EC2 instance failed.
Placement group Placement groups may not be used with instances of type 'm1.large'. Launching EC2 instance failed.
Quota limits <number of instances> instance(s) are already running. Launching EC2 instance failed.
Security group The security group <name of the security group> does not exist. Launching EC2 instance failed.
Service-linked role Client.InternalError: Client error on launch.
Spot price too low Your Spot request price of 0.015 is lower than the minimum required Spot request fulfillment price of 0.0735...