Queries instances in a scaling group. You can call the DescribeScalingInstances operation to query instance details, such as the number of preemptible instances in the Running state, number of Elastic Compute Service (ECS) instances, warm-up status of ECS instances, and lifecycle status of ECS instances in a scaling group. You can specify the scaling group ID when you call this operation. You can also call this operation to filter instances based on conditions, such as the instance health status, lifecycle status, and creation method.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | DescribeScalingInstances | The operation that you want to perform. Set the value to DescribeScalingInstances. |
RegionId | String | Yes | cn-hangzhou | The region ID of the scaling group. |
ScalingGroupId | String | No | asg-bp1igpak5ft1flyp**** | The ID of the scaling group. |
ScalingConfigurationId | String | No | asc-bp1i65jd06v04vdh**** | The ID of the scaling configuration. |
HealthStatus | String | No | Healthy | The health status of the instances. An ECS instance or elastic container instance that is not in the Running state is considered unhealthy. Valid values:
Auto Scaling removes unhealthy ECS instances or elastic container instances from scaling groups. If the unhealthy instances are automatically created, Auto Scaling releases the instances after the removal. The instance management status determines whether to release ECS instances or elastic container instances that are manually added to a scaling group. If the lifecycles of the instances are not managed by the scaling group, Auto Scaling removes the instances from the scaling group but does not release the instances. If the lifecycles of the instances are managed by the scaling group, Auto Scaling removes the instances from the scaling group and releases the instances. Note Make sure that your Alibaba Cloud account has sufficient balance. If your Alibaba Cloud account has overdue payments, all pay-as-you-go and preemptible ECS instances or elastic container instances are stopped or released in specific cases. For information about how the status of ECS instances and elastic container instances changes due to overdue payments, see Overdue payments. |
LifecycleState | String | No | InService | The lifecycle status of the instances. Valid values:
|
CreationType | String | No | AutoCreated | The instance creation method. Valid values:
|
PageNumber | Integer | No | 1 | The page number. Pages start from page 1. Default value: 1. |
PageSize | Integer | No | 10 | The number of entries per page. Maximum value: 100. Default value: 10. |
ScalingActivityId | String | No | asa-bp1c9djwrgxjyk31**** | The ID of the scaling activity. |
InstanceId.N | String | No | i-bp109k5j3dum1ce6**** | The ID of instance N in the scaling group. Valid values of N: 1 to 20. Invalid instance IDs are not displayed in the query result, and no error is reported. |
CreationTypes.N | String | No | AutoCreated | The instance creation methods. If you specify this parameter, you cannot specify CreationType. Valid values:
|
LifecycleStates.N | String | No | InService | The lifecycle status of the instances. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
RequestId | String | B13527BF-1FBD-4334-A512-20F5E9D3**** | The request ID. |
PageSize | Integer | 10 | The number of entries per page. |
PageNumber | Integer | 1 | The page number. |
TotalSpotCount | Integer | 4 | The total number of preemptible instances that run as expected in the scaling group. |
TotalCount | Integer | 1 | The total number of instances. |
ScalingInstances | Array of ScalingInstance | The information about the instances. | |
ScalingInstance | |||
CreationTime | String | 2020-05-18T03:11Z | The time when the instances were added to the scaling group. The value is accurate to the minute. |
LoadBalancerWeight | Integer | 50 | The load balancing weight of each instance in the scaling group. Note The parameter is no longer available. We recommend that you do not specify this parameter. |
LaunchTemplateId | String | lt-m5e3ofjr1zn1aw7**** | The ID of the launch template. |
InstanceId | String | i-bp109k5j3dum1ce6**** | The ID of the instance. |
SpotStrategy | String | SpotWithPriceLimit | The preemption policy of the preemptible instances. Valid values:
|
LaunchTemplateVersion | String | 1 | The version number of the launch template. |
HealthStatus | String | Healthy | The health status of the instance. An ECS instance or elastic container instance that is not in the Running state is considered unhealthy. Valid values:
Auto Scaling removes unhealthy ECS instances or elastic container instances from scaling groups. If the unhealthy instances are automatically created, Auto Scaling releases the instances after the removal. The instance management status determines whether to release ECS instances or elastic container instances that are manually added to a scaling group. If the lifecycles of the instances are not managed by the scaling group, Auto Scaling removes the instances from the scaling group but does not release the instances. If the lifecycles of the instances are managed by the scaling group, Auto Scaling removes the instances from the scaling group and releases the instances. Note Make sure that your Alibaba Cloud account has sufficient balance. If your Alibaba Cloud account has overdue payments, all pay-as-you-go and preemptible ECS instances or elastic container instances are stopped or released in specific cases. For information about how the status of ECS instances and elastic container instances changes due to overdue payments, see Overdue payments. |
ScalingGroupId | String | asg-bp1igpak5ft1flyp**** | The ID of the scaling group. |
WarmupState | String | NoNeedWarmup | The warm-up status of the instances. Valid values:
|
LifecycleState | String | InService | The lifecycle status of the instances. Valid values:
|
CreationType | String | AutoCreated | The instance creation method. Valid values:
|
ZoneId | String | cn-hangzhou-g | The zone ID. |
ScalingConfigurationId | String | asc-bp1i65jd06v04vdh**** | The ID of the scaling configuration. |
Entrusted | Boolean | true | Indicates whether the lifecycles of the instances that are manually added to the scaling group are managed by the scaling group. If the scaling group manages the lifecycles of the instances that are manually added, Auto Scaling releases the instances after Auto Scaling removes the instances from the scaling group. The release rule does not apply to instances that are manually removed from the scaling group. Valid values:
|
WeightedCapacity | Integer | 4 | The weight of the instance type, which indicates the capacity of a single instance of the specified instance type in the scaling group. A higher weight indicates that a smaller number of instances of the instance type are required to meet the expected capacity requirement. |
CreatedTime | String | 2020-05-18T03:11:39Z | The time when the instances were added to the scaling group. The value is accurate to the second. |
ScalingActivityId | String | asa-bp1c9djwrgxjyk31**** | The ID of the scaling activity during which the instances were added to the scaling group. |
InstanceType | String | ecs.n1.small | The instance type. |
ScalingInstanceId | String | asi-j6cj1gcte640ekhb**** | The identifier of the instance in the scaling group. The identifier of an ECS instance or elastic container instance matches the ID of the ECS instance or elastic container instance. |
PrivateIpAddress | String | 1**.2*.1**.2** | The private IP address of the instance in the scaling group. |
Examples
Sample requests
http(s)://ess.aliyuncs.com/?Action=DescribeScalingInstances
&RegionId=cn-hangzhou
&ScalingGroupId=asg-bp1igpak5ft1flyp****
&ScalingConfigurationId=asc-bp1i65jd06v04vdh****
&HealthStatus=Healthy
&LifecycleState=InService
&CreationType=AutoCreated
&PageNumber=1
&PageSize=10
&ScalingActivityId=asa-bp1c9djwrgxjyk31****
&InstanceId=["i-bp109k5j3dum1ce6****"]
&CreationTypes=["AutoCreated"]
&LifecycleStates=["InService"]
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeScalingInstancesResponse>
<RequestId>B13527BF-1FBD-4334-A512-20F5E9D3****</RequestId>
<PageSize>10</PageSize>
<PageNumber>1</PageNumber>
<TotalSpotCount>4</TotalSpotCount>
<TotalCount>1</TotalCount>
<ScalingInstances>
<CreationTime>2020-05-18T03:11Z</CreationTime>
<LoadBalancerWeight>50</LoadBalancerWeight>
<LaunchTemplateId>lt-m5e3ofjr1zn1aw7****</LaunchTemplateId>
<InstanceId>i-bp109k5j3dum1ce6****</InstanceId>
<SpotStrategy>SpotWithPriceLimit</SpotStrategy>
<LaunchTemplateVersion>1</LaunchTemplateVersion>
<HealthStatus>Healthy</HealthStatus>
<ScalingGroupId>asg-bp1igpak5ft1flyp****</ScalingGroupId>
<WarmupState>NoNeedWarmup</WarmupState>
<LifecycleState>InService</LifecycleState>
<CreationType>AutoCreated</CreationType>
<ZoneId>cn-hangzhou-g</ZoneId>
<ScalingConfigurationId>asc-bp1i65jd06v04vdh****</ScalingConfigurationId>
<Entrusted>true</Entrusted>
<WeightedCapacity>4</WeightedCapacity>
<CreatedTime>2020-05-18T03:11:39Z</CreatedTime>
<ScalingActivityId>asa-bp1c9djwrgxjyk31****</ScalingActivityId>
<InstanceType>ecs.n1.small</InstanceType>
<ScalingInstanceId>asi-j6cj1gcte640ekhb****</ScalingInstanceId>
<PrivateIpAddress>1**.2*.1**.2**</PrivateIpAddress>
</ScalingInstances>
</DescribeScalingInstancesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "B13527BF-1FBD-4334-A512-20F5E9D3****",
"PageSize" : 10,
"PageNumber" : 1,
"TotalSpotCount" : 4,
"TotalCount" : 1,
"ScalingInstances" : [ {
"CreationTime" : "2020-05-18T03:11Z",
"LoadBalancerWeight" : 50,
"LaunchTemplateId" : "lt-m5e3ofjr1zn1aw7****",
"InstanceId" : "i-bp109k5j3dum1ce6****",
"SpotStrategy" : "SpotWithPriceLimit",
"LaunchTemplateVersion" : "1",
"HealthStatus" : "Healthy",
"ScalingGroupId" : "asg-bp1igpak5ft1flyp****",
"WarmupState" : "NoNeedWarmup",
"LifecycleState" : "InService",
"CreationType" : "AutoCreated",
"ZoneId" : "cn-hangzhou-g",
"ScalingConfigurationId" : "asc-bp1i65jd06v04vdh****",
"Entrusted" : true,
"WeightedCapacity" : 4,
"CreatedTime" : "2020-05-18T03:11:39Z",
"ScalingActivityId" : "asa-bp1c9djwrgxjyk31****",
"InstanceType" : "ecs.n1.small",
"ScalingInstanceId" : "asi-j6cj1gcte640ekhb****",
"PrivateIpAddress" : "1**.2*.1**.2**"
} ]
}
Error codes
For a list of error codes, see Service error codes.