You can manually add existing Elastic Compute Service (ECS) instances or elastic container instances to scaling groups to utilize existing computing resources. You can also manually remove or delete ECS instances or elastic container instances that you no longer require from scaling groups to reduce costs on resources. You can adjust the number of instances based on your business requirements. This topic describes how to create, view, remove, or delete instances.

Prerequisites

The following table describes the requirements that must be met before you manually add ECS instances or elastic container instances to a scaling group.
Item Requirement
ECS instances or elastic container instances to be added to the scaling group
  • The instances reside in the same region as the scaling group.
  • 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). Take note of the following limits:
    • 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.
Scaling group
  • The scaling group is in the Enabled state.
  • The scaling group does not have ongoing scaling activities.

Manually add instances to a scaling group

In this example, ECS instances are used to show how to manually add instances to a scaling group. You can also use this procedure to manually add elastic container instances to a scaling group.

  • The active scaling configuration of a scaling group does not affect whether ECS instances or elastic container instances can be manually added to the scaling group. You can manually add ECS instances or elastic container instances without the need to wait for the cooldown time to end. For more information about the cooldown time feature, see Cooldown time.
  • Auto Scaling creates ECS instances or elastic container instances based on your configurations. However, if the instance inventory is insufficient or the sum of the numbers of the instances that you want to add and the existing instances in the scaling group exceeds the maximum number of instances that is allowed for the scaling group, the number of actually added instances may be less than the value that you specified. In these cases, check the configuration of the scaling group to troubleshoot the issue. If the issue persists, submit a ticket.
  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 a region.
  4. Find a scaling group and go to the details page of the scaling group. You can use one of the following methods to go to the details page:
    • Click the ID of the scaling group in the Scaling Group Name/ID column.
    • Click Details in the Actions column of the scaling group.
  5. In the upper part of the page, click the Instances tab.
  6. Click the Manually Added tab.
  7. Click Add Existing Instance.
  8. In the Add Existing Instance dialog box, select ECS instances in the left-side list, click the Move icon icon to add the selected ECS instances to the right-side list, and then click Add.
    If you select Enable the scaling group to manage the instance lifecycle, ECS instances that are manually added to the scaling group are removed and released during scale-in activities. You can manually add subscription instances to a scaling group. However, the lifecycles of the instances cannot be managed by the scaling group.
    Warning Make sure that you have sufficient balance in your account. If you have overdue payments in your account, pay-as-you-go and preemptible instances are 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 the ECS instances, you can view the added ECS instances and the information about the instances on the Manually Added tab.

View instances

You can view the ECS instances or elastic container instances that are manually added to a 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 a region.
  4. Find the scaling group whose instances you want to view and click Details in the Actions column.
  5. In the upper part of the page, click the Instances tab.
  6. View the ECS instances or elastic container instances in the scaling group.
    You can change the status of the instances that are manually added or automatically created. For example, you can manually put an instance into the Standby state or the Protected state, or move an instance out of the Protected state. You can also remove instances from your scaling group or release instances. For more information, see Put an ECS instance into the Standby state and Manually remove or delete instances.
    • On the Auto Created tab, you can view the ECS instances or elastic container instances that are automatically created in the scaling group. If Auto Scaling considers an ECS instance or elastic container instance unhealthy, the unhealthy instance is automatically removed from the scaling group and released.
    • On the Manually Added tab, you can manually add existing 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.

Manually remove or delete instances

If your scaling group is in the Enabled state and has no ongoing scaling activities, you can manually remove or delete ECS instances or elastic container instances that you no longer require from the scaling group.

  • You can manually remove ECS instances or elastic container instances from a scaling group without the need to wait for the cooldown time to end.
  • If the number of instances in the scaling group is less than the specified minimum number after you manually remove the ECS instances or elastic container instances, the removal fails.
  • A scaling activity may fail to be executed after it is triggered. You can check the execution result on the details page of the scaling activity. For more information, see View the details of a scaling activity.
  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 a region.
  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 page, click the Instances tab.
  6. Click the Auto Created tab or the Manually Added tab.
    • 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.
  7. Manually remove or delete instances.

    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. If the lifecycle of the instance is not managed by the scaling group, you can only remove the instance from the scaling group but cannot delete the instance. If the lifecycle of the instance is managed by the scaling group, you can remove the instance from the scaling group and delete the instance.

    Action Procedure
    Manually remove instances
    • To remove a single instance, find the ECS instance or elastic container instance that you want to remove from the scaling group and choose More icon > Remove from Scaling Group in the Actions column.
    • To remove multiple instances at the same time, select multiple ECS instances or elastic container instances that you want to remove from the scaling group and click Remove from Scaling Group at the bottom of the page.
    Manually delete instances
    • To delete a single instance, find the ECS instance or elastic container instance that you want to delete and choose More icon > Delete Instance in the Actions column.
    • To delete multiple instances, select multiple ECS instances or elastic container instances that you want to delete and click Delete Instance at the bottom of the page.
  8. Specify whether to automatically disassociate the ECS instances or elastic container instances from the associated Server Load Balancer (SLB) instance and ApsaraDB RDS instance, and click OK.
    Note When you delete ECS instances, you must specify whether to disassociate the ECS instances from the associated Server Load Balancer (SLB) instances and ApsaraDB RDS instances. When you delete elastic container instances, you need to only specify whether to disassociate the elastic container instances from the associated SLB instances.