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¶
Log in to the management console.
Click in the upper left corner to select a region and a project.
Under Computing, click Auto Scaling. In the navigation pane on the left, choose Instance Scaling.
Click Create AS Group.
Set parameters, such as Name, Max. Instances, Min. Instances, and Expected Instances. Table 1 describes the key parameters to be configured.
¶ 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.
-
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 different AZs.
If you require low network latency, buy servers in the same AZ.
To enhance application availability, the system evenly distributes your instances between AZs if multiple AZs have been selected.
-
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 (-).
-
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.
The number of expected instances cannot be smaller than the minimum number of instances or greater than the maximum number of instances.
0
Min. Instances
Specifies the minimum number of ECS instances in an AS group.
0
VPC
Provides a network for your ECS instances.
All ECS instances in the AS group are deployed in this VPC.
-
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.
Automatically-assigned IPv6 address: This parameter is available only if an AZ supporting IPv6 addresses is selected and IPv6 is enabled in the VPC subnet. For details about how to enable IPv6 on a subnet, see IPv4 and IPv6 Dual-Stack Network in the Virtual Private Cloud User Guide. By default, the system assigns IPv4 addresses. If Automatically-assigned IPv6 address is selected, the system assigns IPv6 addresses. In a VPC, an ECS uses an IPv6 address to access the dual-stack Intranet. To access the Internet, you must enable the IPv6 Bandwidth and select a shared bandwidth. Then, the ECS can use the IPv6 address to access the Internet.
-
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 the fault tolerance of your applications and expands application service capabilities.
Note
Up to three 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.
If you select Classic load balancer, configure the following parameters:
Load Balancer
Listener
If you select Enhanced load balancer, configure the following parameters:
Load Balancer
Backend ECS Group
Backend Port: specifies the port on which a backend ECS listens for traffic.
Weight: determines the portion of requests a backend ECS processes compared to other backend ECSs added to the same listener.
For more information about load balancing, see Elastic Load Balancing User Guide.
-
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 by following the removal policy you choose. There are four instance removal policies for you to choose from:
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
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 the instance. If multiple manually added instances must be removed, AS preferentially removes the earliest-added instance first.
Oldest instance created from oldest AS configuration
EIP
If EIP has been selected in the AS configuration for the AS group, an EIP is automatically bound to the ECS instance added by a scaling action to the AS group. If you select Release, the EIP bound to an instance is released when the instance is removed from the AS group. Otherwise, the system unbinds the EIP from the instance, but does not release it when the instance is removed from the AS group.
-
Health Check Method
If an ECS instance fails a health check, AS replaces it with a new one. There are two health check methods:
ECS health check: checks the ECS instance running 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 checks the running status of each instance. If the health check results show that an instance is unhealthy, AS removes the instance from the AS group.
ELB health check: determines ECS running status using a load balancing listener. This health check method is only available if a load balancer is configured for the AS group. An instance is considered to be healthy only when all associated listeners detect it as healthy. If a listener detects that the instance is unhealthy, AS removes the instance from the AS group.
-
Health Check Interval
Specifies the length of time between health checks. 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.
5 minutes
Enterprise Project
Specifies the enterprise project to which the AS group belongs. If an enterprise project is configured for an AS group, ECSs created in this AS group also belong to this enterprise project. If you do not specify an enterprise project, the default enterprise project will be used.
Note
Value default indicates the default enterprise project. Resources that are not allocated to any enterprise projects under your account are displayed in the default enterprise project.
Enterprise project is an upgraded version of IAM. It allocates and manages resources of different projects.
-
Advanced Settings
Configure notifications and tags.
You can select Do not configure or Configure now.
-
Notification Mode
This parameter is optional. If this parameter is selected, the system will notify you of scaling action results by email after a scaling action is complete.
The notifications will be sent to the email address you specified when you registered yourself on the cloud.
-
Tag
If you have many resources of the same type, you can use tags to manage your resources. You can identify specified resources quickly using the tags allocated to them.
Each tag contains a key and a value. You can specify the key and value for each tag.
Key
The key must be specified.
The key must be unique to the AS group.
The key can include up to 36 characters. It can include digits, letters, underscores (_), and hyphens (-).
Value
The value is optional.
A key can have only one value.
The value can include up to 43 characters. It can include digits, letters, underscores (_), and hyphens (-).
-
Click Next.
On the displayed page, you can use an existing AS configuration or create an AS configuration. For details, see Creating an AS Configuration from an Existing ECS and Creating an AS Configuration from Scratch.
Click Next.
(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. For details, see Dynamic Scaling and Scheduled Scaling.
Note
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.
Click Create Now.
Check the AS group, AS configuration, and AS policy information. Click Submit.
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.