All Products
Search
Document Center

Auto Scaling:DescribeScalingInstances

Last Updated:Jul 17, 2024

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, the number of Elastic Compute Service (ECS) instances, the warm-up status of ECS instances, and the lifecycle status of ECS instances in a scaling group. You can specify the desired scaling group whose instances you want to query by scaling group ID. In addition, if you want to filter instances based on conditions such as the instance health status, lifecycle status, or creation method, you can also call this operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
LifecycleStatesarrayNo

The lifecycle states of the ECS instance in the scaling group. You can specify only one of the LifecycleStates and LifecycleState parameters at the same time. We recommend that you specify this parameter.

stringNo

The lifecycle state of the ECS instance in the scaling group. Valid values:

  • InService: The ECS instance is added to the scaling group and provides services as expected.
  • Pending: The ECS instance is being added to the scaling group. During this process, Auto Scaling adds the ECS instance to the backend server groups of the associated Server Load Balancer (SLB) instance and adds the private IP address of the ECS instance to the IP address whitelist of the associated ApsaraDB RDS instance.
  • Pending:Wait: The ECS instance is waiting to be added to the scaling group. If a lifecycle hook that applies to scale-outs is created for the scaling group, the ECS instance enters the Pending:Wait state. The ECS instance is added to the scaling group only after the lifecycle hook times out.
  • Protected: The ECS instance is being protected. The ECS instance can provide services as expected. However, Auto Scaling does not manage the lifecycle of the ECS instance. You must manually manage the lifecycle of the ECS instance.
  • Standby: The ECS instance is on standby. The ECS instance is out of service and the weight of the ECS instance as a backend server is set to zero. Auto Scaling does not manage the lifecycle of the ECS instance. You must manually manage the lifecycle of the ECS instance.
  • Stopped: The ECS instance is stopped. The ECS instance is stopped and cannot provide services.
  • Removing: The ECS instance is being removed from the scaling group. During this process, Auto Scaling removes the ECS instance from the backend server groups of the associated SLB instance and removes the IP address of the ECS instance from the IP address whitelist of the associated ApsaraDB RDS instance.
  • Removing:Wait: The ECS instance is waiting to be removed from the scaling group. If a lifecycle hook that applies to scale-ins is created for the scaling group, the ECS instance enters the Removing:Wait state. The ECS instance is removed from the scaling group only after the lifecycle hook times out.
InService

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

B13527BF-1FBD-4334-A512-20F5E9D3FB4D
ScalingInstancesarray<object>

The information about the ECS instances.

object
CreationTimestring

The time when the ECS instances were added to the scaling group. The value is accurate to the minute.

2020-05-18T03:11Z
LoadBalancerWeightinteger

The weight of each ECS instance as a backend server.

50
LaunchTemplateIdstring

The ID of the launch template.

lt-m5e3ofjr1zn1aw7****
InstanceIdstring

The IDs of the ECS instances.

i-bp109k5j3dum1ce6****
SpotStrategystring

The bidding policy for the preemptible instances. Valid values:

  • SpotWithPriceLimit: The instances were created as preemptible instances with a user-defined maximum hourly price.
  • SpotAsPriceGo: The instances were preemptible instances for which the market price at the time of purchase was automatically used as the bidding price.
SpotWithPriceLimit
LaunchTemplateVersionstring

The version number of the launch template.

1
HealthStatusstring

The health status of the ECS instances in the scaling group. If an ECS instance is not in the Running state, it is deemed as unhealthy. Valid values:

  • Healthy
  • Unhealthy

Auto Scaling automatically removes unhealthy ECS instances from the scaling group and then releases the automatically created instances among the unhealthy instances.

Unhealthy ECS instances that are manually added to the scaling group are released based on the management mode of their lifecycles. If the lifecycles of the ECS 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 ECS instances are managed by the scaling group, Auto Scaling removes the instances from the scaling group and releases the instances.

Note Make sure that you have sufficient balance within your Alibaba Cloud account. If your account has an overdue payment, all pay-as-you-go ECS instances, including preemptible instances, may be stopped or even released. For information about how the status of ECS instances changes when you have an overdue payment in your Alibaba Cloud account, see Overdue payments.
Healthy
ScalingGroupIdstring

