Removes one or more ECS instances from a scaling group.
Operation description
Operation description
-
Before you call this operation, make sure that the following conditions are met:
-
The scaling group is in the Enabled state.
-
No scaling activity is in progress in the scaling group.
NoteIf no scaling activity is in progress in the scaling group, this operation can bypass the cooldown time and directly trigger a scaling activity.
-
-
Take note of the following items:
After an ECS instance, an elastic container instance, or a managed instance is removed from a scaling group, the instance continues to exist independently. You can call the AttachInstances operation to add the ECS instance, elastic container instance, or managed instance to another scaling group.
Calling this operation to remove an ECS instance, an elastic container instance, or a managed instance does not stop or release the instance.
After the operation is called, it only indicates that Auto Scaling has accepted the request. A scaling activity can be triggered, but the success of the scaling activity is not guaranteed. You must check the status of the scaling activity based on the returned ScalingActivityId.
The number of ECS instances, elastic container instances, or managed instances in the scaling group minus the number of instances being removed cannot be less than the minimum number of instances (MinSize) in the scaling group. Otherwise, an error is returned.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ScalingGroupId |
string |
Yes |
The ID of the scaling group. |
asg-bp1igpak5ft1flyp**** |
| DecreaseDesiredCapacity |
boolean |
No |
Specifies whether to modify the expected number of instances. Valid values:
Default value: true. |
true |
| IgnoreInvalidInstance |
boolean |
No |
Specifies whether to ignore invalid instances when removing a batch of instances from the scaling group. Valid values:
Default value: false. |
false |
| DetachOption |
string |
No |
Specifies whether to stop using ECS instances or elastic container instances as backend servers of the associated load balancing instance (that is, remove the ECS instances or elastic container instances from the default server group and virtual server group of the load balancing instance), and whether to remove the ECS instances or elastic container instances from the access whitelist of the associated ApsaraDB RDS instance. both: removes the ECS instances or elastic container instances from the default server group and virtual server group of the load balancing instance, and removes the ECS instances or elastic container instances from the access whitelist of the ApsaraDB RDS instance. Note
Settings for this parameter are not supported when managed instances are removed from the scaling group. |
both |
| InstanceId |
array |
Yes |
The ID of the ECS instance, elastic container instance, or managed instance to be removed. |
i-bp109k5j3dum1ce6**** |
|
string |
No |
Instance ID of the ECS instance, elastic container instance, or managed instance to be removed. Valid values of N: 1 to 20. Examples:
Note
Only one type of instance can be removed in a single request. |
i-bp109k5j3dum1ce6**** |
|
| LifecycleHook |
boolean |
No |
Specifies whether to trigger the scale-in lifecycle hook when ECS instances or elastic container instances are removed from the scaling group. Valid values:
Note
This parameter is not supported when managed instances are removed from the scaling group. Default value: false. |
false |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence. |
123e4567-e89b-12d3-a456-42665544**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| ScalingActivityId |
string |
The ID of the scaling activity. |
asa-bp1gbswjhjrw8tko**** |
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
Examples
Success response
JSON format
{
"ScalingActivityId": "asa-bp1gbswjhjrw8tko****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.