Skip to content

How do I reboot an instance in an Amazon EC2 Auto Scaling group?

2 minute read
0

I want to reboot an Amazon Elastic Compute Cloud (Amazon EC2) instance that’s part of an Amazon EC2 Auto Scaling group. However, the instance must not fail a health check.

Short description

If you stop and start an Amazon EC2 instance in your group that's in the InService, then Amazon EC2 Auto Scaling stops the instance. Amazon EC2 Auto Scaling stops your instance when the instance reaches the Stopping or Stopped states during a reboot and fails a health check.

To start and stop your instance when you instance must not fail a health check, put the instance into the Standby state. You can also detach your instance from the group or suspend the health check process.

Resolution

Put the instance into the Standby state

It’s a best practice to put your instance in the Standby state when you reboot your instance. For instructions, see the Temporarily remove an instance by setting it to standby section of Temporarily remove instances from your Auto Scaling group. When you do, you can select Replace instance to maintain your group capacity and launch a new replacement instance. If you don't want to launch a replacement instance, then clear Replace instance.

Important: If you meet either of the following conditions, then you must put your instance into the Standby state when you reboot it:

  • Your group must manage your instance when it reboots.
  • A group manages your instances in the Standby state.

Detach the instance from the group

To manage the instance separately from its group, detach your instance from your group. After you reboot the instance, reattach the instance to your group.

Suspend the health check process

you can suspend the health check process. When you do, under Suspended processes, select HealthCheck. Then, reboot your instance.

After you reboot your instance, resume the health check process. When you do, under Suspended processes, clear HealthCheck.

Important: When you suspend processes, the change affects all instances in your group. Until you resume the process, Amazon EC2 Auto Scaling doesn't replace any unhealthy instances. If you need Amazon EC2 Auto Scaling to perform health checks on your remaining instances, then don't suspend the process.

Related information

How do I delay the termination of an unhealthy Amazon EC2 instance so that I can troubleshoot issues?

AWS OFFICIALUpdated a month ago