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.

Features of scaling groups

If you set the Type parameter to ECS when you create a scaling group, the scaling group contains ECS instances. If you set the Type parameter 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 describes the features of scaling groups that contain ECS instances and scaling groups that contain elastic container instances.

ItemFeatureECSElastic Container InstanceUser guideAPI references
Scaling groupBasic configurationsSupportedManage scaling groupsCreateScalingGroup
Health checkSupportedHealth checks on instances in a scaling group
Association with Server Load Balancer (SLB) instancesSupportedAssociate or disassociate SLB instances with or from a scaling group
Association with ApsaraDB RDS instancesSupportedAssociate ApsaraDB RDS instances with a scaling group or disassociate ApsaraDB RDS instances from a scaling group
Instance configuration sourceLaunch templateSupportedNot supportedOverviewCreateLaunchTemplate
Scaling configurationSupported
Image updateSupportedNot supportedNone
Instance listAutomatic creation of instancesSupported
Manual addition of instancesSupportedManually manage instances in a scaling groupAttachInstances
Scaling rule and scaling activityScaling ruleSupportedManage scaling rulesCreateScalingRule
Scheduled taskSupportedCreate a scheduled taskCreateScheduledTask
Event-triggered taskSupportedManage event-triggered tasksCreateAlarm
Scaling activitySupportedOverviewNone
Scaling group monitoringSupportedNone
Lifecycle hookSupportedManage lifecycle hooksCreateLifecycleHook
Notification ruleSupportedCreate an advanced notification ruleCreateNotificationConfiguration
Rolling updateSupportedRolling updateNone
Health diagnosisSupportedHealth diagnosisNone

Scaling group status

The following table describes the different statuses of a scaling group.

StatusAPI statusDescriptionUser guideAPI references
Creating/CreatedInactive
  • When you create a scaling group, the scaling group remains in the Creating state until you complete the required configurations.
  • After you complete the required configurations, the scaling group enters the Created state. Scaling groups that are in the Created state are not displayed on the Scaling Groups page.
EnablingInactiveIf you enable a scaling group that is in the Disabled state, the scaling group enters the Enabling state. Enable a scaling groupEnableScalingGroup
EnabledActiveAfter you enable a scaling group, the scaling group enters the Enabled state. You can modify scaling groups that are in the Enabled state.
Disabling/DisabledInactive
  • After you create a scaling group, the scaling group remains in the Disabled state until you enable the scaling group. Scaling groups in the Disabling or Disabled state are displayed on the Scaling Groups page.
  • After you disable a scaling group that is in the Enabled state, the scaling group enters the Disabled state.
Disable a scaling groupDisableScalingGroup
DeletingDeletingIf you delete a scaling group, the scaling group enters the Deleting state. Delete a scaling groupDeleteScalingGroup

Instance configuration source

When you create a scaling group, you must specify an instance configuration source. You can set the Instance Configuration Source parameter to Launch Templates, Select Existing Instance, or Create from Scratch. The Select Existing Instance setting takes effect only after you create a scaling configuration. The following table describes the differences between the settings.
Instance configuration sourceScenarioDifference
Launch TemplatesThe Launch Templates setting takes effect only for scaling groups that contain ECS instances. If your scaling group contains elastic container instances, you cannot set the Instance Configuration Source parameter to Launch Templates.
  • After you create a scaling group, you can enable the scaling group.
  • If you want to modify the configurations of instances in a scaling group, you can modify the default launch template that is used by the scaling group or update the launch template to the latest version. You cannot specify multiple instance types in the launch template. If the launch template uses the subscription billing method, Auto Scaling changes the billing method to pay-as-you-go.
Select Existing InstanceThe 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 enable the scaling group.
  • Auto Scaling creates a scaling configuration based on the existing instance that you select. The scaling configuration serves as the template that is used to create ECS instances or elastic container instances. The selected instance provides the following information that Auto Scaling can use to create a scaling configuration: region, zones, images, disks, network settings, and security groups.
  • The scaling configuration that is created by Auto Scaling uses the base image data based on which the selected instance is created.
Set the value to 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. Then, you can use the scaling configuration or the launch template 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 a new scaling configuration in a scaling group for which an active scaling configuration or launch template is already specified, the current launch template or scaling configuration leaves the Active state. For more information, see Overview.

Scaling rules and activities

After you create a scaling group, you must create scaling rules to add instances to or remove instances from the scaling group.

  • Scaling rules: You can create scaling rules to trigger scaling activities in a scaling group or 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 that is specified for the scaling group. For example, if you create a scaling rule that adjusts the number of instances in your scaling group to 50 and the maximum number of ECS instances that are allowed in your scaling group is 45, your scaling group contains only 45 ECS instances after the scaling rule is executed. For information about the Expected Number of Instances feature, see Expected number of instances.

    You can use one of the following methods to execute scaling rules:

    • Manually execute scaling rules.
    • Use scheduled tasks to execute scaling rules. For more information, see Create a scheduled task.
    • Use event-triggered tasks to execute scaling rules. For more information, see Overview.
  • Scaling activities: 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:

    • You cannot terminate an ongoing scaling activity. For example, if a scaling activity is being executed to create 20 ECS instances and only five instances have been created, you cannot terminate the scaling activity.
    • If several ECS instances fail to be added to a scaling group during a scaling activity, Auto Scaling determines that the scaling activity is complete. Auto Scaling rolls back only the ECS instances that fail to be added to the scaling group. For example, if a scaling group contains 20 ECS instances and 19 instances are added as backend servers of the SLB instance that is associated with the scaling group, only the ECS instance that fails to be added is rolled back and automatically released.
    • Auto Scaling uses Resource Access Management (RAM) to call ECS API operations to create ECS instances. After ECS instances are rolled back, you are still charged for the ECS instances until the ECS instances are released.
    • Scaling activities are affected by the cooldown period. During the cooldown period, Auto Scaling rejects all scaling activities that are triggered by event-triggered tasks. When you manually execute a scaling rule or Auto Scaling executes a scheduled task at a specified point in time, a scaling activity can be triggered even before the cooldown period ends. For more information about the cooldown period feature, see Cooldown time.
    • The cooldown period starts after the last ECS instance or elastic container instance is added to or removed from a scaling group during a scaling activity.

    Remarks

    If your scaling group is associated with SLB instances or ApsaraDB RDS instances, take note of the following items when scaling activities are triggered in the scaling group:
    ItemDescription
    Your scaling group is associated with SLB instances or server groups.
    • If an associated SLB instance or server group is deleted or does not exist, scaling activities in the scaling group fail.
    • Auto Scaling regularly checks whether the scaling group has associated SLB instances or server groups. If Auto Scaling detects that an associated SLB instance or server group is deleted or does not exist, Auto Scaling disassociates the SLB instance or the server group from the scaling group.
      Important In this case, the disassociated SLB instance or server group cannot cause scaling failures in the scaling group.
    Your scaling group is associated with ApsaraDB RDS instances.
    • If an associated ApsaraDB RDS instance is deleted or does not exist, scaling activities in the scaling group fail.
    • Auto Scaling regularly checks whether the scaling group has associated ApsaraDB RDS instances. If Auto Scaling detects that an associated ApsaraDB RDS instance is deleted or does not exist, Auto Scaling disassociates the ApsaraDB RDS instance from the scaling group.
      Important In this case, the disassociated ApsaraDB RDS instance cannot cause scaling failures in the scaling group.