A scaling group is a group of Elastic Compute Service (ECS) instances or elastic container instances that can be used for similar business scenarios. If you have multiple business scenarios, you can create multiple scaling groups. Auto Scaling automatically adjusts the number of instances in the scaling groups based on your configurations to meet your business requirements.

Compare the features of different types of scaling groups

If you set Type to ECS when you create a scaling group, the scaling group contains only ECS instances. If you set Type to ECI when you create a scaling group, the scaling group contains elastic container instances. Different types of scaling groups provide different features. The following table compares the features of scaling groups that contain ECS instances and scaling groups that contain elastic container instances.

Category Feature ECS Elastic Container Instance Documentation API reference
Scaling group Basic configurations Supported Supported Create a scaling group CreateScalingGroup
Health check Supported Supported Health checks on instances in a scaling group
Association with Server Load Balancer (SLB) instances Supported Supported Associate SLB instances with a scaling group or disassociate SLB instances from a scaling group
Association with ApsaraDB RDS instances Supported Not supported Associate ApsaraDB RDS instances with a scaling group or disassociate ApsaraDB RDS instances from a scaling group
Instance configuration source Launch template Supported Not supported Launch templates CreateLaunchTemplate
Scaling configuration Supported Supported
Image update Supported Not supported None
Instance list Automatic creation of instances Supported Supported
Manual addition of instances Supported Supported Manually add instances to a scaling group AttachInstances
Scaling rule and scaling activity Scaling rule Supported Supported Create a scaling rule CreateScalingRule
Scheduled task Supported Supported Create a scheduled task CreateScheduledTask
Event-triggered task Supported Supported Create an event-triggered task CreateAlarm
Scaling activity Supported Supported Overview None
Scaling group monitoring Supported Supported None
Lifecycle hook Supported Supported Create a lifecycle hook CreateLifecycleHook
Notification Supported Supported Create an event notification CreateNotificationConfiguration
Rolling update Supported Supported Use the rolling update feature None

Scaling group status

The following table describes the status of a scaling group.

Status API status Description Documentation API reference
Creating Inactive When the configurations that are required to create a scaling group are not completed, the scaling group is in the Creating state.
Created Inactive After you complete the configurations that are required to create a scaling group, the scaling group is in the Created state. Scaling groups that are in the Created state are not displayed on the Scaling Groups page.
Enabling Inactive When you enable a scaling group that is in the Disabled state, the scaling group enters the Enabling state. Enable a scaling group EnableScalingGroup
Enabled Active After you enable a scaling group, the scaling group enters the Enabled state. You can modify scaling groups that are in the Enabled state.
Disabled Inactive When you create a scaling group, the scaling group is in the Disabled state until you enable it. Scaling groups in the Disabled state are displayed on the Scaling Groups page. Disable a scaling group DisableScalingGroup
Disabled Inactive When you disable a scaling group that is in the Enabled state, the scaling group is in the Disabled state.
Deleting Deleting When you delete a scaling group, the scaling group is in the Deleting state. Delete a scaling group DeleteScalingGroup

Instance configuration source

When you create a scaling group, you must specify an instance configuration source. You can set Instance Configuration Source to Launch Templates, Select Existing Instance, or Create from Scratch. The Select Existing Instance setting takes effect only after a scaling configuration is created. The following table describes the differences between the settings.
Instance configuration source Scenario Difference
Launch Templates The Launch Templates setting takes effect only for scaling groups that contain ECS instances. If your scaling group contains elastic container instances, you cannot select Launch Templates for the Instance Configuration Source parameter.
  • After you create a scaling group, you can directly enable the scaling group.
  • If you want to adjust the configurations of instances in a scaling group, you can modify the default launch template that is used by the scaling group or change the launch template to the latest version. However, you cannot specify multiple instance types in the launch template. If the billing method of the launch template is subscription, Auto Scaling changes subscription to pay-as-you-go.
Select Existing Instance The Select Existing Instance setting takes effect for scaling groups that contain ECS instances and scaling groups that contain elastic container instances.
  • After you create a scaling group, you can directly enable the scaling group.
  • Auto Scaling creates a scaling configuration based on existing instances that you select. The scaling configuration serves as the template that is used to create ECS instances or elastic container instances. The selected instances provide the following information that Auto Scaling uses to create the scaling configuration: the region, zones, images, disks, network settings, and security groups.
  • The scaling configuration that is created by Auto Scaling uses the base image based on which the selected instances are created instead of the new image data that is generated on the selected instances.
Create from Scratch The Create from Scratch setting takes effect for scaling groups that contain ECS instances and scaling groups that contain elastic container instances. After you create a scaling group, you must create a scaling configuration or a launch template to enable the scaling group. The scaling configuration or the launch template can be used to create ECS instances or elastic container instances in the scaling group.

A scaling group can contain only one active scaling configuration source. For example, if you activate another scaling configuration in a scaling group for which an active scaling configuration is applied, the current launch template or the scaling configuration exits the Active state. For more information, see Overview.

Scaling rule and scaling activity

After you create a scaling group, you must create scaling rules to scale instances in the scaling group.

  • Scaling rule: You can create scaling rules to trigger scaling activities in a scaling group or to configure the maximum and minimum numbers of instances in the scaling group. For more information, see Overview.

    Auto Scaling scales ECS instances in a scaling group based on scaling rules and the maximum, minimum, or expected number of ECS instances specified for the scaling group. For example, if you create a scaling rule that can be used to adjust the number of instances in your scaling group to 50 and the maximum number of ECS instances allowed in your scaling group is 45, your scaling group contains only 45 ECS instances after the scaling rule is executed. For more information about the expected number of instances feature, see Expected number of instances.

    You can execute scaling rules by using the following methods:

    • You can manually execute scaling rules.
    • You can use scheduled tasks to execute scaling rules. For more information, see Create a scheduled task.
    • You can use event-triggered tasks to execute scaling rules. For more information, see Overview.
  • Scaling activity: A scaling activity is triggered when a scaling rule is executed or when you manually add or remove ECS instances. For more information, see Overview.

    The following rules apply to scaling activities:

    • An ongoing scaling activity cannot be terminated. For example, if a scaling activity is being executed to create 20 ECS instances but only 5 instances have been created, you cannot terminate the scaling activity.
    • If some ECS instances fail to be added to a scaling group during a scaling activity, Auto Scaling considers that the scaling activity is complete. Auto Scaling rolls back only the ECS instances that fail to be added. For example, if a scaling group contains 20 ECS instances and 19 instances are added as the backend servers of the SLB instance that is associated with the scaling group, only the ECS instance that fails to be added is automatically released.
    • Auto Scaling uses Resource Access Management (RAM) to call ECS API operations to create ECS instances. When ECS instances are rolled back, you must continue to pay for the ECS instances until they are released.
    • Scaling activities are affected by the cooldown time feature. During the cooldown time, Auto Scaling rejects all scaling activities triggered by event-triggered tasks. However, when you manually execute a scaling rule or a scheduled task starts to be executed at the specified point in time, Auto Scaling immediately executes the scaling activity and does not wait for the cooldown time to expire. For more information about the cooldown time feature, see Cooldown time.
    • The cooldown time starts after the last ECS instance or elastic container instance is added to or removed from a scaling group during a scaling activity.