All Products
Search
Document Center

Auto Scaling:Create an ECS scaling group

Last Updated:Nov 28, 2025

A scaling group is a collection of instances, such as Elastic Compute Service (ECS) or Elastic Container Instance (ECI) instances, for a specific application scenario. This topic describes how to create an ECS scaling group to automatically add or remove ECS instances based on your business needs and policies.

Procedure

Before you begin, decide how you want to create the scaling group. Alibaba Cloud provides multiple methods to create a scaling group. You can use the following instructions to quickly create a scaling group based on your requirements.

Method 1: Create a scaling group from a Launch Template

To create a scaling group from an existing Launch Template, follow these steps.

Important

Before you begin, make sure that you have at least one launch template. For more information about how to create a launch template, see Create a launch template.

  1. Go to the Create Scaling Group page.

    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. On the Scaling Groups page, click Create. The Create Scaling Group page opens.

  2. Click the Create by Form tab and follow the prompts to configure the scaling group.

    This topic describes the required configuration items to quickly create an ECS scaling group from a launch template. For more information about the parameters, see Parameter description.

    Required parameters

    Parameter

    Description

    Scaling Group Name

    Configure the scaling group name as prompted on the page.

    Type

    Select the type of instances for the scaling group. Select ECS.

    Note

    This topic describes only how to create a scaling group of the ECS type. For information about how to create a scaling group of the ECI type, see Create a scaling group of the ECI type.

    Instance Configuration Source

    Auto Scaling uses this configuration to create instances. Select Launch Templates.

    Select Launch Template

    Select an existing Launch Template as prompted. You can also create a new Launch Template as prompted.

    Select Template Version

    Select a version for the template as needed.

    Extend Launch Template

    You can use the Override Instance Type in Launch Templat to specify multiple instance types. If you want to specify weights for instance types, see Create a multi-instance type scaling group using a launch template.

    Minimum Number of Instances

    The minimum number of instances in the scaling group. If the number of instances falls below this limit, Auto Scaling automatically adds instances.

    Maximum Number of Instances

    The maximum number of instances in the scaling group. If the number of instances exceeds this limit, Auto Scaling automatically removes instances.

    Default cooldown (seconds)

    The default cooldown time for the scaling group after a scaling activity. Unit: seconds. Default value: 300. For more information, see Cooldown time.

    VPC

    After you select a VPC, all instances in the scaling group are created in that VPC.

    Warning

    You cannot change the VPC after the scaling group is created.

    vSwitch

    After you select a VPC, you can select vSwitches within that VPC. All instances in your scaling group are created in the selected vSwitches.

    Important

    Select vSwitches in multiple zones. If a single zone has insufficient inventory, scale-out activities may fail. You can change the Scale-out/in Policy to control the distribution of instances across different zones.

  3. Click the Create button to create the scaling group.

Note

After you create a scaling group from a launch template, you can modify the launch template that the scaling group uses. For more information, see Manage launch templates.

Method 2: Create a scaling group based on the configuration of an existing instance

If you want to create a scaling group based on the configuration of an existing instance, perform the following steps.

  1. Go to the Create Scaling Group page.

    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. On the Scaling Groups page, click Create. The Create Scaling Group page opens.

  2. Click the Create by Form tab and configure the parameters for the scaling group.

    This topic describes the required configuration items to quickly create an ECS scaling group based on the configuration of an existing ECS instance. For more information about the parameters, see Parameter description.

    Required parameters

    Parameter

    Description

    Scaling Group Name

    Configure the scaling group name as prompted on the page.

    Type

    Select the type of instances for the scaling group. Select ECS.

    Note

    This topic describes how to create a scaling group of the ECS type. To create a scaling group of the ECI type, see Create a scaling group of the ECI type.

    Instance Configuration Source

    Select Select Existing Instance. The scaling group creates new instances based on the configuration of this instance.

    Select Existing Instance

    Select an existing instance as prompted. Auto Scaling automatically extracts the basic configuration of the instance to create a default scaling configuration.

    Important

    The extracted basic configuration includes the instance type, network, security group, and base image. It does not include the logon password or tags.

    Minimum Number of Instances

    The minimum number of instances in the scaling group. If the number of instances falls below this limit, Auto Scaling automatically adds instances.

    Maximum Number of Instances

    The maximum number of instances in the scaling group. If the number of instances exceeds this limit, Auto Scaling automatically removes instances.

    Default cooldown (seconds)

    The default cooldown time for the scaling group after a scaling activity. Unit: seconds. The default value is 300 seconds. For more information, see Cooldown time.

    VPC

    After you select a VPC, all instances in the scaling group are created in that VPC.

    Note

    The VPC is automatically configured based on your selected instance.

    Warning

    You cannot change the VPC after the scaling group is created.

    vSwitch

    After you select a VPC, you can select vSwitches within that VPC. All instances in your scaling group are created in the selected vSwitches.

    Note

    The vSwitch is automatically configured based on your selected instance. You can also modify or add vSwitches.

    Important

    Select vSwitches in multiple zones. If a single zone has insufficient inventory, scale-out activities may fail. You can change the Scale-out/in Policy to control the distribution of instances across different zones.

  3. Click the Create button to create the scaling group.

