RebalanceInstances
Rebalances the distribution of ECS instances in a multi-zone scaling group if the number of instances across zones is unbalanced due to insufficient inventory or other reasons.
Operation description
Operation description
Rebalancing compensates for unbalanced zones by creating new ECS instances to replace existing ones. New ECS instances are started before existing ones are terminated. Rebalancing does not affect the performance or availability of your applications.
-
Only multi-zone scaling groups with
MultiAZPolicyset toBALANCEare supported to balance the distribution of ECS instances across multiple zones. -
You can perform a rebalancing operation only when the instance distribution in the scaling group is severely unbalanced. A single rebalancing activity can replace up to 20 ECS instances.
-
During a rebalancing activity, if the number of instances in the scaling group approaches or reaches the specified maximum number of instances (MaxSize) but the distribution still needs to be balanced, Auto Scaling allows the number of instances to temporarily exceed MaxSize by 10%. This excess state lasts until the instance distribution is balanced, typically for 1 to 6 minutes.
NoteIf 10% of the maximum number of instances in the scaling group is not an integer, the fractional part is rounded up to allow an excess of 1 instance. For example, if the maximum number of instances in the scaling group is 15, 10% is 1.5, and a temporary excess of 2 instances is allowed.
Before you begin
The scaling group contains ECS instances.
The scaling group is enabled.
The network type of the scaling group is Virtual Private Cloud (VPC).
The multi-zone scaling policy (
MultiAZPolicy) of the scaling group is set to the balanced distribution policy (BALANCE).The scaling group is associated with multiple vSwitches distributed across at least two zones.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ess:RebalanceInstances |
update |
*ScalingGroup
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ScalingGroupId |
string |
Yes |
The ID of the scaling group. |
asg-bp18p2yfxow2dloq**** |
| RegionId |
string |
No |
The region ID of the scaling group. |
cn-hangzhou |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| ScalingActivityId |
string |
The ID of the scaling activity. |
asa-kjgffgdfadah**** |
| RequestId |
string |
The ID of the request. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
Examples
Success response
JSON format
{
"ScalingActivityId": "asa-kjgffgdfadah****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.