Help Center/ Auto Scaling/ Best Practices/ Configuring Scaling Policies and Multiple Flavors to Reduce Costs
Updated on 2025-07-16 GMT+08:00

Configuring Scaling Policies and Multiple Flavors to Reduce Costs

  • When creating an AS group, you can configure a multi-AZ scaling policy. If resources in an AZ are insufficient or the AZ is faulty, Auto Scaling can schedule resources from other AZs to ensure high service availability.
  • When creating an AS configuration, you can select multiple flavors to prevent scaling action failures due to insufficient inventory of a single flavor.
    • Scaling Policy

    You can specify multiple flavors when creating an AS configuration. If the inventory of an individual flavor in an AZ is insufficient, Auto Scaling automatically attempts to create instances in other AZs to ensure that scaling actions can be executed. You can configure scaling policies (such as the cost-centered policy) based on service deployment to meet service requirements. If a scaling group uses the cost-centered policy, Auto Scaling attempts to create ECSs in ascending order of the flavor unit price.

    • Multiple Flavors

    You can select multiple flavors and set Flavor selection policy to Cost-centered in a scaling configuration. During AS group expansion, the flavor with the minimum cost comes first. When creating an ECS in an AS group, the system selects the flavor with the minimum cost. If the ECS cannot be created, the system selects one with the minimum cost from the remained flavors, and so on. Multiple flavors can effectively handle the insufficient inventory issue of a single flavor and ensure that scaling actions can be executed. For example, during peak hours, you may need to quickly obtain ECSs with different flavors to carry service traffic and deliver high performance, rather than focusing on one specific flavor. In this case, multiple flavors can flexibly meet the requirements.

This section describes how to configure multi-AZ scaling, multiple flavors, and cost-centered policies to effectively improve the scaling success rate and reduce costs.

Prerequisites

You have created a VPC with a subnet. For details, see Creating a VPC with a Subnet.

Procedure

  1. Create an AS configuration.
    1. Log in to the Huawei Cloud management console.
    2. On the console, choose Compute > Auto Scaling > Instance Scaling.
    3. Click Create AS Configuration and configure parameters as instructed.

      This section uses the following parameters as an example. Retain the default values for the parameters that are not listed. For details, see Using a New Specifications Template to Create an AS Configuration.

      Table 1 Parameters for configuring the AS configuration

      Parameter

      Example Value

      Description

      Name

      as-config-test

      Enter a name for the AS configuration.

      Billing Mode

      Pay-per-use

      You are billed for how long you use each ECS. You can create or delete such an ECS at any time.

      Flavor

      s3.small.1, s3.medium.2, s3.large.2 (The price per unit of each flavor increases in ascending order.)

      A maximum of 10 flavors can be selected.

      You are advised to select several similar flavors based on the vCPU, memory, bandwidth, or the maximum number of packets that an ECS can transmit and receive per second.

      Flavor selection policy

      Cost-centered

      When creating an instance in an AS group, the system selects the flavor with the minimum cost. If the instance cannot be created, the system selects one with the minimum cost from the remained flavors, and so on.

      Image

      test

      Select an image used to deploy ECSs.

      You are advised to select the custom image where you have deployed your applications.

      System Disk

      General Purpose SSD, 100 GiB

      Select a system disk for ECSs based on service requirements.

      Security Group

      sg-bp18kz60mefsicfg****

      Select the security group you have created. For details about how to create a security group, see Creating a Security Group.

    4. Click Create Now.
  2. Create an AS group.
    1. On the Instance Scaling page, click Create AS Group.
    2. Configure parameters as instructed.

      This section uses the following parameters as an example. Retain the default values for the parameters that are not listed. For details, see Creating an AS Group.

      Table 2 Parameters for configuring the AS group

      Parameter

      Example Value

      Description

      Name

      test

      Enter the AS group name as instructed.

      AZ

      AZ1, AZ2, AZ3

      Select the AZs where ECSs will be deployed.

      Multi-AZ Scaling Policy

      Balanced

      Balanced: When an ECS is added for capacity expansion, the target AZ is determined for the balanced number of ECSs in each AZ. If the attempt fails, the target AZ is determined in the order in which they were selected.

      Min. Instances

      0

      Set the minimum number of instances in an AS group. If the number of instances in an AS group is less than the minimum number, the AS group will automatically add instances until the number of instances reaches the minimum number.

      Max. Instances

      120

      Set the maximum number of instances in an AS group. If the number of instances in an AS group exceeds the maximum number, the AS group will automatically remove instances until the number of instances reaches the maximum number.

      Expected Instances

      0

      Specifies the expected number of ECSs in the AS group. After the creation, you can change this value. However, changing this value will trigger a scaling action. The value cannot be less than the number of minimum instances or greater than the number of maximum instances.

      AS Configuration

      as-config-test

      Select the AS configuration you created for the AS group.

      VPC

      Vpc-test

      All ECSs in the AS group are deployed in this VPC.

      Subnet

      Subnet-test

      A maximum of five subnets can be selected. The AS group automatically attach all NICs to the created ECSs. By default, the first subnet you select is used as the primary NIC of the ECS, and other subnets are used as the extension NICs.

      Health Check Method

      ECS health check

      Checks the ECS running status. If an ECS is stopped or deleted, it is considered to be unhealthy.

      Health Check Interval

      5 minutes

      Specifies the health check interval of the AS group. You can set a health check interval, such as 10 seconds, 1 minute, 5 minutes, 15 minutes, 1 hour, or 3 hours, based on service requirements.

    3. After setting the parameters, click Create Now.
    4. Return to the AS group list. The AS group is successfully created if its status is Enabled.
  3. Configure an AS policy to trigger a capacity expansion action. For details, see Creating an AS Policy.

Verification

  • Expected result: When the scaling action is triggered, the AS group preferentially creates an ECS using s3.small.1. If the ECS cannot be created in AZ 1, AZ 2, and AZ 3, the AS group attempts the flavor s3.medium.2 and then s3.large.2 in sequence.
  • Verification: After the capacity expansion action is triggered, an ECS is added to the AS group. On the Instances tab, click the name of the added ECS. On the ECS details page, view the ECS flavor. If the ECS flavor is s3.small.1, the AS policy is in effect. The multi-AZ scaling and cost-centered policies configured for the AS group can significantly reduce costs.