Note
  • When you create a scaling group based on an existing ECS instance, a scaling configuration is automatically created for the scaling group. For more information about how to manage the scaling configuration, see Manage scaling configurations.

  • If you want the scaling group to provide services immediately, you must enable it. For more information, see Enable or disable scaling groups.

Method 3: Create a scaling group from scratch

If you want to configure the instance configuration source after the scaling group is created, perform the following steps.

  1. Go to the Create Scaling Group page.

    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. On the Scaling Groups page, click Create. The Create Scaling Group page opens.

  2. Click the Create by Form tab and configure the scaling group by following the prompts.

    This topic describes the required configuration items to quickly create an ECS scaling group from scratch. For more information about the parameters, see Parameter description.

    Required parameters

    Parameter

    Description

    Scaling Group Name

    Configure the scaling group name as prompted on the page.

    Type

    Select the type of instances for the scaling group. Select ECS.

    Note

    This topic describes only how to create a scaling group of the ECS type. For information about how to create a scaling group of the ECI type, see Create a scaling group of the ECI type.

    Instance Configuration Source

    Select Create from Scratch. You can create the scaling group first and then configure the Instance Configuration Source. For more information, see Overview of instance configuration sources.

    Minimum Number of Instances

    The minimum number of instances in the scaling group. If the number of instances falls below this limit, Auto Scaling automatically adds instances.

    Maximum Number of Instances

    The maximum number of instances in the scaling group. If the number of instances exceeds this limit, Auto Scaling automatically removes instances.

    Default cooldown (seconds)

    Specify a default cooldown time for the scaling group after a scaling activity. Unit: seconds. The default value is 300. For more information, see cooldown time.

    VPC

    After you select a VPC, all instances in the scaling group are created in that VPC.

    Warning

    You cannot change the VPC after the scaling group is created.

    vSwitch

    After you select a VPC, you can select vSwitches within that VPC. All instances in your scaling group are created in the selected vSwitches.

    Important

    Select vSwitches in multiple zones. If a single zone has insufficient inventory, scale-out activities may fail. You can change the Scale-out/in Policy to control the distribution of instances across different zones.

  3. Click the Create button to create the scaling group.

Note

After you select Create from Scratch, the scaling group is created. You can then follow the on-screen instructions to immediately create a scaling configuration. You can also create a scaling configuration later or specify a launch template for the scaling group. For more information, see Manage launch templates and Create a scaling configuration (ECS instances).

Parameter description

Basic information

Parameter

Description

Scaling Group Name

The name must be 2 to 64 characters in length. It must start with a letter, digit, or Chinese character. It can contain periods (.), underscores (_), and hyphens (-).

Type

The type of instances that provide computing power in the scaling group. Auto Scaling scales instances of the specified type.

  • ECS: All instances in the scaling group are ECS instances.

  • ECI: All instances in the scaling group are ECI instances.

Instance Configuration Source

Auto Scaling uses this configuration to create instances. The following types of instance configuration sources are supported:

  • Launch Template: contains configuration information such as the key pair, RAM role, instance type, and network settings. It does not contain the password. This parameter is available only when Type is set to ECS.

    If you specify only one instance type, a scale-out may fail due to insufficient inventory. You can configure the Select Launch Template parameter to specify multiple instance types to improve the success rate of scale-out events. For more information, see Create a multi-instance type scaling group using a launch template.

  • Select Existing Instance: You must select an existing instance. Auto Scaling automatically extracts the basic configuration of the instance to create a default scaling configuration.

    Important
    • The scaling configuration extracted from an ECS instance includes basic configurations such as the instance type, network type, security group, and base image. It does not include the logon password or tags. The base image is the one used by the existing instance and does not include data from the instance, such as applications. If you want the scaling configuration to include all system configurations and data from the instance, create a custom image for the instance.

  • Create from Scratch: You can configure an instance configuration source after you create the scaling group. An instance configuration source can be a scaling configuration or a launch template. The specific steps to create a scaling configuration vary based on the scaling group type. For more information, see Create a scaling configuration (ECS instances) and Create a scaling configuration (ECI instances).

