Updated on 2022-02-22 GMT+08:00

Creating an AS Group

Scenarios

An AS group consists of a collection of instances and AS policies that have similar attributes and apply to the same application scenario. An AS group is the basis for enabling or disabling AS policies and performing scaling actions. The pre-configured AS policy automatically adds or deletes instances to or from an AS group, or maintains a fixed number of instances in an AS group.

When creating an AS group, specify an AS configuration for it. Additionally, add one or more AS policies for the AS group.

Creating an AS group involves the configuration of the maximum, minimum, and expected numbers of instances and the associated load balancer.

Notes

ECS types supported by different AZs may vary. When creating an AS group, you must choose a proper AS configuration according to the ECS type supported by the AZs used by the AS group.

  • If the ECS type specified in the AS configuration is supported by none of the AZs used by the AS group, the following situations will occur:
    • If the AS group is disabled, it cannot be enabled.
    • If the AS group is enabled, its status will become abnormal when instances are added to it.
  • If the ECS type specified in the AS configuration is supported only by certain AZs used by the AS group, the ECSs added by a scaling action are distributed only in the AZs supporting the ECS type. As a result, the instances in the AS group may not be evenly distributed.

Procedure

  1. Log in to the management console.
  2. Under Computing, click Auto Scaling. In the navigation pane on the left, choose Instance Scaling.
  3. Click Create AS Group.
  4. Set parameters, such as Name, Max. Instances, Min. Instances, and Expected Instances. Table 1 describes the key parameters to be configured.
    Table 1 AS group parameters

    Parameter

    Description

    Example Value

    Region

    A region is where an AS group resides.

    N/A

    AZ

    An AZ is a physical region where resources use independent power supply and networks. AZs are physically isolated but interconnected through an internal network.

    N/A

    Multi-AZ Extension Policy

    This parameter can be set to Load-balanced or Sequenced.

    • Load-balanced: When expanding ECSs in an AS group, the system preferentially distributes ECSs evenly among AZs used by the AS group. If it fails in the target AZ, it automatically selects another AZ based on the sequenced policy.
    • Sequenced: When expanding ECSs in an AS group, the system selects the target AZ based on the order in which AZs are selected.
      NOTE:

      This parameter needs to be configured when two or more AZs are selected.

    Load-balanced

    Name

    Specifies the name of the AS group to be created.

    The name contains 1 to 64 characters and consists of only letters, digits, underscores (_), and hyphens (-).

    N/A

    Max. Instances or Min. Instances

    Specifies the maximum or minimum number of ECSs in an AS group.

    1

    Expected Instances

    Specifies the expected number of ECSs in an AS group.

    After an AS group is created, you can change this value, which will trigger a scaling action.

    0

    AS configuration

    Specifies the required AS configuration for the AS group. An AS configuration defines the specifications of the ECSs to be added to an AS group. The specifications include the ECS image and system disk size. You need to create the required AS configuration before creating an AS group.

    N/A

    VPC

    Provides a network for your ECSs.

    All ECSs in an AS group belong to the same VPC.

    N/A

    Subnet

    You can select a maximum of five subnets. The AS group automatically binds all NICs to the created ECSs. The first subnet is used by the primary NIC of the ECS by default, and other subnets are used by extension NICs of the ECS.

    N/A

    Load Balancing

    This parameter is optional. A load balancer automatically distributes access traffic to all instances in an AS group to balance their service load. It enables higher levels of fault tolerance in your applications and expands application service capabilities.

    NOTE:
    • Up to six load balancers can be added to an AS group.
    • After multiple load balancers are added to an AS group, multiple services can be concurrently listened to, thereby improving service scalability. If ELB health check is selected for Health Check Method, when any one of the listeners detects that an instance becomes faulty, AS will replace the faulty instance with a functional one.

    -

    Instance Removal Policy

    Specifies the priority for removing instances from an AS group. If specified conditions are met, scaling actions are triggered to remove instances. AS supports the following instance removal policies:

    • Oldest instance created from oldest AS configuration: The oldest instance created based on the oldest configuration is removed from the AS group first.
    • Newest instance created from oldest AS configuration: The latest instance created based on the oldest configuration is removed from the AS group first.
    • Oldest instance: The oldest instance is removed from the AS group first.
    • Newest instance: The latest instance is removed from the AS group first.
    NOTE:
    • Removing instances will preferentially ensure that the remaining instances are evenly distributed in AZs.
    • A manually added ECS is removed in the lowest priority. AS does not delete a manually added ECS when removing it. If multiple manually added ECSs must be removed, AS preferentially removes the earliest-added ECS.

    Oldest instance created from oldest AS configuration

    Health Check Method

    When a health check detects a faulty ECS, AS removes the faulty ECS from the AS group and adds a new one. The health check is implemented using any of the following methods:

    • ECS health check: checks ECS running status. If an ECS is stopped or deleted, it is considered as abnormal. This method is selected by default. Using this method, the AS group periodically determines the running status of each ECS based on the health check result. If the health check result shows that an ECS is faulty, AS removes the ECS from the AS group.
    • ELB health check: determines ECS running status using a load balancing listener. This health check method is available only when the AS group uses a load balancing listener. When a load balancing listener detects that an ECS is faulty, AS removes the ECS from the AS group.

    N/A

  5. Click Next. On the Add AS Configuration page, you can choose to use an existing AS configuration or create one. For details, see Using an Existing ECS to Create an AS Configuration and Using a New Specifications Template to Create an AS Configuration.
  6. Click Create Now.
  7. Check the AS group and AS configuration information. and click Submit.
  8. (Optional) Add AS policies. For details, see Creating an AS Policy.