Auto Scaling adjusts your compute resources based on your policies by modifying the number of instances to meet your service requirements. This helps you manage traffic fluctuations, optimize resource utilization, and reduce costs. For temporary requirements, you can manually execute scaling rules to add or remove ECS instances with a single click.
Scenarios
Scenario description
You have temporary service requirements where the number of required servers and their deployment times are unpredictable. Because no monitoring metrics are available, you must manually adjust the number of servers.
For example, a company needs to add servers for testing to meet a temporary requirement. This requires you to manually control when and how many servers are added or removed.
Solution
Manually execute scaling rules to add or remove servers as needed.
In addition to manually executing scaling rules, you can also adjust the expected number of instances to control the number of instances in the scaling group. For more information, see Expected number of instances.
Benefits of the solution
-
Zero cost for standby servers
Auto Scaling automatically creates and releases ECS instances. This lets you use resources on demand without maintaining standby servers. You need to maintain only the compute resources required for your daily service traffic.
-
Flexible scaling
You can set the configuration for scale-out servers in advance. This lets you scale resources with a single click when needed, which reduces resource and O&M costs.
Prerequisites
-
If you are using Auto Scaling for the first time, you must complete the required RAM authorization.
-
The AliyunServiceRoleForAutoScaling service-linked role has been created. For more information, see Service-linked Role.
-
If you use a Resource Access Management (RAM) user, you must grant the AliyunESSFullAccess permission to the RAM user. For more information, see Manage RAM user permissions.
-
-
When you use Auto Scaling to add instances, you must ensure that the total value of your Alibaba Cloud account balance (cash balance) and cash coupons is at least CNY 100.00.
ImportantIf the total value of your Alibaba Cloud account balance (cash balance) and cash coupons is less than CNY 100.00, you cannot create new pay-as-you-go instances. This will cause Auto Scaling scale-out activities to fail.
Step 1: Create a scaling group
A scaling group is a core component of Auto Scaling. It is a collection of instances that are managed for the same application scenario. Auto Scaling adds or removes instances from this scaling group.
-
Go to the Scaling Groups page.
Log on to the Auto Scaling console.
-
In the navigation pane on the left, click Scaling Groups.
-
In the top navigation bar, select a region.
-
In the upper-left corner of the page, click Create.
-
On the Create by Form tab, configure the scaling group, and then click Create.
The following configurations are used as an example in this topic. Keep the default values for other configuration items. For more information about how to configure a scaling group, see Create a scaling group.
Configuration Item
Example
Description
Scaling Group Name
test
Enter a name for the scaling group. For more information about the format requirements, see the instructions on the interface.
Type
ECS
Select ECS. This indicates that the instances in the scaling group are ECS instances.
Instance Configuration Source
Create from Scratch
Do not specify a template for automatic instance creation yet. After the scaling group is created, you must create a scaling configuration.
Minimum Number of Instances
1
Set the lower limit for the number of instances in the scaling group. If the current number of instances is below this limit, Auto Scaling automatically adds instances to meet the limit.
Maximum Number of Instances
5
Set the upper limit for the number of instances in the scaling group. If the current number of instances exceeds this limit, Auto Scaling automatically removes instances to meet the limit.
VPC
vpc-bp1jmxxau0lur929p****
Select the VPC to which the ECS instances in the scaling group belong.
vSwitch
vsw-2zeknnyw2ewufbs4z****
vsw-2zesy03h8eaf9fe0l****
Select the vSwitches to which the ECS instances in the scaling group belong. We recommend that you select multiple vSwitches to increase the success rate of scale-out events.
Step 2: Create and enable a scaling configuration and enable the scaling group
A scaling configuration is a configuration template for ECS instances that are added during scale-out events. It includes configuration information such as the billing method, specifications, storage, and network. After you create a scaling configuration, you must enable the scaling configuration and then enable the scaling group.
Find the scaling group that you want to manage and open its details page in one of the following ways:
In the Scaling Group Name/ID column, click the ID of the scaling group.
In the Actions column, click Details.
At the top of the page, click the Scaling Configurations tab.
-
On the Scaling Configurations tab, click Create Scaling Configuration.
-
On the Create Scaling Configuration page, configure the parameters and click Create.
The following configurations are used as an example in this topic. Keep the default values for other configuration items. For more information about scaling configurations, see Create a scaling configuration for ECS instances.
Area
Configuration Item
Example
Description
Basic Information
Scaling Configuration Name
test
Enter a name for the scaling configuration. For more information about the format requirements, see the instructions on the interface.
Billing Method
Pay-As-You-Go
The Auto Scaling service is free of charge, but you are charged for the ECS instances that are added during scale-out events. This topic uses the pay-as-you-go billing method as an example. For more information, see Billing overview.
Instance and Image
Instance Configuration Mode
Specify Instance Properties
Select Specify Instance Properties to configure the specifications of the ECS instances.
Instance Attribute Combination
2 vCPUs, 4 GiB memory, Enterprise-level
Set the vCPU and memory requirements for the ECS instances.
Select Image
Public Image Alibaba Cloud Linux 3.2104 LTS 64-bit
Select the image to deploy the ECS instances. This topic uses a public image as an example. In a real-world scenario, use a custom image where your applications are deployed.
Storage
System Disk
Enterprise SSD, 40 GiB, PL0
Select a system disk for the ECS instances.
Network and Security Group
Public IP Address
Select Assign Public IPv4 Address. The default billing method is pay-by-bandwidth, and the default bandwidth value is 1 Mbit/s.
Select whether to assign a public IP address to the ECS instances as needed. You are charged for the actual outbound public bandwidth used. The bandwidth fees are included in the ECS instance bills.
Security Group
sg-bp18kz60mefsicfg****
Select a security group that you created in advance. To create a security group, see Create a security group.
Management Settings
Logon Credentials
Set After Creation
After the ECS instances are created, manually set passwords for them.
-
In the Scaling Configuration Preview dialog box that appears, confirm the configuration information and click Create Order.
-
In the The scaling configuration is created. dialog box that appears, click Enable.
-
In the Apply Scaling Configuration dialog box that appears, click OK.
NoteYou must enable one scaling configuration within a scaling group. After you enable a scaling configuration, its status changes to Active.
-
In the Enable Scaling Group dialog box that appears, click OK.
After you enable the scaling group, Auto Scaling performs scale-out and scale-in activities based on your configuration.
In this example, the minimum number of instances in the scaling group is 1. Therefore, after the scaling group is enabled, an ECS instance is automatically created based on the scaling configuration. On the details page of the scaling group, click the Instances tab and then the Auto Created tab to view the instance information.