Note

When you create a scaling group from an existing instance in the ECS console, Auto Scaling automatically populates the instance configuration source and network type. You do not need to change these settings.

Suspend Process

You can suspend specified processes before you perform certain operations. For example, you can suspend the health check process before you stop an instance to prevent the instance from being marked as unhealthy and automatically removed from the scaling group. The following processes can be suspended:

  • Scale-out: The scaling group rejects all scale-out actions.

  • Scale-in: The scaling group rejects all scale-in actions.

  • Health Check: Suspends marking instances as unhealthy and removing unhealthy instances.

  • Scheduled Task: The associated scaling rule is not triggered when the execution time of a scheduled task is reached.

  • Event-triggered Task: The associated scaling rule is not triggered when an event-triggered task enters the alert state.

For more information, see Suspend and resume scaling group processes.

Deletion Protection

If you enable deletion protection, you cannot delete the scaling group in the Auto Scaling console or by calling an API operation. This prevents accidental deletion of the scaling group.

Instance Health Check

After you enable this feature, Auto Scaling checks the status of instances on a regular basis. If Auto Scaling detects that an instance does not run as expected, Auto Scaling considers the instance unhealthy and removes the instance from the scaling group. For more information, see Instance lifecycles. Valid values:

  • Disable: Disables this feature.

  • Instance Status Check: Performs health checks on the status of instances in the scaling group.

  • Load Balancer Health Check: Performs health checks based on the results from an Application Load Balancer (ALB) or Network Load Balancer (NLB). This option does not support Classic Load Balancer (CLB).

Maximum Life Span of Instance (Seconds)

The maximum amount of time that an instance can remain in the scaling group. If an instance in the scaling group exceeds the maximum lifetime, Auto Scaling automatically creates a new instance to replace it.

Note

This parameter is available only when Scaling Group Type is set to ECS.

Instance count configuration

Parameter

Description

Minimum Number of Instances

If the number of instances falls below this limit, Auto Scaling automatically adds instances until the number of instances in the scaling group equals the limit.

Maximum Number of Instances

If the number of instances in the scaling group exceeds the upper limit, Auto Scaling automatically removes instances from the scaling group until the number of instances is equal to the upper limit. For more information about the instance termination policy, see Set an instance termination policy for a scaling group.

Expected Number of Instances

If you specify an expected number of instances, Auto Scaling automatically maintains that number of instances in the scaling group. For more information, see Expected number of instances.

Scaling settings for instances in the group

Important

You cannot modify the Scaling Policy, Scale-In Policy, or Instance Reclaim Mode for ECI scaling groups. The default configurations are as follows:

  • Scaling Policy: Priority Policy.

  • Scale-In Policy: Removes instances from the Earliest Scaling Configuration. Among them, the Earliest Instances are removed first.

  • Instance Reclaim Mode is set to Release.

Parameter

Description

Scaling Policy

By default, a scaling group scales instances based on the order of the vSwitches that you configure. This is the priority policy. You can change the Scaling Policy to implement other policies. The preset scaling policies provided by Auto Scaling are described below.

Important

