You can create different types of AS policies. In an AS policy, you can define the conditions for triggering a scaling action and what operation to be performed. When the conditions are met, AS automatically triggers a scaling action to adjust the number of instances in the AS group.
This section describes how to create alarm-based, scheduled, or periodic AS policy for an AS group.
Parameter | Description | Example Value |
|---|---|---|
Policy Name | Specifies the name of the AS policy to be created. | as-policy-p6g5 |
Policy Type | Select Alarm. | Alarm |
Alarm Rule | Specifies whether a new alarm rule is to be created (Create) or an existing alarm rule will be used (Use existing). For details about how to use an existing alarm rule, see Setting Monitoring Alarm Rules. If you choose to create an alarm, system monitoring and custom monitoring are supported. | - |
Scaling Action | Specifies the scaling action to be executed and the number or percentage of instances. The following scaling action options are available: Adds instances to an AS group when the scaling action is performed. Removes instances from an AS group when the scaling action is performed. Maintains a fixed number of instances in an AS group. |
|
Cooldown Period | To prevent an alarm-based policy from being repeatedly triggered by the same event, you can set a cooldown period. A cooldown period (in seconds) is the period of time between two scaling actions. AS recounts the cooldown period after a scaling action is complete. During the cooldown period, AS denies all scaling requests triggered by alarm-based policies. Scaling requests triggered manually or by scheduled or periodic policies are not affected. For example, suppose that the cooldown period is set to 300 seconds (5 minutes), and a scheduled policy is specified to trigger a scaling action at 10:32, and a previous scaling action triggered by an alarm policy ends at 10:30. Any alarm-triggered scaling action will then be denied during the cooldown period from 10:30 to 10:35, but the scaling action scheduled for 10:32 will still take place. If the scheduled scaling action ends at 10:36, a new cooldown period starts at 10:36 and ends at 10:41. NOTE:
| 300s |
Parameter | Description | Example Value |
|---|---|---|
Rule Name | Specifies the name of the alarm rule. | as-alarm-7o1u |
Monitoring Type | Specifies the type of monitoring metrics, which can be System monitoring or Custom monitoring. Select System monitoring. | System monitoring |
Trigger Condition | Select monitoring metrics supported by AS and set alarm conditions for the metrics. | CPU Usage Max. >70% |
Monitoring Interval | Specifies the interval at which the alarm status is updated based on the alarm rule. | 5 minutes |
Consecutive Occurrences | Specifies the number of sampling points when an alarm is triggered. If Consecutive Occurrences is set to n, the sampling points of the alarm rule are the sampling points in n consecutive sampling periods. The alarm rule status does not change to Alarm unless all sampling points breach the threshold configured by the alarm rule. | 3 |
Parameter | Description | Example Value |
|---|---|---|
Rule Name | Specifies the name of the alarm rule. | as-alarm-7o1u |
Monitoring Type | Select Custom monitoring. Custom monitoring meets monitoring requirements in various scenarios. | Custom monitoring |
Resource Type | Specifies the name of the service for which the alarm rule is configured. | AGT.ECS |
Dimension | Specifies the metric dimension of the alarm rule. | instance_id |
Instance | Specifies the resources to which the alarm rule applies. | - |
Trigger Condition | Select monitoring metrics supported by AS and set alarm conditions for the metrics. | CPU Usage Max. >70% |
Monitoring Interval | Specifies the interval at which the alarm status is updated based on the alarm rule. | 5 minutes |
Consecutive Occurrences | Specifies the number of sampling points when an alarm is triggered. If Consecutive Occurrences is set to n, the sampling points of the alarm rule are the sampling points in n consecutive sampling periods. The alarm rule status does not change to Alarm unless all sampling points breach the threshold configured by the alarm rule. | 3 |
The newly added AS policy is displayed on the AS Policies tab. In addition, the AS policy is in Enabled state by default.
Parameter | Description | Example Value |
|---|---|---|
Policy Name | Specifies the name of the AS policy to be created. | as-policy-p6g5 |
Policy Type | Select Scheduled or Periodic for expanding resources at a specified time. If you select Periodic, you are required to configure two more parameters:
| - |
Time Zone | The default value is GMT+08:00. GMT+08:00 is 8:00 hours ahead of Greenwich Mean Time. | GMT+08:00 |
Triggered At | Specifies the time at which the AS policy is triggered. | - |
Scaling Action | Specifies an action and the number of instances. The following scaling action options are available: Adds instances to an AS group when the scaling action is performed. Removes instances from an AS group when the scaling action is performed. Sets the expected number of instances in an AS group to a specified value. |
For example, suppose that there are 10 instances in an AS group, and the scaling action is Add 15% instances. When the AS policy is triggered, AS calculates the number of instances to be added is 1.5 and rounds 1.5 down to 1. After the scaling action is complete, there are 11 instances in the AS group. |
Cooldown Period | To prevent an alarm-based policy from being repeatedly triggered by the same event, you can set a cooldown period. A cooldown period (in seconds) is the period of time between two scaling actions. AS recounts the cooldown period after a scaling action is complete. During the cooldown period, AS denies all scaling requests triggered by alarm-based policies. Scaling requests triggered manually or by scheduled or periodic policies are not affected. For example, suppose that the cooldown period is set to 300 seconds (5 minutes), and a scheduled policy is specified to trigger a scaling action at 10:32, and a previous scaling action triggered by an alarm policy ends at 10:30. Any alarm-triggered scaling action will then be denied during the cooldown period from 10:30 to 10:35, but the scaling action scheduled for 10:32 will still take place. If the scheduled scaling action ends at 10:36, a new cooldown period starts at 10:36 and ends at 10:41. NOTE:
| 300s |
The newly added AS policy is displayed on the AS Policies tab. In addition, the AS policy is in Enabled state by default.
If you have created scheduled or periodic AS policies that are invoked at the same time, AS will execute the one created later. This constraint does not apply to alarm-triggered AS policies.