Skip to content

How do I troubleshoot an Amazon EC2 instance that's in an EC2 Auto Scaling group?

3 minute read
0

I want to troubleshoot issues with an Amazon Elastic Compute Cloud (Amazon EC2) instance that’s part of an Amazon EC2 Auto Scaling group.

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 your EC2 instance in the EC2 Auto Scaling group is in the InService state, then you can't stop, start, or reboot the instance. You can only terminate the instance.

To stop, start, reboot, or troubleshoot an instance that's in an EC2 Auto Scaling group, use one of the following methods.

Temporarily remove the instance from the Auto Scaling group

To remove an instance from an Auto Scaling group so that you can update or troubleshoot it, change the instance state from InService to Standby.

Detach the instance from your Auto Scaling group

Detach the instance from your Auto Scaling group so that the instance becomes independent and you can perform troubleshooting actions. After you troubleshoot the instance, reattach the instance to the Auto Scaling group.

Suspend the Terminate and HealthCheck processes

Temporarily suspend the Terminate and Healthcheck processes so that your Auto Scaling group doesn't terminate the instance that fails its status checks.

To use the Amazon EC2 console to suspend the processes, complete the following steps:

  1. Open the Amazon EC2 console.
  2. In the navigation pane, choose Auto Scaling groups.
  3. Select the Auto Scaling group that has the affected instance.
  4. Choose Edit.
  5. Under Advanced configurations, for Suspended processes, select Terminate and HealthCheck.
    Important: You must suspend both the Terminate and HealthCheck processes. If you don't select HealthCheck, then the instance becomes unhealthy when you stop or reboot it. In this scenario, EC2 Auto Scaling replaces the instance because of the failed health check when you resume the Terminate process.
  6. Choose Update.
  7. Take the troubleshooting or update actions.
  8. Navigate back to the Auto Scaling groups page.
  9. Select the Auto Scaling group that has the affected instance.
  10. Choose Edit.
  11. For Suspended processes, clear Terminate and HealthCheck.
  12. Choose Update.

To use the AWS CLI to suspend the processes, complete the following steps:

  1. To suspend the EC2 Auto Scaling processes, run the following suspend-processes command:
    aws autoscaling suspend-processes --auto-scaling-group-name autoscalinggroupname --scaling-processes Terminate HealthCheck
    Note: Replace autoscalinggroupname with the name of your EC2 Auto Scaling group.
  2. Take the troubleshooting or update actions.
  3. To resume processes, run the following resume-processes command:
    aws autoscaling resume-processes --auto-scaling-group-name autoscalinggroupname --scaling-processes Terminate HealthCheck
    Note: Replace autoscalinggroupname with the name of your EC2 Auto Scaling group.

Related information

Suspend and resume Amazon EC2 Auto Scaling processes

AWS OFFICIALUpdated a month ago