You can modify this configuration only when the Scaling Group Type is ECS and the Network Type is Virtual Private Cloud. If the Scaling Group Type is ECI, the default Scaling Policy is the Priority Policy.

  • Priority Policy (Default)

    This policy scales instances based on the order of the vSwitches that you define. If an instance cannot be created in the zone of a vSwitch with a higher priority, Auto Scaling automatically creates an instance in the zone of the vSwitch with the next highest priority.

  • Balanced Distribution Policy

    Use this policy to keep instances in the scaling group evenly distributed across zones after scaling activities. This helps achieve multi-zone disaster recovery. If the number of ECS instances becomes uneven across zones for reasons such as insufficient inventory, you can perform a rebalancing operation to restore the even distribution of ECS instances. For more information, see Rebalance the distribution of ECS instances.

  • Cost Optimization Policy

    Use the Cost Optimization Policy if cost is a high priority. With this policy, during a scale-out event, Auto Scaling attempts to create instances in ascending order of vCPU unit price. If the scaling configuration specifies multiple instance types with a spot instance billing method, spot instances are created first. If spot instances cannot be created for reasons such as inventory shortages, Auto Scaling automatically attempts to create pay-as-you-go instances. During a scale-in event, instances with the highest vCPU unit price are removed first.

  • Custom Combination Policy

    Use this policy to customize how capacity is distributed. You can adjust the ratio of on-demand instances to spot instances in the scaling group, balance capacity across zones, and select instance types.

For information about how to configure a scaling policy, see Configure a scaling policy.

Scale-In Policy

When instances need to be removed from the scaling group, they are first filtered based on the policy. If multiple instances still meet the criteria after filtering, one is randomly removed. This configuration is available only when Scaling Group Type is set to ECS. The following options are available:

  • Instances Created From Earliest Scaling Configuration: Filters for instances that correspond to the scaling configuration with the earliest creation time. Manually added instances are not associated with a scaling configuration or launch template, so they are not selected first. If more instances need to be removed after all associated instances are removed, manually added instances are removed at random.

    Important
    • In this parameter, scaling configuration refers to both scaling configurations and launch templates from the instance configuration source.

    • If it is a launch template, the point in time at which the launch template is applied in the scaling group matters. Example:

      The time associated with this option is related to when the template was set in the scaling group, not the version of the launch template. For example: If you first use version 2 of a launch template in a scaling group and later roll back to version 1, version 2 is considered the earliest scaling configuration.

  • Earliest Instances: Filters for instances with the earliest creation time.

  • Most Recent Instances: Filters for instances with the latest creation time.

  • Custom Policy: A user-defined instance removal policy that filters instances based on the Function Compute service name, version, and function name.

If Scale-In Policy is set to Instances Created From Earliest Scaling Configuration or Custom Policy, multiple instances may meet the criteria. You can set a second-level policy to further filter the instances to be removed. The following second-level policies are available:

  • --No Policy--: No second-level filtering is performed.

  • Earliest Instances: Among the instances filtered in the first level, filters for the one with the earliest creation time.

  • Most Recent Instances: Among the instances filtered in the first level, filters for the one with the latest creation time.

Note

The removal of instances from a scaling group is also affected by its Scaling Policy. For more information, see Configure an instance termination policy for a scaling group.

Instance Reclaim Mode

After an instance is removed, the scaling group reclaims it based on this configuration. The following reclaim modes are available:

  • Release: The removed instance is released, and no resources are retained. During a scale-out, Auto Scaling creates new instances and adds them to the scaling group.

  • Economical Mode: ECS instances that are removed from the scaling group are stopped. You are still charged for some retained resources. During a scale-out, Auto Scaling prioritizes adding these stopped instances back to the scaling group. If the stopped instances are insufficient to meet the demand, Auto Scaling creates new instances. This mode can improve scaling efficiency. For more information, see Use Economical Mode to improve scaling efficiency.

    Important
    • Do not store application data or logs on the instance to avoid the risk of data loss after the instance is reclaimed.

    • Stopped instances may be released:

      • If you manually reduce the maximum number of instances in the scaling group to a value smaller than the total number of instances in all states (including stopped), Auto Scaling prioritizes releasing the stopped ECS instances.

      • A stopped instance may fail to be added to the scaling group due to reasons such as insufficient inventory or overdue payments. If this happens, the instance is released.

    • The functionality of the Stopped Instance Reclaiming Mode is affected by the economical mode for pay-as-you-go instances. For more information, see the "Activation Conditions", "Applicable Resources", and "Triggered Effects" sections in Economical mode.

  • Forcibly Release: In this mode, the system forcibly releases instances that are in the Running (Running) state during a scale-in activity.

    Warning

    Forcibly releasing an instance is like a power-off operation. It erases the data in the memory and ephemeral storage of the instance. This data cannot be recovered. Select this option with caution.

  • Forcibly Recycle: In this mode, the system forcibly stops instances that are in the Running (Running) state during a scale-in activity.

    Warning

    Forcibly stopping an instance is like a power-off operation. It erases the data in the memory and ephemeral storage of the instance. This data cannot be recovered. Select this option with caution.

