Updated on 2022-02-22 GMT+08:00

Lifecycle

The lifecycle of an instance in an AS group starts when it is created and ends when it is removed from the AS group.

The instance lifecycle changes as shown in Figure 1 if you have not added a lifecycle hook to the AS group.
Figure 1 Instance lifecycle
In trigger conditions 2 and 4, a scaling action is automatically triggered to change the instance status.
Table 1 Instance status

Status

Sub-status

Status Description

Trigger Condition

Initial

N/A

The instance has not been added to an AS group.

The status of an instance is changed to Adding to AS group when either of the following operations is performed:
  • When you manually change the expected number of instances or a scaling condition is met, a scaling action is triggered to expand resources.
  • You manually add instances to the AS group.

Adding to AS group

Add an instance.

When trigger condition 1 is met, AS adds the instance to expand the AS group capacity.

(Optional) Associate the instance with a load balancing listener.

When trigger condition 1 is met, AS associates the created instance with the load balancing listener.

Enabled

N/A

The instance is added to the AS group and starts to process service traffic.

The instance status is changed from Enabled to Removing from AS group when any of the following operations are performed:
  • When you manually change the expected number of instances or a scaling condition is met, a scaling action is triggered to reduce resources.
  • When a health check shows that an enabled instance is unhealthy, the instance is removed from the AS group.
  • You manually remove an instance from an AS group.

Removing from AS group

(Optional) Disassociate the instance from the load balancing listener.

When trigger condition 3 is met, the AS group starts to reduce resources and disassociate the instance from the load balancing listener.

Remove the instance.

After the instance is unbound from the load balancing listener, it is removed from the AS group.

Removed

N/A

The instance lifecycle in the AS group ends.

N/A

Instances are added to an AS group manually or through a scaling action. Then, they go through the Adding to AS group, Enabled, and Removing from AS group statuses, and are finally removed from the AS group.

If you have not added a lifecycle hook to the AS group, the instance lifecycle changes as shown in Figure 2. When the AS group is performing a scaling action, instances are suspended by the lifecycle hook and remain in the waiting state until the timeout period ends or the user manually calls back the instances. You can perform desired operations during the waiting. For example, you can install or configure software on a newly added instance or download log files from an instance before it is removed.
Figure 2 Instance lifecycle
In trigger conditions 2, 4, 6, and 8, a scaling action is automatically triggered to change the instance status.
Table 2 Instance status

Status

Sub-status

Status Description

Trigger Description

Initial

N/A

The instance has not been added to an AS group.

The status of an instance is changed to Adding to AS group when either of the following operations is performed:
  • When you manually change the expected number of instances or a scaling condition is met, a scaling action is triggered to expand resources.
  • You manually add instances to the AS group.

Adding to AS group

Add an instance.

When trigger condition 1 is met, AS adds the instance to expand the AS group capacity.

Wait (Adding to AS group)

N/A

The lifecycle hook suspends the instance that is being added to the AS group and sets the instance to be in waiting state.

The instance status is changed from Wait (Adding to AS group) to Adding to AS group when either of the following operations is performed:
  • The default callback action is performed.
  • You manually perform the callback action.

Adding to AS group

(Optional) Associate the instance with a load balancing listener.

When trigger condition 3 is met, AS associates the instance with the load balancing listener.

Enabled

N/A

The instance is added to the AS group and starts to process service traffic.

The instance status is changed from Enabled to Removing from AS group when any of the following operations are performed:
  • When you manually change the expected number of instances or a scaling condition is met, a scaling action is triggered to reduce resources.
  • When a health check shows that an enabled instance is unhealthy, the instance is removed from the AS group.
  • You manually remove an instance from an AS group.

Removing from AS group

(Optional) Disassociate the instance from the load balancing listener.

When trigger condition 5 is met, the AS group starts to reduce resources and disassociate the instance from the load balancing listener.

Wait (Removing from AS group)

N/A

The lifecycle hook suspends the instance that is being removed from the AS group and sets the instance to be in waiting state.

The instance status is changed from Wait (Removing from AS group) to Removing from AS group when either of the following operations is performed:
  • The default callback action is performed.
  • You manually perform the callback action.

Removing from AS group

Remove the instance.

When trigger condition 7 is met, AS removes the instance from the AS group.

Removed

N/A

The instance lifecycle in the AS group ends.

N/A