You must create a scaling group before using Auto Scaling to reallocate resources.
A scaling group is a collection of ECS instances that are applied to the same scenario. You can set scaling group parameters, such as the maximum and minimum number of instances and cooldown time. You can also associate the ECS instances with SLB instances and RDS instances for easy management.
For information about using launch templates to create scaling groups, see Use launch templates to create scaling groups.
- Log on to the Auto Scaling console.
- On the Scaling Groups page, click Create Scaling Group.
- Configure the scaling group.
- Enter a name in the Scaling Group Name field.
- Enter a number in the Maximum Instances field.
Note When the number of ECS instances exceeds the upper limit, Auto Scaling automatically removes instances to make the number of instances in the scaling group match the upper limit.
- Enter a number in the Minimum Instances field.
Note When the number of ECS instances drops below the lower limit, Auto Scaling automatically adds instances to make the number of instances in the scaling group match the lower limit.
- Enter a number in the Default Cooldown Time (Seconds) field.
Note This parameter specifies the cooldown time of a scaling activity. For more information, see Cool-down time.
- Specify the Removal Policy .
Note This parameter specifies the policy for removing ECS instances when the number of instances in the scaling group exceeds the upper limit. For more information, see Removal policies.
- Select an Instance Configuration Source. This example uses Custom Scaling Configuration.
- Select a Network Type. You must set the following parameters if you select VPC:
- Specify a VPC ID and a VSwitch.
- Specify the Multi-Zone Scaling Policy. For more information, see Multi-zone scaling policy.
- Specify the Reclaim Mode. For more information, see Reclaim mode.
- (Optional) Click SLB Instances to associate the scaling group with SLB instances.
Note A scaling group can be associated with up to five SLB instances at the same time. You can also select the default server group or VServer group(s) of a SLB instance for the scaling group. You can select up to five VServer groups for a scaling group at the same time. For more information, see Use Server Load Balancer (SLB) in Auto Scaling.
- (Optional) Add RDS Instances. Currently, only RDS databases are supported.
Note You can only add RDS instances in the region where the scaling group is created. Auto Scaling automatically adds the internal IP addresses of the newly created ECS instances to the whitelist of the RDS instances to allow communication between the ECS and RDS instances.
- Click OK.
- Click Create Now to create an ECS instance template that is used to create new ECS instances.
Note For more information about scaling configurations, see Create a scaling configuration.
- In the Apply Scaling Configuration dialog box that appears, click Confirm.
Multi-zone scaling policy
|Priority||Scales out ECS instances based on the specified VSwitch. This policy allows Auto Scaling to use a secondary VSwitch to create ECS instances when the primary VSwitch cannot create ECS instance in its region.|
|Distribution balancing||Evenly distributes ECS instances in the specified zones when multiple VSwitches are specified. You can reallocate ECS instances to make them evenly distributed when the ECS instances are unevenly distributed in the zone due to certain issues such as insufficient ECS resources.
Note This policy only takes effect when you have specified multiple VSwitches.
|Cost optimization||This policy has the following benefits when the network type of the scaling group is VPC:
|Release Mode||Automatically releases ECS instances based on your scheduled tasks or event-triggered tasks during a scale in event.
Creates new ECS instances and adds them to the scaling group based on your scheduled tasks or event-triggered tasks during a scale out event.
|Shutdown and Reclaim Mode||Increases scaling efficiency: