All Products
Search
Document Center

Auto Scaling:Manually configure instances for a scaling group

Last Updated:May 23, 2024

You can manually add existing Elastic Compute Service (ECS) instances, elastic container instances, or third-party instances that are managed by Alibaba Cloud to your scaling groups. You can also manually remove or delete ECS instances, elastic container instances, or managed instances that are no longer required from your scaling groups. Manual adjustment of resources allows you to reduce resource costs while meeting your business requirements. This topic describes how to add, view, remove, and delete instances.

Prerequisites

The following table describes the requirements that must be met before you can manually add instances to a scaling group.

Item

Requirement

ECS instances or elastic container instances

  • The instances and the scaling group reside in the same region.

  • The instances are not added to other scaling groups.

  • The instances are in the Running state.

  • The network type of the instances is classic network or Virtual Private Cloud (VPC).

    • If the network type of the scaling group is classic network, you can add only ECS instances or elastic container instances of the classic network type to the scaling group.

    • If the network type of the scaling group is VPC, you can add only ECS instances or elastic container instances in the same VPC as the scaling group to the scaling group.

Managed instances

  • The instances are non-Alibaba Cloud instances that can access the Internet.

  • The instances are managed in the same region as the scaling group.

  • The instances can be manually added only to scaling groups of the ECS type.

  • The instances are not added to other scaling groups.

Scaling groups

  • The scaling group is in the Enabled state.

  • The scaling group does not have ongoing scaling activities.

Manually add instances to a scaling group

The procedure for adding instances to a scaling group varies based on the instance types. Procedure

  1. Log on to the Auto Scaling console.

  2. In the left-side navigation pane, click Scaling Groups.

  3. Find the scaling group to which you want to add instances and use one of the following methods to open the scaling group details page.

    • Click the ID of the scaling group in the Scaling Group Name/ID column.

    • Click Details in the Actions column.

  4. In the upper part of the scaling group details page, click the Instances tab.

  5. Select one of the following methods to add instances based on the instance type:

    Add ECS instances or elastic container instances

    Usage notes

    Before you manually add ECS instances or elastic container instances, take note of the following items:

    • You can add ECS instances to only scaling groups of the ECS type and add elastic container instances to only scaling groups of the Elastic Container Instance type.

    • The configurations such as instance types and images of the ECS instances or elastic container instances that you manually add to a scaling group are independent of the scaling configuration of the scaling group. The images, security groups, and other settings do not always match the scaling configuration of the scaling group.

    • Manual addition of ECS instances or elastic container instances to a scaling group will trigger scaling activities that can bypass the cooldown period of the scaling group. For more information about the cooldown period feature, see Cooldown period.

    • After you manually add a specific number of instances to a scaling group, the following changes may occur in the scaling group:

      • The values of the Minimum Number of Instances and Maximum Number of Instances parameters remain unchanged.

      • The value of the Expected Number of Instances parameter after you manually add instances = The value of the Expected Number of Instances parameter before you manually add instances + Number of instances that you manually add to the scaling group

      • Total number of instances before you manually add instances + Number of instances that you manually add to the scaling group ≤ The value of the Maximum Number of Instances parameter

        Important

        If the total number of instances in the scaling group after you manually add instances is greater than the maximum number of instances that can be contained in the scaling group, or if the expected number of instances in the scaling group after you manually add instances is greater than the maximum number of instances that can be contained in the scaling group, the instances cannot be added to the scaling group.

        Example:

        Before you manually add instances

        After you manually add instances

        Scaling group configurations:

        • Minimum number of instances: 1

        • Maximum number of instances: 6

        • Expected number of instances: 3

        • Total number of instances: 2

        Scaling group configurations after you manually add four instances:

        • Minimum number of instances: 1

        • Maximum number of instances: 6

        • Expected number of instances: 7

        • Total number of instances: 6

    Procedure

    In this example, ECS instances are used to show how to manually add instances to a scaling group. Elastic container instances are added in a similar manner.

    1. Click the Manually Added tab.

    2. Click Add Existing Instances.

    3. In the Add Existing Instance dialog box, select the ECS instances that you want to add and click Add.

      If you select Enable the scaling group to manage the instance lifecycle, Auto Scaling removes the manually added ECS instances from the scaling group and then releases the ECS instances during scale-ins. You can add subscription instances to a scaling group. However, you cannot enable the scaling group to manage their lifecycles.

      Warning

      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 will be stopped or released. For information about status changes of ECS instances in a scaling group due to overdue payments, see Overdue payments.

      instance

      After you manually add instances to the scaling group, you can choose Instances > Manually Added to view information such as the status and health check results of the instances.

    Add managed instances

    You can use Cloud Assistant to register non-Alibaba Cloud instances as Alibaba Cloud-managed instances. After the registration, the non-Alibaba Cloud instances become managed instances and can use multiple online services such as Cloud Assistant, Auto Scaling, CloudOps Orchestration Service, and Apsara Devops provided by Alibaba Cloud. For more information, see Alibaba Cloud managed instances.

    1. Click the Managed Instance tab.

    2. Click Add Instance.

    3. In the Add Instance dialog box, select the managed instances that you want to add and click Add. 托管实例.png

      After you manually add managed instances to the scaling group, you can go to the Managed Instance tab to view information such as the ID, name, status, and addition time of the managed instances.

View instances in a scaling group

You can view the ECS instances, elastic container instances, or managed instances that you manually add to your scaling group.

  1. Log on to the Auto Scaling console.

  2. In the left-side navigation pane, click Scaling Groups.

  3. In the top navigation bar, select the region where Auto Scaling is activated.

  4. Find the desired scaling group and click Details in the Actions column.

  5. In the upper part of the scaling group details page, click the Instances tab.

  6. View the ECS instances, elastic container instances, or managed instances in the scaling group.

    The path to view instances varies based on how the instances are created.

    Automatically created instances

    On the Auto Created tab, you can view the automatically created ECS instances or elastic container instances in the scaling group. If an automatically created ECS instance or elastic container instance is considered unhealthy, Auto Scaling removes the instance from the scaling group and then releases the instance.

    You can manually change the status of an ECS instance or elastic container instance. For example, you can manually put an instance into the Standby or Protected state and move an instance out of the Protected state. You can also manually remove an ECS instance or elastic container instance from the scaling group or release the instance. For more information, see Manually change the status of instances and Manually remove or delete instances.

    Manually added instances

    On the Manually Added tab, you can add manually created ECS instances or elastic container instances to the scaling group. If a manually added ECS instance or elastic container instance is not in the Running state, Auto Scaling considers the instance unhealthy and removes the instance from the scaling group. The management mode of an instance determines whether Auto Scaling releases the instance when the instance is removed from a scaling group.

    • If the lifecycle of the instance is not managed by the scaling group and the instance is manually added, Auto Scaling does not release the instance when the instance is removed from the scaling group.

    • If the lifecycle of the instance is managed by the scaling group and the instance is manually added, Auto Scaling releases the instance when the instance is removed from the scaling group.

    You can manually change the status of an ECS instance or elastic container instance. For example, you can manually put an instance into the Standby or Protected state and move an instance out of the Protected state. You can also manually remove an ECS instance or elastic container instance from the scaling group or release the instance. For more information, see Manually change the status of instances and Manually remove or delete instances.

    Managed instances

    On the Managed Instance tab, you can view the managed instances whose IDs start with mi- in the scaling group of the ECS type. Managed instances do not support lifecycle hooks, association with Server Load Balancer (SLB), and health check.

    After you manually add managed instances to a scaling group, the lifecycles of the added instances are not managed by the scaling group. Therefore, you must manually remove the managed instances that you no longer require from the scaling group. The removed instances are not released.

    Note

    For information about how to use Auto Scaling to scale managed instances, see Use Auto Scaling to manage non-Alibaba Cloud instances and Alibaba Cloud instances.

Manually remove or delete instances

Usage notes

If your scaling group is in the Enabled state and has no ongoing scaling activities, you can manually remove or delete the instances that you no longer require from the scaling group. Before you manually remove or delete instances, take note of the following items:

  • When you manually remove or delete ECS instances or elastic container instances from a scaling group, a scaling activity is triggered. The scaling activity has no cooldown period and can be immediately executed. For more information about the cooldown period feature, see Cooldown period.

  • If the total number of instances in your scaling group is less than the minimum number of instances that must be contained after you remove or delete a specific number of ECS instances or elastic container instances, the specific number of instances cannot be removed or deleted.

  • You can remove managed instances from scaling groups only manually. Managed instances are not released after they are removed from scaling groups.

  • A scaling activity may fail to be executed after it is triggered. You can check the execution result in the details page of the scaling activity. For more information, see View the details of a scaling activity.

Procedure

  1. Log on to the Auto Scaling console.

  2. In the left-side navigation pane, click Scaling Groups.

  3. In the top navigation bar, select the region where Auto Scaling is activated.

  4. Find the scaling group from which you want to delete or remove instances and click Details in the Actions column.

  5. In the upper part of the scaling group details page, click the Instances tab.

  6. Specify the instance source.

    • If you want to delete or remove ECS instances or elastic container instances that are automatically created, click the Auto Created tab.

    • If you want to delete or remove ECS instances or elastic container instances that are manually added, click the Manually Added tab.

    • If you want to delete or remove managed instances, click the Managed Instance tab.

  7. Manually remove or delete instances.

    Action

    Procedure

    Manually remove ECS instances or elastic container instances

    • Remove a single instance: Find the ECS instance or elastic container instance that you want to remove, and choose 更多>Remove from Scaling Group in the Actions column.

    • Remove multiple instances: Select the ECS instances or elastic container instances that you want to remove, and click Remove from Scaling Group in the lower part of the instance list.

    Manually remove managed instances

    • Remove a single instance: Find the managed instance that you want to remove, and click Remove from Scaling Group in the Actions column.

    • Remove multiple instances: Select the managed instances that you want to remove, and click Remove from Scaling Group in the lower part of the managed instance list.

    Manually delete ECS instances or elastic container instances

    • Delete a single instance: Find the ECS instance or elastic container instance that you want to delete and choose 更多 > Delete Instance in the Actions column.

    • Delete multiple instances: Select the ECS instances or elastic container instances that you want to delete and click Delete Instance in the lower part of the instance list.

    Note

    If you delete an ECS instance or elastic container instance, the instance is removed from the scaling group and released. The management mode of an instance that is manually added to a scaling group determines whether you can delete the instance. For more information, see Automatically created instances.

  8. In the dialog box that appears, select Modify Expected Number of Instances and click OK. By default, Modify Expected Number of Instances is selected.

    • If you select Modify Expected Number of Instances, the expected number of instances decreases after you remove a specific number of instances from the scaling group.

    • If you do not select Modify Expected Number of Instances, the expected number of instances does not decrease after you remove a specific number of instances from the scaling group.

    Note

    When you manually remove or delete ECS instances or elastic container instances from a scaling group, you may also need to consider whether to enable Auto Scaling to disassociate the removed instances from the associated Classic Load Balancer (CLB, formerly known as Server Load Balancer or SLB) and ApsaraDB RDS instances of the scaling group. If you enable Auto Scaling to disassociate the removed instances from the CLB and ApsaraDB RDS instances, the instances are removed from the backend vServer groups or default server group of the CLB instances, and the private IP addresses of the instances are removed from the IP address whitelists of the ApsaraDB RDS instances.

References

  • You can manually adjust the status of an instance in a scaling group based on your business requirements. For example, you can manually put an ECS instance into the Stopped state. In this case, Auto Scaling preferentially starts the ECS instance in the Stopped state during a scale-out. For more information, see Manually change the status of instances.

  • You can attach load balancers to your scaling group to distribute incoming traffic across the instances in the scaling group. This improves the performance of your scaling group. For more information, see Attach or detach SLB instances to or from scaling groups.

  • You can also attach ApsaraDB RDS instances to your scaling group. After the attachment is complete, the private IP address of the ECS instances in the scaling group are automatically added to the IP address whitelists of the ApsaraDB RDS instances to enable the internal communication between the ECS instances and the ApsaraDB RDS instances. For more information, see Attach or detach ApsaraDB RDS instances to or from scaling groups.