All Products
Search
Document Center

Auto Scaling:Create an ECS scaling group

Last Updated:May 06, 2026

A scaling group is a collection of instances that share the same use case and instance type (such as ECS or ECI instances). This document explains how to create an ECS scaling group, which allows Auto Scaling to automatically add or remove ECS instances based on your policies.

Procedure

Alibaba Cloud offers multiple methods to create scaling groups. This topic helps you create a scaling group that meets your needs.

Method 1: From a Launch Templates

Follow these steps to create a scaling group from an existing Launch Templates.

Important

Before you start, ensure that you have a launch template. For information about how to create a launch template, see Create an instance 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 the Create Scaling Group button to go to the Create Scaling Group page.

  2. Click the Create by Form tab and follow the on-screen instructions to configure the scaling group.

    The following table describes the required parameters. For details on all parameters, see Parameter descriptions.

    Required parameters

    Parameter

    Description

    Scaling Group Name

    Enter a name for the scaling group.

    Type

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

    Note

    This topic describes how to create an ECS scaling group. To create an ECI scaling group, see Create an ECI scaling group.

    Instance Configuration Source

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

    Select Launch Template

    As prompted, select an existing Launch Templates. You can also create a new Launch Templates.

    Select Template Version

    Select a template version based on your requirements.

    Extend Launch Template

    Use Override Instance Type in Launch Template to select multiple instance types. To specify a weight for an instance type, see Use a launch template to configure multiple instance types and improve the success rate of scale-outs.

    Minimum Number of Instances

    The minimum number of instances in the scaling group. If the number of instances drops below this value, Auto Scaling automatically adds instances to the group.

    Maximum Number of Instances

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

    Default Cool-down Time

    The cooldown period in seconds after a scaling activity completes. The default is 300. For more information, see Cooldown period.

    VPC

    All instances in the scaling group are created in the selected VPC.

    Warning

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

    vSwitch

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

    Important

    We recommend that you select vSwitches in multiple availability zones. If an availability zone has insufficient inventory, instance creation may fail. You can change the scaling policy to control the distribution of instances across availability zones in the scaling group.

  3. Click Create.

Note

After creating a scaling group from a launch template, you can change the launch template for the group. For more information, see Manage launch templates.

Method 2: From an existing instance

Follow these steps to create a scaling group based on the configuration of an existing instance.

  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 the Create Scaling Group button to go to the Create Scaling Group page.

  2. Click the Create by Form tab and follow the on-screen instructions to configure the scaling group.

    The following table describes the required parameters. For details on all parameters, see Parameter descriptions.

    Required parameters

    Parameter

    Description

    Scaling Group Name

    Enter a name for the scaling group.

    Type

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

    Note

    This topic describes how to create an ECS scaling group. To create an ECI scaling group, see Create an ECI scaling group.

    Instance Configuration Source

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

    Select Existing Instance

    Select an existing instance. Auto Scaling automatically extracts the basic configurations of the instance and creates a default scaling configuration.

    Important

    The extracted basic configurations include instance type, network, security group, and image, but not logon password or tags.

    Minimum Number of Instances

    The minimum number of instances in the scaling group. If the number of instances drops below this value, Auto Scaling automatically adds instances to the group.

    Maximum Number of Instances

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

    Default Cool-down Time

    The cooldown period in seconds after a scaling activity completes. The default is 300. For more information, see Cooldown period.

    VPC

    All instances in the scaling group are created in the selected VPC.

    Note

    The VPC of the selected instance is automatically used.

    Warning

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

    vSwitch

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

    Note

    The vSwitches of the selected instance are automatically used. You can also modify this selection.

    Important

    We recommend that you select vSwitches in multiple availability zones. If an availability zone has insufficient inventory, instance creation may fail. You can change the scaling policy to control the distribution of instances across availability zones in the scaling group.

  3. Click Create.

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, see Manage scaling configurations.

  • To start scaling immediately, enable the scaling group. For more information, see Enable or disable a scaling group.

Method 3: From scratch

