Troubleshoot issues in 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.
Topics
- Retrieve an error message from scaling activities
- Turn off scaling activities
- Additional troubleshooting resources
- Troubleshoot Amazon EC2 Auto Scaling: EC2 instance launch failures
- Troubleshoot Amazon EC2 Auto Scaling: AMI issues
- Troubleshoot Amazon EC2 Auto Scaling: Load balancer issues
- Troubleshoot Amazon EC2 Auto Scaling: Launch templates
Retrieve an error message from scaling activities
To retrieve an error message from the description of scaling activities, use the describe-scaling-activities command. You have a record of scaling activities that dates back 6 weeks. Scaling activities are ordered by start time, with the latest scaling activities listed first.
Note
The scaling activities are also displayed in the activity history in the Amazon EC2 Auto Scaling console on the Activity tab for the Auto Scaling group.
To see the scaling activities for a specific Auto Scaling group, use the following command.
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": [
{
"ActivityId": "3b05dbf6-037c-b92f-133f-38275269dc0f",
"AutoScalingGroupName": "my-asg",
"Description": "Launching a new EC2 instance: i-003a5b3ffe1e9358e. Status Reason: Instance failed to complete user's Lifecycle Action: Lifecycle Action with token e85eb647-4fe0-4909-b341-a6c42d8aba1f was abandoned: Lifecycle Action Completed with ABANDON Result",
"Cause": "At 2021-01-11T00:35:52Z a user request created an AutoScalingGroup changing the desired capacity from 0 to 1. At 2021-01-11T00:35:53Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.",
"StartTime": "2021-01-11T00:35:55.542Z",
"EndTime": "2021-01-11T01:06:31Z",
"StatusCode": "Cancelled",
"StatusMessage": "Instance failed to complete user's Lifecycle Action: Lifecycle Action with token e85eb647-4fe0-4909-b341-a6c42d8aba1f was abandoned: Lifecycle Action Completed with ABANDON Result",
"Progress": 100,
"Details": "{\"Subnet ID\":\"subnet-5ea0c127\",\"Availability Zone\":\"us-west-2b\"...}",
"AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:283179a2-f3ce-423d-93f6-66bb518232f7:autoScalingGroupName/my-asg"
},
...
]
}
For a description of the fields in the output, see Activity in the Amazon EC2 Auto Scaling API Reference.
To view scaling activities for a deleted group
To view scaling activities after the Auto Scaling group has been deleted, add the
--include-deleted-groups
option to the describe-scaling-activities command as follows.
aws autoscaling describe-scaling-activities --auto-scaling-group-name
my-asg
--include-deleted-groups
The following is an example response, with a scaling activity for a deleted group.
{
"Activities": [
{
"ActivityId": "e1f5de0e-f93e-1417-34ac-092a76fba220",
"AutoScalingGroupName": "my-asg",
"Description": "Launching a new EC2 instance. Status Reason: Your Spot request price of 0.001 is lower than the minimum required Spot request fulfillment price of 0.0031. Launching EC2 instance failed.",
"Cause": "At 2021-01-13T20:47:24Z a user request update of AutoScalingGroup constraints to min: 1, max: 5, desired: 3 changing the desired capacity from 0 to 3. At 2021-01-13T20:47:27Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 3.",
"StartTime": "2021-01-13T20:47:30.094Z",
"EndTime": "2021-01-13T20:47:30Z",
"StatusCode": "Failed",
"StatusMessage": "Your Spot request price of 0.001 is lower than the minimum required Spot request fulfillment price of 0.0031. Launching EC2 instance failed.",
"Progress": 100,
"Details": "{\"Subnet ID\":\"subnet-5ea0c127\",\"Availability Zone\":\"us-west-2b\"...}",
"AutoScalingGroupState": "Deleted",
"AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:283179a2-f3ce-423d-93f6-66bb518232f7:autoScalingGroupName/my-asg"
},
...
]
}
Turn off scaling activities
You have the following options if you need to investigate an issue without interference from scaling policies or scheduled actions:
-
Prevent all dynamic scaling policies and scheduled actions from making changes to the group's desired capacity by suspending the
AlarmNotification
andScheduledActions
processes. For more information, see Suspend and resume Amazon EC2 Auto Scaling processes. -
Disable individual dynamic scaling policies so that they don't change the group's desired capacity in response to changes in load. For more information, see Disable a scaling policy for an Auto Scaling group.
-
Update individual target tracking scaling policies to only scale out (add capacity) by disabling the policy's scale-in portion. This method prevents the group's desired capacity from shrinking but allows it to be increased when load increases. For more information, see Target tracking scaling policies for Amazon EC2 Auto Scaling.
-
Update your predictive scaling policy to forecast only mode. While in forecast only mode, predictive scaling will continue to generate forecasts, but it will not automatically increase capacity. For more information, see Create a predictive scaling policy for an Auto Scaling group.
Additional troubleshooting resources
The following pages provide additional information for troubleshooting issues with Amazon EC2 Auto Scaling.
The following AWS resources can also be of help:
Troubleshooting often requires iterative query and discovery by an expert or from a
community of helpers. If you continue to experience issues after trying the suggestions
in this section, contact AWS Support (in the AWS Management Console, click
Support, Support Center) or ask a question on
AWS re:Post