Updated on 2026-09-23 GMT+08:00

Overview

ECSs managed by an AS group are called scaling instances. Each instance maps to a unique ECS and has attributes assigned by the AS group. The configuration of an ECS instance in an AS group remains unchanged even if the ECS has been modified.

Instance Capabilities

Capability

Description

Manually adding instances

You can manually add instances to an AS group. There are no billing-mode restrictions on manually added instances.

Manually removing instances

You can manually remove instances from an AS group.

Instance protection

You can enable or disable protection for instances in an AS group.

Standby instances

You can put instances into or out of standby.

Instance Health Check

Status

Status in API

Description

Initializing

INITIALIZING

When an instance is being added, its health status is Initializing.

Healthy

NORMAL

After an instance is added to an AS group, its health status is Normal by default.

Unhealthy

ERROR

This state is automatically set by the health check system when an exception occurs.

Number of Instances in an AS Group

The number of instances in an AS group can be the expected number of instances, number of current instances, maximum number of instances, and minimum number of instances.

Type

Description

Number of current instances

Actual number of instances in an AS group. This value cannot be changed by manually modifying an AS group parameter or executing an AS policy.

Expected number of instances

Desired number of instances in an AS group. If the number of current instances in an AS group is different from the expected number of instances, the AS group starts scaling to reach the expected number.

The value can be changed by manually modifying an AS group parameter or executing an AS policy.

Maximum number of instances

Maximum value of the expected number of instances.

Minimum number of instances

Minimum value of the expected number of instances.

The expected number of instances is between the minimum and maximum numbers of instances. The expected number of instances can be changed manually or automatically (for example, automatically changed through scheduled, periodic, or alarm-based policies). The following table illustrates examples of changing the expected number of instances.

Scenario

Example

Result

Manually changing the expected number of instances

Scale-out:

Assume that the number of instances in an AS group is 1 and the expected number of instances is 1. One instance needs to be added during peak hours. Steps:

  1. Log in to the AS console.
  2. Locate the row that contains the AS group. Choose More > Modify in the Operation column.
  3. In the Modify AS Group dialog box, change the expected number of instances to 2.
  4. Click OK.

The expected number of instances is changed to 2. The AS group starts a scale-out action to add an instance. After the scale-out is complete, the number of instances in the AS group is changed to 2 automatically, which is the same as the expected number of instances.

Scale-in:

Assume that the number of instances in an AS group is 2 and the expected number of instances is 2. One instance needs to be removed during off-peak hours. Steps:

  1. Log in to the AS console.
  2. Locate the row that contains the AS group. Choose More > Modify in the Operation column.
  3. In the Modify AS Group dialog box, change the expected number of instances to 1.
  4. Click OK.

The expected number of instances is changed to 1. The AS group starts a scale-in action to remove an instance. After the scale-in is complete, the number of instances in the AS group is changed to 1 automatically, which is the same as the expected number of instances.

Automatically changing the expected number of instances

Scale-out:

Assume that the number of instances in an AS group is 1 and the expected number of instances is 1. One instance needs to be added during peak hours. The execution process is as follows:

  1. Create an alarm policy for the AS group and set the policy action to add one instance.
  2. When the scaling conditions are met, the system automatically changes the expected number of instances to 2 to trigger a scale-out action that will add one instance to the AS group.
  3. After the scale-out is complete, the number of instances in the AS group changes to 2, and the expected number of instances changes to 2.

The expected number of instances is changed to 2. The AS group starts a scale-out action to add an instance. After the scale-out is complete, the number of instances in the AS group is changed to 2 automatically, which is the same as the expected number of instances.

Scale-in:

Assume that the number of instances in an AS group is 2 and the expected number of instances is 2. One instance needs to be removed during off-peak hours. The execution process is as follows:

  1. Create an alarm policy for the AS group and set the policy action to remove one instance.
  2. When the scaling conditions are met, the system automatically changes the expected number of instances to 1 to trigger a scale-in action that will remove one instance from the AS group.
  3. After the scale-in is complete, the number of instances in the AS group changes to 1, and the expected number of instances changes to 1.

The expected number of instances is changed to 1. The AS group starts a scale-in action to remove an instance. After the scale-in is complete, the number of instances is changed to 1 automatically, which is the same as the expected number of instances.

The minimum number of instances specifies the minimum value of the expected number of instances. However, the number of current instances may be less than the value. In this case, the AS group starts a new scale-out action to increase the number of current instances. The following table illustrates an example.

Scenario

Example

Result

Instance removal through health check

Assume that the number of instances in an AS group is 1, the expected number of instances is 1, and the minimum number of instances is 1. When an instance in the AS group is stopped, the system performs the following operations:

  1. If the AS health check detects that the instance is abnormal, the system triggers a scale-in action.
  2. After the scale-in is complete, the abnormal instance is removed from the AS group, and the number of instances in the AS group is reduced to 0.
  3. The system triggers a scale-out action to add an instance because the number of current instances is less than the expected number of instances.
  4. After the scale-out is complete, a new instance is created, and the number of instances becomes 1.

The AS health check removes the abnormal instance from the AS group. The AS group creates a new instance to ensure that the number of instances in the AS group is the same as the expected number of instances.

Instance Lifecycle Status

Status

Description

Status in API

Enabled

The instance is running properly and is involved in AS group health check.

INSERVICE

Adding

The instance is being added to the AS group, and the instance creation or startup process is in progress.

PENDING

Pending addition

The instance is waiting to be added to the AS group. When a lifecycle hook is added to an AS group, the scaling actions that trigger the hook are suspended, and the instances involved are put into a wait state.

PENDING_WAIT

Removing

The instance is being removed from the AS group, and the instance removal process is in progress.

REMOVING

Pending removal

The instance is waiting to be removed from the AS group. When a lifecycle hook is added to an AS group, the scaling actions that trigger the hook are suspended, and the instances involved are put into a wait state.

REMOVING_WAIT

Standby

The instance has been put into the standby state. Putting an instance into the standby state allows you to perform operations such as stopping or restarting an instance without removing it from the AS group.

STANDBY

Entering standby mode

The instance is entering the standby state, switching from Enabled to Standby.

ENTERING_STANDBY

The following figure shows the lifecycle status changes of an instance during a scaling action.

If you use a lifecycle hook, the lifecycle status changes are as follows.