Follow these steps to create a scaling group now and configure its instance source later.

  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 the Create Scaling Group button to go to the Create Scaling Group page.

  2. Click the Create by Form tab and follow the on-screen instructions to configure the scaling group.

    The following table describes the required parameters. For details on all parameters, see Parameter descriptions.

    Required parameters

    Parameter

    Description

    Scaling Group Name

    Enter a name for the scaling group.

    Type

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

    Note

    This topic describes how to create an ECS scaling group. To create an ECI scaling group, see Create an ECI scaling group.

    Instance Configuration Source

    Select Create from Scratch. This allows you to create the scaling group now and configure the Instance Configuration Source later. 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 drops below this value, Auto Scaling automatically adds instances to the group.

    Maximum Number of Instances

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

    Default Cool-down Time

    The cooldown period in seconds after a scaling activity completes. The default is 300. For more information, see Cooldown period.

    VPC

    All instances in the scaling group are created in the selected VPC.

    Warning

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

    vSwitch

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

    Important

    We recommend that you select vSwitches in multiple availability zones. If an availability zone has insufficient inventory, instance creation may fail. You can change the scaling policy to control the distribution of instances across availability zones in the scaling group.

  3. Click Create.

Note

If you select Create from Scratch, you are prompted to create a scaling configuration after the group is created. Alternatively, you can add a scaling configuration or launch template later. For more information, see Manage launch templates and Create a scaling configuration for ECS instances.

Parameters

Basic configuration

Parameter

Description

Scaling Group Name

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

Type

Specifies the type of instances that make up the scaling group. Auto Scaling manages and scales instances of this 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. A scaling group supports the following sources of instance configuration:

  • Launch Templates: Contains configuration information, such as the key pair, RAM role, instance type, and network settings. Passwords are not included. This parameter is available only when Type is set to ECS.

    A single instance type may cause scale-out failures due to insufficient inventory. You can select multiple instance types in the Extend Configurations of Launch Template section to improve the scale-out success rate. For more information, see Use a launch template to configure multiple instance types and improve scale-out success rate.

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

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

  • Create from Scratch: Create instances without using a predefined template. After the scaling group is created, you can create a scaling configuration or specify a launch template. The procedure to create a scaling configuration varies based on the scaling group type. For more information, see Create a scaling configuration (for ECS instances) and Create a scaling configuration (for ECI instances).

Note

When you create a scaling group from an instance in the ECS console, Auto Scaling automatically populates information related to the source of instance configuration and network type. We recommend that you keep the default settings.

Suspend Process

Allows you to suspend specific 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 activities.

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

  • Health Check: Suspends the process of marking instances as unhealthy and removing them.

  • Scheduled Tasks: Prevents associated scaling rules from being triggered when a scheduled task is due.

  • Event-triggered Tasks: Prevents associated scaling rules from being triggered when an alarm-triggered task enters the Alarm state.

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

Deletion Protection

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

Instance Health Check

If you enable health checks, the scaling group periodically checks the running status of instances. If an instance is not in the Running state, Auto Scaling considers it unhealthy and removes it. For more information, see Lifecycle of instances in a scaling group. The following options are supported:

  • Disable: Disables this feature.

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

  • Load Balancer Health Check: This option uses the health check results from an Application Load Balancer (ALB) or a Network Load Balancer (NLB) to determine instance health. (Classic Load Balancer (CLB) is not supported.)

Maximum instance lifetime (seconds)

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

Note

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

Instance quantity

Parameter

Description

Minimum Number of Instances

If the number of instances falls below the minimum size, Auto Scaling adds instances to meet this minimum.

Maximum Number of Instances

If the number of instances exceeds the maximum size, Auto Scaling removes instances to meet this maximum. For more information about instance removal policies, see Configure a removal policy for a scaling group.

Expected Number of Instances

The target number of instances that Auto Scaling maintains in the scaling group. For more information, see Desired capacity.

Scaling and removal policies

Important

For ECI scaling groups, you cannot change the Scaling Policy, Instance Removing Policy, or Instance Reclaim Mode. ECI scaling groups use the following default settings:

  • Scaling Policy: Priority Policy.

  • Instance Removing Policy: First, filter for instances created from the oldest scaling configuration, and then remove the Earliest Instances.

  • Instance Reclaim Mode: Release.

Parameter

Description

Scaling Policy

By default, a scaling group scales instances based on the order of the vSwitches you configure. This behavior is called the priority policy. You can change the Scaling Policy to implement other strategies.

Important