Network configuration

Important

When Instance Configuration Source is set to Launch Templates or Select Existing Instance, settings such as Network Type, VPC, and vSwitch are automatically populated from the selected source. You can also modify the network settings for the scaling group.

Parameter

Description

VPC

All instances in your scaling group are created in that VPC.

Warning

You cannot change the VPC after the scaling group is created.

vSwitch

After you select a VPC, you can select vSwitches within that VPC. All instances in your scaling group are created in the selected vSwitches.

Important

Select vSwitches in multiple zones. If a single zone has insufficient inventory, scale-out activities may fail. If you are using an ECS scaling group, you can also change the Scaling Policy to control the distribution of instances across different zones.

Associate with other Alibaba Cloud services

Parameter

Description

Associate with ApsaraDB RDS, Redis, or MongoDB

If instances in your scaling group need to access RDS, Redis, or MongoDB databases, you may need to automatically add the internal IP addresses of the ECS or ECI instances to the whitelist of the database instance. You can use this parameter to do this.

Note

Associate CLB Instance

After a scaling group is associated with a CLB instance, instances that are added to the scaling group are automatically added as backend servers to the CLB instance to process forwarded requests.

You can specify the server group to which instances are added. The following two types of server groups are supported:

  • Default server group: This group receives frontend requests. If a listener is not configured with a vServer group or a primary/secondary server group, requests are forwarded to the instances in the default server group.

  • vServer group: Use a vServer group to forward different requests to different backend servers, or to forward requests based on domain names and URLs.

If you specify a default server group and multiple vServer groups, instances are added to all of these server groups at the same time.

Note

You can associate only a limited number of CLB instances and vServer groups with a scaling group. To view your quota or request a quota increase, go to Quota Center.

Associate ALB and NLB Server Groups

After a scaling group is associated with ALB or NLB server groups, instances that are added to the scaling group are automatically added as backend servers to the ALB or NLB server groups to process requests distributed by the ALB or NLB instances. You must also specify the port and weight for the backend servers. The default weight is 50. The higher the weight, the more access requests an instance receives. If the weight is 0, the instance does not receive any access requests.

If you associate a scaling group with multiple ALB or NLB server groups, instances that are added to the scaling group are added to all of these server groups at the same time.

Note

You can associate only a limited number of ALB or NLB server groups with a scaling group. To view the quota or request a quota increase, go to Quota Center.

Other configurations

Parameter

Description

Tag

You can add tags to scaling groups for easy searching and aggregation. For more information, see Tags.

Note

These tags apply to the scaling group. To add tags to instances within the scaling group, you must set the tags in the scaling configuration or launch template.

Tags Propagated to Instances During Scale-out

After you add one or more tags to the scaling group, you can select one or more tags to propagate to the instances within the scaling group during a scale-out activity.

Add Existing Instance

This parameter is available only if Type is set to ECS and Instance Configuration Source is set to Launch Templates or Select Existing Instance.

If you set the expected number of instances and add existing instances at the same time, the expected number of instances automatically increases. For example, if you set the expected number of instances to 1 and add two existing instances when you create a scaling group, the two existing instances are added to the scaling group after it is created, and the expected number of instances changes to 3.

To transfer the lifecycle management of existing instances to the scaling group, select the Enable the scaling group to manage the instance lifecycle check box.

  • If you entrust the lifecycle of an existing instance to the scaling group, the instance is automatically released when it is removed from the scaling group. An instance may be removed because it becomes unhealthy or is manually removed.

  • If you do not entrust the lifecycle of an existing instance to the scaling group, the instance is not released when it is removed from the scaling group.

Note

You can add subscription instances to a scaling group, but you cannot entrust their lifecycle management to the scaling group.

Create Regular Rule

When a scaling activity succeeds, fails, or is rejected, Auto Scaling sends notifications using text messages, internal messages, or emails. For more information, see Configure message notifications.

Resource Group

You can add scaling groups to resource groups to manage them by resource group. This facilitates resource isolation and permission control. For more information, see Use resource groups to manage scaling groups in a fine-grained manner.

Synchronize Alert Rule to CloudMonitor

You can enable or disable this feature only when you create a scaling group. If you enable this feature, the system creates a CloudMonitor application group and associates it with the scaling group. The alert rules of the scaling group are then synchronized to the CloudMonitor console.