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.
-
If you have an existing Launch Templates, you can directly create a scaling group from the Launch Templates. For more information, see Method 1: Create a scaling group from a launch template.
-
If you have an existing instance, you can create a scaling group based on its configuration. For more information, see Method 2: Create a scaling group based on the configuration of an existing instance.
-
If you want to configure the instance configuration source later, you can create a scaling group from scratch. For more information, see Method 3: Create a scaling group from scratch.
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.
|
|
Instance Configuration Source |
Auto Scaling uses this configuration to create instances. A scaling group supports the following sources of instance configuration:
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:
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:
|
|
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
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.
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:
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:
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.
|
Network configuration
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:
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.
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. |