The ID of the scaling group.

asg-bp1igpak5ft1flyp****
WarmupStatestring

The warm-up status of the ECS instances. Valid values:

  • NoNeedWarmup: The ECS instances do not need to go through a warm-up period.
  • WaitingForInstanceWarmup: The ECS instances are undergoing the warm-up process.
  • InstanceWarmupFinish: The warm-up process for the ECS instances is completed.
NoNeedWarmup
LifecycleStatestring

The lifecycle status of the ECS instances in the scaling group. Valid values:

  • InService: The ECS instances have been successfully added to the scaling group and are providing the intended services.
  • Pending: The ECS instances are in the process of being added to the scaling group. When an ECS instance is being added to the scaling group, Auto Scaling also adds it to the backend server groups of the attached load balancers and adds its private IP address to the IP address whitelists of the attached ApsaraDB RDS instances.
  • Pending:Wait: The ECS instances are awaiting addition to the scaling group. If a scale-out lifecycle hook is in effect, ECS instances will remain in the Pending:Wait state until the timeout period for the lifecycle hook expires.
  • Protected: The ECS instances are being safeguarded. Protected ECS instances can continue to provide services as expected, but Auto Scaling does not manage their lifecycles. You must manually manage the lifecycles of the ECS instances.
  • Standby: The ECS instances are on standby. Standby ECS instances do not provide services as expected, and their weights as backend servers are reset to zero. Auto Scaling does not manage their lifecycles. Therefore, you must manually manage the lifecycles of the ECS instances.
  • Stopped: The ECS instances are stopped. Stopped ECS instances do not provide services anymore.
  • Removing: The ECS instances are in the process of being removed from the scaling group. When an ECS instance is being removed from the scaling group, Auto Scaling also removes it from the backend server groups of the attached load balancers and removes its private IP address from the IP address whitelists of the attached ApsaraDB RDS instances.
  • Removing:Wait: The ECS instances are awaiting removal from the scaling group. If a scale-in lifecycle hook is in effect, ECS instances will remain in the Removing:Wait state until the timeout period for the lifecycle hook expires.
InService
CreationTypestring

The instance creation method. Valid values:

  • AutoCreated: Auto Scaling created the ECS instances based on the instance configuration source.
  • Attached: You manually added the ECS instances to the scaling group.
AutoCreated
ZoneIdstring

The zone ID of the ECS instances.

cn-hangzhou-g
ScalingConfigurationIdstring

The ID of the scaling configuration.

asc-bp1i65jd06v04vdh****
Entrustedboolean

Indicates whether the scaling group is allowed to manage the instance lifecycles when the ECS instances are added manually. If the scaling group is allowed to manage the instance lifecycles, Auto Scaling can release the ECS instances when they are automatically removed from the scaling group. Valid values:

  • true
  • false
true
WeightedCapacityinteger

The weight of the instance type. The weight indicates the capacity of a single instance of the specified instance type in the scaling group. A greater weight indicates that a smaller number of instances of the specified instance type are required to meet the expected capacity requirement.

4
CreatedTimestring

The time when the ECS instances were added to the scaling group. The value is accurate to seconds.

2020-05-18T03:11:39Z
ScalingActivityIdstring

The ID of the scaling activity during which the ECS instances were added to the scaling group.

asa-bp1c9djwrgxjyk31****
ScalingInstanceIdstring

The ID of the ECS instance or elastic container instance.

asi-j6cj1gcte640ekhb****
PrivateIpAddressstring

The private IP address of the ECS instance.

1**.2*.1**.2**

Examples

Sample success responses

JSONformat

{
  "RequestId": "B13527BF-1FBD-4334-A512-20F5E9D3FB4D",
  "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****",
      "ScalingInstanceId": "asi-j6cj1gcte640ekhb****",
      "PrivateIpAddress": "1**.2*.1**.2**"
    }
  ]
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-11-14The request parameters of the API has changed. The response structure of the API has changedView Change Details
2023-11-03The response structure of the API has changedView Change Details
2023-07-19The request parameters of the API has changedView Change Details