All Products
Search
Document Center

Auto Scaling:DescribeScalingInstances

Last Updated:Dec 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 scaling group whose instances you want to query by scaling group ID. 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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ess:DescribeScalingInstancesget
*ScalingGroup
acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the scaling group.

cn-hangzhou
ScalingGroupIdstringNo

The ID of the scaling group.

asg-bp1igpak5ft1flyp****
ScalingConfigurationIdstringNo

The ID of the scaling configuration.

asc-bp1i65jd06v04vdh****
HealthStatusstringNo

The health status of the ECS instance in the scaling group. If an ECS instance is not in the Running state, the instance is considered 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 the lifecycles of the instances. 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 Alibaba Cloud 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
LifecycleStatestringNo

The lifecycle status 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. When an ECS instance is being added to the scaling group, Auto Scaling also adds the instance to the backend server groups of the attached load balancers and adds the private IP address of the instance to the IP address whitelists of the attached ApsaraDB RDS instances.
  • Pending:Wait: The ECS instance is waiting to be added to the scaling group. If a scale-out lifecycle hook is in effect, the ECS instance remains in the Pending:Wait state until the timeout period for the lifecycle hook expires.
  • Protected: The ECS instance is protected. Protected ECS instances can continue to provide services as expected, but Auto Scaling does not manage the lifecycles of the ECS instances. You must manually manage the lifecycles of the ECS instances.
  • Standby: The ECS instance is on standby. Standby ECS instances do not provide services as expected, and the weights of the ECS instances as backend servers are reset to zero. Auto Scaling does not manage the lifecycles of the ECS instances. Therefore, you must manually manage the lifecycles of the ECS instances.
  • Stopped: The ECS instance is stopped. Stopped ECS instances no longer provide services.
  • Removing: The ECS instance is being removed from the scaling group. When an ECS instance is being removed from the scaling group, Auto Scaling also removes the instance from the backend server groups of the attached load balancers and removes the private IP address of the instance from the IP address whitelists of the attached ApsaraDB RDS instances.
  • Removing:Wait: The ECS instance is waiting to be removed from the scaling group. If a scale-in lifecycle hook is in effect, the ECS instance remains in the Removing:Wait state until the timeout period for the lifecycle hook expires.
InService
CreationTypestringNo

The instance creation method. Valid values:

  • AutoCreated: The ECS instances are created by Auto Scaling based on the instance configuration source.
  • Attached: The ECS instances are manually added to the scaling group.
  • Managed: The Alibaba Cloud-managed third-party instances are manually added to the scaling group.
AutoCreated
PageNumberintegerNo

The page number. Pages start from page 1.

Default value: 1.

1
PageSizeintegerNo

The number of entries per page. Maximum value: 100.

Default value: 10.

10
ScalingActivityIdstringNo

The ID of the scaling activity.

asa-bp1c9djwrgxjyk31****
InstanceIdsarrayNo

The IDs of the ECS instances.

The IDs of inactive instances are not displayed in the query result, and no errors are returned.

stringNo

The ID of the ECS instance.

The IDs of inactive instances are not displayed in the query result, and no errors are returned.

i-bp109k5j3dum1ce6****
CreationTypesarrayNo

The instance creation methods. If you specify this parameter, you cannot specify CreationType.

stringNo

The instance creation method. You can set the value to AutoCreated, Attached, or Managed.

AutoCreated
LifecycleStatesarrayNo

The lifecycle status of the ECS instances in the scaling group. You can specify only one of LifecycleStates and LifecycleState at a time. We recommend that you specify this parameter.

stringNo

