All Products
Search
Document Center

Auto Scaling:DescribeScalingInstances

Last Updated:Jun 06, 2024

Queries the Elastic Compute Service (ECS) instances in a scaling group

Debugging

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

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:DescribeScalingInstancesRead
  • ScalingGroup
    acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId}
    none
none

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
ScalingInstancesobject []

The information about the ECS instances.

CreationTimestring

The time when the ECS instance was added to the scaling group. The value is accurate to minutes.

2020-05-18T03:11Z
LoadBalancerWeightinteger

The weight of the ECS instance as a backend server.

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 instance. Valid values:

  • SpotWithPriceLimit: The instance is created as a preemptible instance with a user-defined maximum hourly price.
  • SpotAsPriceGo: The instance is a preemptible instance 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 the ECS instance does not run as expected, Auto Scaling considers the ECS instance unhealthy. Valid values:

  • Healthy
  • Unhealthy

Auto Scaling automatically removes unhealthy ECS instances from the scaling group and then releases 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 instance 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 you have overdue payments within your Alibaba Cloud account, pay-as-you-go and preemptible instances are stopped or even released. For information about how the states of ECS instances change when you have overdue payments within your Alibaba Cloud account, see Overdue payments.
Healthy
ScalingGroupIdstring

The ID of the scaling group.

asg-bp1igpak5ft1flyp****
WarmupStatestring

The warmup state of the ECS instance. Valid values:

  • NoNeedWarmup: The instance does not need to be warmed up.
  • WaitingForInstanceWarmup: The instance is being warmed up.
  • InstanceWarmupFinish: The instance is warmed up.
NoNeedWarmup
LifecycleStatestring

The lifecycle state of the ECS instance. 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 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
CreationTypestring

Indicates how the ECS instance is created. Valid values:

  • AutoCreated: Auto Scaling automatically creates ECS instances based on the instance configuration source.
  • Attached: You manually add independent ECS instances to the scaling group.
AutoCreated
ZoneIdstring

The zone ID of the ECS instance.

cn-hangzhou-g
ScalingConfigurationIdstring

The ID of the scaling configuration.

asc-bp1i65jd06v04vdh****
Entrustedboolean

Indicates whether the scaling group is allowed to manage the instance lifecycle when you manually add the instance. If the scaling group is allowed to manage the instance lifecycle, Auto Scaling can release the instance when the instance is automatically removed from the scaling group. This rule does not apply to instances that are manually 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 instance was 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 instance is added to the scaling group.

asa-bp1c9djwrgxjyk31****
ScalingInstanceIdstring

The identifier of the ECS 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.

asi-j6cj1gcte640ekhb****
PrivateIpAddressstring

The private IP address of the ECS instance in the scaling group.

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 changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: LifecycleStates
Output ParametersThe response structure of the API has changed.
2023-11-03The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.
2023-07-19The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: CreationTypes