You can modify this setting only when the Type is ECS and the Network Type is VPC. When the Type is ECI, the default Scaling Policy is the Priority.

  • Priority (default policy)

    Scales out or in based on the priority that you define for the vSwitches. During a scale-out event, the system first attempts to create an instance in the zone of the highest-priority vSwitch. If creation fails, the system automatically tries the zone of the next-highest priority vSwitch.

  • Distribution Balancing

    Use this policy to keep instances in your scaling group evenly distributed across multiple zones to help achieve multi-zone disaster recovery. If the number of ECS instances becomes unbalanced across zones for reasons such as insufficient inventory, you can perform a rebalance. For more information, see Rebalance ECS instances.

  • Cost Optimization

    Use the Cost Optimization when cost is a high priority. During a scale-out, this policy attempts to launch instances in ascending order of their vCPU unit price. If the scaling configuration includes multiple instance types that can be created as spot instances, the policy prioritizes these spot instances. If launching spot instances fails for reasons such as insufficient inventory, the policy automatically attempts to create pay-as-you-go instances. During a scale-in, the instance with the highest vCPU unit price is removed first.

  • Custom Combination Policy

    This policy gives you fine-grained control over your capacity distribution. You can use it to adjust the ratio of pay-as-you-go to spot instances, balance capacity across zones, and define the instance type selection strategy.

For configuration instructions, see Configure a scaling policy.

Instance Removing Policy

When instances need to be removed from a scaling group, Auto Scaling first filters instances based on the selected policy. If multiple instances meet the criteria, one is randomly selected for removal. This parameter is supported only when Type is set to ECS. The following options are available:

  • Instances Created From Earliest Scaling Configuration: Prioritizes removing instances created from the oldest scaling configuration. Manually added instances are not associated with a scaling configuration or launch template and are not selected first. If all instances associated with scaling configurations or launch templates have been removed but more instances need to be removed, manually added instances are then randomly removed.

    Important
    • In this context, scaling configuration refers to both scaling configurations and launch templates that are specified as the source of instance configuration.

    • The time associated with this option is related to when the template was configured for the scaling group, not the version of the launch template. For example:

      If a scaling group first uses version 2 of a launch template and is later rolled back to use version 1, version 2 of the launch template is considered the oldest scaling configuration.

  • Earliest Instances: Prioritizes the oldest instance for removal.

  • Most Recent Instances: Prioritizes the newest instance for removal.

  • Custom Policy: Defines a custom removal policy that filters instances based on the service name, version, and function name from Function Compute.

When Instance Removing Policy is set to Instances Created From Earliest Scaling Configuration or Custom Policy, multiple instances may meet the criteria. You can configure a secondary policy to further filter the instances to be removed. The following secondary policies are available:

  • - No Policy -: No secondary filtering is performed.

  • Earliest Instances: From the instances filtered by the primary policy, selects the one that was created earliest.

  • Most Recent Instances: From the instances filtered by the primary policy, selects the one that was created most recently.

Note

The removal of instances is also affected by the Scaling Policy of the scaling group. For more information, see Configure a removal policy for a scaling group.

Instance Reclaim Mode

Defines how Auto Scaling handles an instance after it is removed from the scaling group. The following reclamation modes are available:

Note

This parameter is configurable only when Type is set to ECS and Network Type is set to VPC. For ECI scaling groups, the default reclamation mode is Release.

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

  • Economical Mode: The removed ECS instance is stopped and enters Economical Mode, where some resources are retained and billed. During a scale-out event, Auto Scaling prioritizes adding stopped ECS instances back to the scaling group. New ECS instances are created only if the scale-out quantity is not met. This mode improves scaling efficiency. For more information, see Use Economical Mode to improve scaling efficiency.

    Important
    • Do not store application data or logs on instances to avoid the risk of data loss when instances are reclaimed.

    • Stopped instances may be released in the following cases:

      • If you manually decrease the maximum size of 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 back to the scaling group due to insufficient inventory or an overdue payment. If this occurs, the instance is released.

    • The effectiveness of Economical Mode is influenced by the Economical Mode for pay-as-you-go instances. For more information, see the "Conditions", "Applicable resources", and "Effects" sections of Economical Mode.

  • Force Release: If you select this reclamation mode, the system forcibly releases instances that are in the Running (Running) state during a scale-in event.

    Warning

    Forcibly releasing an instance is equivalent to a power-off operation. It erases temporary data from the instance's memory and storage. Data cannot be recovered. Select this option with caution.

  • Force Economical Mode: If you select this reclamation mode, the system forcibly stops instances that are in the Running (Running) state during a scale-in event.

    Warning

    Forcibly stopping an instance is equivalent to a power-off operation. It erases temporary data from the instance's memory and storage. 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, parameters such as Network Type, VPC, and vSwitch are automatically populated based on the launch template or selected instance. You can also reconfigure the network settings for the scaling group as needed.