The lifecycle status 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. When an ECS instance is being added to the scaling group, Auto Scaling also adds the instance to the backend server groups of the attached load balancers and adds the private IP address of the instance to the IP address whitelists of the attached ApsaraDB RDS instances.
  • Pending:Wait: The ECS instance is waiting to be added to the scaling group. If a scale-out lifecycle hook is in effect, the ECS instance remains in the Pending:Wait state until the timeout period for the lifecycle hook expires.
  • Protected: The ECS instance is protected. Protected ECS instances can continue to provide services as expected, but Auto Scaling does not manage the lifecycles of the ECS instances. You must manually manage the lifecycles of the ECS instances.
  • Standby: The ECS instance is on standby. Standby ECS instances do not provide services as expected, and the weights of the ECS instances as backend servers are reset to zero. Auto Scaling does not manage the lifecycles of the ECS instances. Therefore, you must manually manage the lifecycles of the ECS instances.
  • Stopped: The ECS instance is stopped. Stopped ECS instances no longer provide services.
  • Removing: The ECS instance is being removed from the scaling group. When an ECS instance is being removed from the scaling group, Auto Scaling also removes the instance from the backend server groups of the attached load balancers and removes the private IP address of the instance from the IP address whitelists of the attached ApsaraDB RDS instances.
  • Removing:Wait: The ECS instance is waiting to be removed from the scaling group. If a scale-in lifecycle hook is in effect, the ECS instance remains in the Removing:Wait state until the timeout period for the lifecycle hook expires.
InService

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

B13527BF-1FBD-4334-A512-20F5E9D3FB4D
PageSizeinteger

The number of entries per page.

10
PageNumberinteger

The page number.

1
TotalSpotCountinteger

The total number of preemptible instances that run as expected in the scaling group.

4
TotalCountinteger

The total number of ECS instances in the scaling group.

1
ScalingInstancesarray<object>

The ECS instances.

ScalingInstanceobject

The ECS instance.

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.

Note This parameter is deprecated and is not recommended.
50
LaunchTemplateIdstring

The ID of the launch template.

lt-m5e3ofjr1zn1aw7****
InstanceIdstring

The ID of the ECS instance.

i-bp109k5j3dum1ce6****
SpotStrategystring

The bidding policy for the preemptible instances. Valid values:

  • SpotWithPriceLimit: The instances are preemptible instances that have a user-defined maximum hourly price.
  • SpotAsPriceGo: The instances are preemptible instances for which the market price at the time of purchase is automatically used as the bidding price.
SpotWithPriceLimit
LaunchTemplateVersionstring

The version number of the launch template.

1
HealthStatusstring

The health status of the ECS instance in the scaling group. If an ECS instance is not in the Running state, the instance is considered 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 the lifecycles of the instances. 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 Alibaba Cloud 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 undergo a warm-up process.
  • WaitingForInstanceWarmup: The ECS instances are undergoing the warm-up process.
  • InstanceWarmupFinish: The warm-up process for the ECS instances is complete.
NoNeedWarmup
LifecycleStatestring

The lifecycle status 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. When an ECS instance is being added to the scaling group, Auto Scaling also adds the instance to the backend server groups of the attached load balancers and adds the private IP address of the instance to the IP address whitelists of the attached ApsaraDB RDS instances.
  • Pending:Wait: The ECS instance is waiting to be added to the scaling group. If a scale-out lifecycle hook is in effect, the ECS instance remains in the Pending:Wait state until the timeout period for the lifecycle hook expires.
  • Protected: The ECS instance is protected. Protected ECS instances can continue to provide services as expected, but Auto Scaling does not manage the lifecycles of the ECS instances. You must manually manage the lifecycles of the ECS instances.
  • Standby: The ECS instance is on standby. Standby ECS instances do not provide services as expected, and the weights of the ECS instances as backend servers are reset to zero. Auto Scaling does not manage the lifecycles of the ECS instances. Therefore, you must manually manage the lifecycles of the ECS instances.
  • Stopped: The ECS instance is stopped. Stopped ECS instances no longer provide services.
  • Removing: The ECS instance is being removed from the scaling group. When an ECS instance is being removed from the scaling group, Auto Scaling also removes the instance from the backend server groups of the attached load balancers and removes the private IP address of the instance from the IP address whitelists of the attached ApsaraDB RDS instances.
  • Removing:Wait: The ECS instance is waiting to be removed from the scaling group. If a scale-in lifecycle hook is in effect, the ECS instance remains in the Removing:Wait state until the timeout period for the lifecycle hook expires.
InService
CreationTypestring

The instance creation method. Valid values:

  • AutoCreated: The ECS instances are created by Auto Scaling based on the instance configuration source.
  • Attached: The ECS instances are manually added 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 ECS instances are manually added. If the scaling group is allowed to manage the instance lifecycles, Auto Scaling can release the ECS instances when the instances 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 higher weight indicates that a smaller number of instances of the 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 the second.

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