Alibaba Cloud provides a comprehensive set of global cloud computing services to power Alibaba’s eCommerce ecosystem and other online businesses. Since 2009, Alibaba Cloud has been one of the leading providers in Artificial Intelligence (AI) and cloud computing. Alibaba Cloud offers cloud computing resources and services to thousands of government organizations, developers, and enterprises in more than 200 regions.
An Auto Scaling group is a group of Elastic Compute Service (ECS) instances that are dynamically scaled based on pre-configured scaling rules. A Scaling group allows users to set the minimum and the maximum number of ECS instances, templates used to create ECS instances automatically, and policies for removing ECS instances. Also, users can use a Scaling group to maintain a group of Elastic Compute Service (ECS) instances based on the user’s business requirements.
Auto Scaling rule type determines the primary purpose of a scaling rule. Users can use the Auto Scaling rule to trigger a scaling activity or set the maximum and minimum numbers of Elastic Compute Service (ECS) instances for a scaling group. In this tutorial, we will learn about the steps to create an Auto Scaling rule for a Scaling group in Alibaba Cloud.
Background Information
Auto Scaling in Alibaba Cloud supports four types of scaling rules, such as:
- Simple scaling rule: It is used to trigger a scaling activity to decrease or increase the number of ECS instances in an Auto Scaling group by or to a specific number.
- Predictive scaling rule: It is used to set the maximum and minimum numbers of Elastic Compute Service (ECS) instances for an Auto Scaling group.
- Step scaling rule: It is used to trigger a scaling activity. Step scaling rules are similar to simple scaling rules, except that each simple scaling rule defines only one scaling policy.
- Target tracking scaling rule: It is used to trigger a scaling activity that helps to automatically calculate the number of ECS instances required to keep the metric close to the target value and scales ECS instances accordingly.
Users can create only a limited number of scaling rules for a scaling group. The limit is based on the resource usage of the Auto Scaling group.
Create a Scaling Rule
To create a scaling rule in Alibaba Cloud, follow the below steps:
1. Log in to the Auto Scaling console in Alibaba Cloud as an admin user.
2. Search and find the scaling group and use one of the following methods to open the details page of the scaling group:
- Click Details in the Actions column, or
- Click the ID of the Auto Scaling group in the Scaling Group Name/ID column.
3. In the upper part of the Auto Scaling group page, click the Scaling Rules tab.
4. Next, click the Create Scaling Rule button.
5. In the Create Scaling Rule dialogue box, configure parameters for the scaling rule, such as:
- Mention a name and description for the scaling rule.
- Select the Auto Scaling rule type and configure the related parameters.
>> Note: Users cannot change the rule type of a scaling rule after creating a scaling rule.
6. Finally, click the OK button to create the scaling rule.
Parameters for Different Scaling Rule Types
Parameters for Simple Scaling Rule
Parameter | Description |
Operation | Mention the operations that need to be executed when the scaling rule is triggered. Some of the valid values are:
l Change to N Instances: When the scaling rule is executed, the number of instances in the scaling group is changed to N. A maximum of 500 instances can be removed or added from an Auto Scaling group at a time. l Add N Instances: When the scaling rule is executed, N instances are added to the Auto Scaling group. Users can add a maximum of 500 instances to a scaling group at a time. l Remove N Instances: When the Auto Scaling rule is executed, N instances are removed from the scaling group. Users can remove a maximum of 500 instances from a scaling group at a time. l Add Instances by N%: When the Auto Scaling rule is executed, N% of the number of existing instances in the scaling group is added. Users can add a maximum of 500 instances to a scaling group at a time. l Remove Instances by N%: When the scaling rule is executed, N% of the number of existing instances in the Auto Scaling group is removed. Users can remove a maximum of 500 instances from a scaling group at a time. |
Cooldown Time | (Optional) Unit: seconds. The cooldown period. If this parameter is not specified while creating, the cooldown period of the scaling group is used. |
Parameters for a Predictive Scaling Rule
>> Note: An Auto Scaling group can have only one predictive scaling rule.
Parameter | Description |
Reference Existing Target Tracking Scaling Rule | Mention whether to refer to an existing target tracking scaling rule. If a target tracking Auto Scaling rule exists in the scaling group, users can use Target Value and Metric Type values specified in the target tracking scaling rule. |
Select a Rule | This parameter will appear if the user has selected Reference Existing Target Tracking Scaling Rule. After selecting a target tracking scaling rule, Target Value and Metric Type values specified in the target tracking scaling rule apply to the predictive scaling rule. |
Metric Type | Mention the name of a Cloud Monitor metric to be monitored. Some of the valid values are: l (ECS) Average Outbound Internal Traffic. Unit: KB/min. l (ECS) Average Inbound Internal Traffic. Unit: KB/min. l (ECS) Average CPU Utilization. Unit: %.
|
Target Value | Mention the target value of the metric that needs to be monitored by Cloud Monitor. The predictive scaling rule calculates an appropriate predicted value based on multiple factors such as the target value. If the user changes the target value, existing prediction tasks of the current scaling group are cleared. New prediction tasks are created within an hour. |
Predicative Mode | Mention the prediction mode for the Auto Scaling group. The valid values are: · Predict Only: It will produce predictions but does not create prediction tasks. · Predict and Scale: It will produce predictions and create its tasks. We recommend users select Predict Only first and change it to Predict and Scale if they confirm that the predictions can meet their requirements. |
Preset Max Capacity | Mention the maximum number of Elastic Compute Service (ECS) instances in the Auto Scaling group. This parameter is used together with the Maximum Capacity Handling Method. The default value is the maximum number of instances in the current Auto Scaling group. |
Maximum Capacity Handling Method | Mention the action to be taken on the predicted value when it exceeds the pre-set maximum capacity. The default value is Predicted Capacity Overwrites Preset Max Capacity. Some of the valid values are: l Predicted Capacity Overwrites Preset Max Capacity l Preset Max Capacity Overwrites Predicted Capacity l Predicted Capacity with Additional Ratio |
Increase Ratio | Mention the ratio of the increment to the predicted value. This parameter appears when the user set Maximum Capacity Handling Method to Predicted Capacity with Additional Ratio. Valid values: 0 to 100. Default value: 0. |
Pre-launch Time | Mention the buffer time before prediction tasks are executed. By default, all scheduled tasks created automatically for a predictive scaling rule are executed on the hour. Valid values: 0 to 60. Default value: 0. |
Parameters for a Step Scaling Rule
Parameter | Description |
Monitoring Type | Choose a monitoring type based on the event-triggered task to be associated with the Auto Scaling rule. · System Monitoring: Choose this option to associate a system monitoring event-triggered task with the Auto Scaling rule. · Custom Monitoring: Choose this option to associate a custom monitoring event-triggered task with the Auto Scaling rule. |
Start Time | Define an event-triggered task to be associated with the Auto Scaling rule as the parameter value. The condition of the event-triggered task is used as the reference for triggering step scaling operations. |
Operation | Specify step Auto Scaling operations based on the condition of the event-triggered task. |
Instance Warmup Time | Unit: seconds. The instance warmup period. Auto Scaling adds instances in the warm up state to an Auto Scaling group but does not report monitoring data to Cloud Monitor during the warmup period. |
Parameters for a Target Tracking Scaling Rule
Parameter | Description |
Reference Existing Predictive Scaling Rule | Specifies whether to reference an existing target tracking scaling rule. If a predictive scaling rule exists in the scaling group, users can specify whether to inherit the target and metric value from the predictive scaling rule. |
Metric Type | Mention the name of a Cloud Monitor metric to be monitored. Some of the valid values are: l (ECS) Average CPU Utilization l (ECS) Average Inbound Public Traffic l (ECS) Average Outbound Public Traffic l (ECS) Average Inbound Internal Traffic l (ECS) Average Outbound Internal Traffic |
Target Value | Mention the target value of the Cloud Monitor metric. The target tracking Auto Scaling rule keeps the Cloud Monitor metric close to the target value. |
Instance Warmup Time | Unit: seconds. The instance warmup period. Auto Scaling adds instances in the warm up state to an Auto Scaling group but does not report monitoring data to Cloud Monitor during the warmup period. |
Disable Scale-in | Specifies whether to disable scale-in events as the value in this parameter. This parameter affects the number of event-triggered tasks created automatically. |
Conclusion
This tutorial presents the steps to create an Auto Scaling rule for a Scaling group in Alibaba Cloud. Hope this tutorial was helpful, and do reach out to us if you have any query or suggestions.