Updated on 2022-08-15 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 available in different AZs may vary. When creating an AS group, choose an AS configuration that uses an ECS type available in the AZs used by the AS group.

  • If the ECS type specified in the AS configuration is not available in any of the AZs used by the AS group, the following situations will occur:
    • If the AS group is disabled, it cannot be enabled again later.
    • 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 only available in certain AZs used by the AS group, the ECS instances added by a scaling action are only deployed in the AZs where that ECS type is available. 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 the AS group is deployed.

    Resources in different regions cannot communicate with each other over internal networks. For lower network latency and faster access to your resources, select the region nearest to your target users.

    N/A

    AZ

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

    • If you require high availability, buy servers in difference AZs.
    • If you require low network latency, buy servers in the same AZ.

    N/A

    Multi-AZ Extension Policy

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

    • Load-balanced: When scaling out an AS group, the system preferentially distributes ECS instances evenly across 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 scaling out an AS group, the system distributes ECS instances to the AZ selected according to the order in which AZs are specified.
      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 can contain up to 64 characters. It can include letters, digits, underscores (_), and hyphens (-).

    N/A

    Max. Instances

    Specifies the maximum number of ECS instances in an AS group.

    1

    Expected Instances

    Specifies the expected number of ECS instances in an AS group.

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

    0

    Min. Instances

    Specifies the minimum number of ECS instances in an AS group.

    0

    AS configuration

    Specifies the required AS configuration for the AS group. An AS configuration defines the specifications of the ECS instances 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 ECS instances.

    All ECS instances in the AS group are deployed in this VPC.

    N/A

    Subnet

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

    N/A

    Load Balancing

    This parameter is optional. A load balancer automatically distributes traffic across all instances in an AS group to balance their service load. It improves fault tolerance of 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 unhealthy, AS will replace it with a new one.

    N/A

    Instance Removal Policy

    Controls which instances are first to be removed during scale in. If specified conditions are met, scaling actions are triggered to remove instances. You can choose from any of the following instance removal policies:

    • Oldest instance created from oldest AS configuration: The oldest instance created from the oldest configuration is removed from the AS group first.
    • Newest instance created from oldest AS configuration: The newest instance created from 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:
    • AS always balances instances across AZs first, regardless of which removal policy is used.
    • Manually added ECS instances are the last to be removed. If AS does remove a manually added instance, it only removes the instance from the AS group. It does not delete instance. If multiple manually added instances must be removed, AS preferentially removes the earliest-added instance first.

    Oldest instance created from oldest AS configuration

    Health Check Method

    When a health check detects an unhealthy ECS instance, AS replaces it with a new one. You can choose from either of the following health check methods:

    • ECS health check: checks ECS instance health status. If an instance is stopped or deleted, it is considered to be unhealthy. This method is selected by default. Using this method, the AS group periodically evaluates the running status of each instance based on the health check results. If the health check results show that an instance is unhealthy, AS removes the instance from the AS group.
    • ELB health check: determines ECS instance running status using a load balancing listener. This health check method is only available if the AS group uses a load balancing listener. If a load balancing listener detects that an ECS instance is unhealthy, AS removes the instance from the AS group.

    N/A

    Advanced Settings

    Configure notifications and tags.

    You can select Do not configure or Configure now.

    N/A

  5. Click Next.
  6. On the displayed page, you can use an existing AS configuration or create an AS configuration.
  7. Click Next.
  8. (Optional) Add an AS policy to an AS group.

    On the displayed page, click Add AS Policy.

    Configure the required parameters, such as the Policy Type, Scaling Action, and Cooldown Period.
    • If a scaling action is triggered by an AS policy, the cooldown period is whatever configured for that AS policy.
    • If a scaling action is triggered by manually changing the expected number of instances or by other actions, the cooldown period is whatever configured for the AS group. The default cooldown period is 300 seconds.
  9. Click Create Now.
  10. Check the AS group, AS configuration, and AS policy information. Click Submit.
  11. Confirm the creation result and go back to the AS Groups page as prompted.

    After the AS group is created, its status changes to Enabled.