Step 3: Create a scaling rule
A scaling rule specifies the details of a scaling activity, such as the number of ECS instances to add or remove.
-
On the scaling group details page, click the Scaling Rules and Event-triggered Tasks tab, and then click the Scaling Rules tab.
-
Click Create Scaling Rule, configure the scaling rule, and then click OK.
This example uses a simple rule. For more information about how to configure scaling rules, see Configure a scaling rule.
Configuration Item
Description
Rule Name
Enter a name for the rule. For more information about the format requirements, see the instructions on the interface.
Rule Type
This example uses a simple rule. For more information about scaling rules, see Overview of scaling rules.
Operation
Set the number of instances to add or remove when the rule is executed. A maximum of 1,000 instances can be scaled in a single scaling activity.
Cooldown Time
Optional. Unit: seconds. If you do not specify this parameter, the cooldown time of the scaling group is used. For more information, see Cooldown time.
Repeat this step to create a scale-out rule and a scale-in rule. The following table provides example configurations.
Scaling Rule
Example Configuration
Scale-out rule
-
Rule Name: add
-
Rule Type: Simple Rule
-
Operation: Add 1 instance
Scale-in rule
-
Rule Name: remove
-
Rule Type: Simple Rule
-
Operation: Remove 1 instance
-
Step 4: Manually execute the scaling rule to scale ECS instances
You can manually execute a scaling rule as needed. The system then automatically creates or releases ECS instances based on the rule to adjust the number of instances in the scaling group.
-
On the scaling group details page, click the Scaling Rules and Event-triggered Tasks tab, and then click the Scaling Rules tab.
-
Find the rule that you want to execute, click Recurrently in the Actions column, and then confirm the execution.
The following operations are used for validation in this example:
-
Execute the scale-out rule and confirm that an ECS instance is automatically added to the scaling group.

-
Execute the scale-in rule and confirm that an ECS instance is automatically removed from the scaling group.

-