Manually change the status of instances
Put instances into the Standby, Protected, or Stopped state to perform maintenance, protect critical instances from scale-ins, or reduce costs when instances are temporarily idle.
Instance states
Instances in a scaling group can be in the following states: Adding, Pending Add, In Service, Standby, Protected, Removing, Pending Remove, and Stopped. For more information, see Lifecycle states of instances in a scaling group.
The following table summarizes the manual state transitions available.
| Instance category | From | Operation | To | API |
|---|---|---|---|---|
| ECS instances or elastic container instances (ECIs) | In Service | Put into Standby | Standby | EnterStandby |
| ECS instances or ECIs | Standby | Move out of Standby | In Service | ExitStandby |
| ECS instances or ECIs | In Service | Put into Protected | Protected | SetInstancesProtection |
| ECS instances or ECIs | Protected | Move out of Protected | In Service | SetInstancesProtection |
| ECS instances only | In Service, Standby, or Protected | Put into Stopped | Stopped | None |
| ECS instances or ECIs | In Service, Standby, or Protected | Remove or delete | Stateless | RemoveInstances or DetachInstances |
| ECS instances or ECIs | In Service, Standby, or Protected | Remove from scaling group (keep running) | Independent | DetachInstances |
| Managed instances | In Service | Remove from scaling group | Independent | None |
An instance is temporarily set to Removing while being put into the Standby state or while being deleted or removed from a scaling group.
Put instances into the Standby state
Put an ECS instance or ECI into the Standby state when you need to update, troubleshoot, or reconfigure it without having Auto Scaling terminate it during a scale-in or health check.
How it works
-
The instance enters the Standby state and stays there until you manually move it out.
-
If a Server Load Balancer (SLB) instance is attached to the scaling group, the instance's backend server weight is set to 0, stopping new traffic from being routed to it.
-
Auto Scaling stops managing the instance lifecycle — health check status is not updated when the instance is stopped or restarted.
-
During scale-ins, Auto Scaling does not remove Standby instances.
-
Perform your maintenance: stop, restart, change the instance type, change the OS (system disk), reinitialize cloud disks, or migrate from classic network to virtual private cloud (VPC).
-
Move the instance out of the Standby state. Its SLB backend server weight is reset to 50, and Auto Scaling resumes health check monitoring.
To release a Standby instance, first remove it from the scaling group. If the scaling group manages the instance lifecycle, the instance is released after removal. Otherwise, it continues running independently. If you delete the scaling group, Standby instances are automatically removed and exit the Standby state.
Put instances into the Standby state
-
Log on to the Auto Scaling console.
-
In the left-side navigation pane, click Scaling Groups.
-
In the top navigation bar, select a region.
-
Find the target scaling group and click View Details in the Actions column.
-
Click the Instance Management tab.
-
Select the instance list based on how the instances were added:
-
For automatically created instances, find the Auto Created list.
-
For manually added instances, find the Manually Added list.
-
-
Select the instances to put into the Standby state:
-
For a single instance, find the instance and click Asynchronously Switch to Standby in the Actions column.
-
For multiple instances, select them and click Switch to Standby State at the bottom of the page.
-
-
In the Switch to Standby State dialog box, choose the execution mode:
Mode When to use How to proceed Synchronous Small number of instances Click OK. Asynchronous Large number of instances — the console returns immediately and processes the request in the background Select Asynchronously Switch to Standby, then click OK. To check the result, go to the Scaling Rules and Activities tab and click Scaling Activities.
Move instances out of the Standby state
-
Log on to the Auto Scaling console.
-
In the left-side navigation pane, click Scaling Groups.
-
In the top navigation bar, select a region.
-
Find the target scaling group and click View Details in the Actions column.
-
Click the Instance Management tab.
-
Select the instance list based on how the instances were added:
-
For automatically created instances, find the Auto Created list.
-
For manually added instances, find the Manually Added list.
-
-
Select the instances to move out of the Standby state:
-
For a single instance, find the instance and click Asynchronously Remove from Standby in the Actions column.
-
For multiple instances, select them and click Remove from Standby at the bottom of the page.
-
-
In the Remove from Standby dialog box, choose the execution mode:
Mode When to use How to proceed Synchronous Small number of instances Click OK. Asynchronous Large number of instances Select OK, then click OK. To check the result, go to the Scaling Rules and Activities tab and click Scaling Activities.
Put instances into the Protected state
Put an ECS instance or ECI into the Protected state to prevent Auto Scaling from removing it during scale-ins, while keeping it actively serving traffic.
How it works
In the Protected state:
-
The instance continues to serve traffic. Its SLB backend server weight remains unchanged.
-
Auto Scaling does not remove the instance during scale-ins.
-
Health check status is not updated when the instance is stopped or restarted.
-
The instance stays in the Protected state until you manually move it out.
What's blocked:
-
Automatic removal by Auto Scaling during scale-ins
What's still allowed:
-
Manual operations you initiate directly, such as stopping or restarting the instance
-
Removing the instance from the scaling group manually
To release a Protected instance, first remove it from the scaling group manually.
Put instances into the Protected state
-
Log on to the Auto Scaling console.
-
In the left-side navigation pane, click Scaling Groups.
-
In the top navigation bar, select a region.
-
Find the target scaling group and click View Details in the Actions column.
-
Click the Instance Management tab.
-
Select the instance list based on how the instances were added:
-
For automatically created instances, find the Auto Created list.
-
For manually added instances, find the Manually Added list.
-
-
Select the instances to protect:
-
For a single instance, find the instance and click Switch to Protected State in the Actions column.
-
For multiple instances, select them and click Switch to Protected State at the bottom of the page.
-
-
Click OK.
Move instances out of the Protected state
-
Log on to the Auto Scaling console.
-
In the left-side navigation pane, click Scaling Groups.
-
In the top navigation bar, select a region.
-
Find the target scaling group and click View Details in the Actions column.
-
Click the Instance Management tab.
-
Select the instance list based on how the instances were added:
-
For automatically created instances, find the Auto Created list.
-
For manually added instances, find the Manually Added list.
-
-
Select the instances to move out of the Protected state:
-
For a single instance, find the instance and click Remove from Protected State in the Actions column.
-
For multiple instances, select them and click Remove from Protected State at the bottom of the page.
-
-
Click OK.
Put instances into the Stopped state
Put an automatically created ECS instance into the Stopped state to stop it from serving traffic and avoid charges for released resources such as vCPUs, memory, and public IP addresses. Charges still apply for retained resources such as cloud disks and elastic IP addresses (EIPs).
For pay-as-you-go ECS instances, you do not need to manually enable the economical mode for the instance in the ECS console when you put the instance into the Stopped state.
During scale-outs, Auto Scaling preferentially starts Stopped instances before creating new ones.
Prerequisites
-
The ECS instances reside in a VPC.
-
The scaling group's Instance Reclaim Mode is set to Economical Mode.
-
The instances appear in the Auto Created list — only instances created by Auto Scaling are eligible.
Put instances into the Stopped state
-
Log on to the Auto Scaling console.
-
In the left-side navigation pane, click Scaling Groups.
-
In the top navigation bar, select a region.
-
Find the target scaling group and click View Details in the Actions column.
-
Click the Instance Management tab.
-
Find the Auto Created list.
-
Find the target ECS instance and choose
> Stop Instance in the Actions column. -
Click OK.
Remove managed instances from a scaling group
If you do not use scaling groups to manage the lifecycles of managed instances, you must manually remove managed instances from scaling groups. You can remove managed instances from only scaling groups of the ECS type. Removed instances are not stopped or released.
Remove managed instances
-
Log on to the Auto Scaling console.
-
In the left-side navigation pane, click Scaling Groups.
-
In the top navigation bar, select a region.
-
Find the target scaling group and click View Details in the Actions column.
-
Click the Instance Management tab.
-
Find the Managed Instance list.
-
Select the instances to remove:
-
For a single instance, find the instance and click Remove from Scaling Group in the Actions column.
-
For multiple instances, select them and click Remove from Scaling Group at the bottom of the list.
-
-
In the dialog box, configure the Modify Expected Number of Instances option and click OK:
-
Selected (default): The expected number of instances decreases after you remove the instances from the scaling group.
-
Cleared: The expected number of instances does not decrease after you remove the instances from the scaling group.
-