Parameter

Description

Network Type

Select a network type for the instances in your scaling group. VPC and Classic Network are supported.

Warning

The Network Type cannot be changed after the scaling group is created.

Important

We recommend that you select VPC. Scaling groups in a VPC support more flexible configurations, such as more flexible scaling policies, instance reclamation modes, and association with Application Load Balancers (ALBs) and Network Load Balancers (NLBs). For more information about VPC, see What is a Virtual Private Cloud (VPC)?.

VPC

This parameter is available when Network Type is set to VPC. After you select a VPC, all instances in your scaling group are created within that VPC.

Warning

The VPC cannot be changed after the scaling group is created.

vSwitch

After you select a VPC, you can select VSwitches that belong to the VPC. All instances in your scaling group are created in the selected VSwitches.

Important

We recommend that you select VSwitches in multiple availability zones. This helps prevent instance creation failures due to insufficient inventory in a single availability zone. If you use an ECS scaling group, you can also change the Scaling Policy to control the distribution of instances across availability zones.

Service integrations

Parameter

Description

Associate with ApsaraDB RDS, Redis, or MongoDB

If your instances need to access RDS, Redis, or MongoDB databases, you can associate the databases here. This automatically adds the internal IP addresses of new instances to the IP whitelist of the associated databases.

Note

Associated CLB Instances (Formerly Known as SLB Instances)

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

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

  • Default server group: Used to receive front-end requests. If no vServer group or primary/secondary server group is configured for the listener, requests are forwarded to the instances in the default server group by default.

  • vServer group: You can use vServer groups if you need to forward different requests to different backend servers, or if you need to forward requests based on domain names and URLs.

If you specify both a default server group and multiple vServer groups, instances are added to all of these server groups simultaneously.

Note

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

Associate with ALB and NLB server groups

Important

This parameter is available only when Network Type is set to VPC.

After a scaling group is associated with ALB or NLB server groups, instances added to the scaling group are automatically added as backend servers to the 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 requests an instance receives. If the weight is 0, the instance does not receive any requests.

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

Note

A scaling group can be associated with a limited number of ALB and NLB server groups. To view your quota or request a quota increase, go to Quota Center.

Other configurations

Parameter

Description

Tag

Add tags to facilitate searching for and organizing scaling groups. For more information, see Tags.

Note

Tags configured here apply to the scaling group. To add tags to instances within the scaling group, set the tags in the scaling configuration or launch template.

Tags Propagated to Instances During Scale-out

Propagates selected scaling group tags to new instances during scale-out events.

Add Existing Instance

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

If you set a desired capacity and add existing instances at the same time, the desired capacity automatically increases. For example, if you set the desired capacity 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 desired capacity then becomes 3.

To let the scaling group manage the lifecycle of existing instances, select the Enable the scaling group to manage the instance lifecycle checkbox.

  • If the scaling group manages the instance lifecycle, an added existing instance is automatically released if it is removed from the scaling group for reasons such as being unhealthy, or if it is manually removed.

  • If the scaling group does not manage the instance lifecycle, an added existing instance is not automatically released when it is removed from the scaling group.

Note

You can add subscription instances to a scaling group, but you cannot let the scaling group manage the lifecycle of subscription instances.

Create Regular Rule

Auto Scaling can send notifications by SMS, internal messages, and email when a scaling activity succeeds, fails, or is rejected. For more information, see Configure notifications.

Resource Group

Select a resource group to organize your scaling group resources. This enables isolated resource views and access control. For more information, see Use resource groups for fine-grained management of scaling groups.

Synchronize Alert Rule to CloudMonitor

This feature can be enabled or disabled only when the scaling group is created. If you enable this feature, the system creates and associates a CloudMonitor application group with the scaling group, and the alarm rules for the scaling group are synchronized to and displayed in the CloudMonitor console.