Managing Policies
The number of servers in an Auto-Scaling Group can be dynamically adjusted based on monitoring metrics. When the set threshold is exceeded based on the monitoring metrics, the number of servers is adjusted. At this time, you can choose one of three ways to adjust the number of servers: increase or decrease the number of servers by a specified number, increase or decrease the number of servers by a specified ratio, or fix the number of servers to a specified value. When a server is started or terminated due to a policy, the monitoring metric, such as CPU usage, may temporarily exceed the threshold set in the policy. However, since this is a temporary moment, a cooldown time is set so that it is not judged as an abnormal situation. You can add and manage policies for an Auto-Scaling Group created in the Samsung Cloud Platform Console.
Adding a Policy
You can add a policy to an Auto-Scaling Group. To add a policy to an Auto-Scaling Group, follow these steps:
All Services > Compute > Virtual Server menu, click. Move to the Service Home page of Virtual Server.
Click the Auto-Scaling Group menu. Move to the Auto-Scaling Group List page.
On the Auto-Scaling Group List page, click the resource to view detailed information. Move to the Auto-Scaling Group Details page.
Click the Policy Tab. Move to the Policy Tab page.
Click the Add Policy button. The Add Policy popup window opens.
Classification RequiredDetailed Description Classification Required Policy classification - Scale In: Server reduction
- Scale Out: Server increase
Policy Name Required Policy name for distinction Execution Condition Required Condition for executing the policy - Statistic: Method of calculating the metric type
- Average: Average of servers in the Auto-Scaling Group
- Min: Minimum value among servers in the Auto-Scaling Group
- Max: Maximum value among servers in the Auto-Scaling Group
- Metric Type: CPU Usage, Memory Usage, Network In(bytes), Network Out(bytes), Network In(Packets), Network Out(Packets)
- Note: Memory usage policy is not available for Windows servers
- Operator:
>=><=<
- Threshold: Threshold for the metric type
- Period: Continuous time to trigger the execution condition (N minutes)
Execution Unit Required Method of executing the policy - Policy Type: Select the type of policy to execute.
- Increase or decrease the number of servers by a specified number: Increase or decrease the target value
- Increase or decrease the number of servers by a specified ratio: Increase or decrease the target value ratio
- Fix the number of servers to a specified value: Fix the target value
- Target Value: Number or ratio to execute the selected Policy Type
Cooldown Required Time to wait (in seconds) when a server is started or terminated due to a policy - Default value is 300 seconds, and it can be set between 60 seconds and 3,600 seconds.
Table. Add Policy Popup ItemsNotePolicy > Cooldown Setting
- When a server is started or terminated due to a policy, wait for the cooldown time set. The monitoring metric, such as CPU usage, may temporarily exceed the threshold set in the policy. However, since this is a temporary moment and not a condition for adjusting the number of servers, the cooldown time is set to wait.
GuidePolicy execution operates within the set minimum and maximum number of servers.
- Even if the number of servers is increased or decreased, or fixed, beyond the minimum and maximum number of servers, it operates within the set minimum and maximum number of servers.
- Example: If the minimum number of servers is 3, even if the number of servers is fixed to 1, the number of servers will not decrease to 1, but will be maintained at the minimum number of servers, which is 3.
In the Add Policy popup window, enter the required values and click the Confirm button. The added policy can be checked in the Policy List.
Policy Creation Example
The following is an explanation of the policy example. Refer to it when creating a policy.
| Classification | Execution Condition | Execution Unit | Cooldown |
|---|---|---|---|
| Scale Out | Average CPU Usage >= 60% for 1 minute | Increase the number of servers by a specified number, 1 server | 300 seconds |
- If the average CPU usage of the servers in the Auto-Scaling Group is 60% or higher for 1 minute, 1 server is added.
- When a server is added, the cooldown time is 300 seconds. During the cooldown time, no additional servers are added or terminated due to the policy.
- After the cooldown time ends, the policy execution condition is checked again.
| Classification | Execution Condition | Execution Unit | Cooldown |
|---|---|---|---|
| Scale In | Min CPU Usage <= 5% for 1 minute | Decrease the number of servers by a specified ratio, 50% | 300 seconds |
- If the minimum CPU usage of the servers in the Auto-Scaling Group is 5% or lower for 1 minute, 50% of the current number of servers are terminated.
- When a server is terminated, the cooldown time is 300 seconds. During the cooldown time, no additional servers are added or terminated due to the policy.
- After the cooldown time ends, the policy execution condition is checked again.
| Classification | Execution Condition | Execution Unit | Cooldown |
|---|---|---|---|
| Scale Out | Max CPU Usage >= 90% for 1 minute | Fix the number of servers to a specified value, 5 servers | 300 seconds |
- If the maximum CPU usage of the servers in the Auto-Scaling Group is 90% or higher for 1 minute, the number of servers is fixed to 5.
- During the server creation, the cooldown time is 300 seconds. During the cooldown time, no additional servers are added or terminated due to the policy.
- After the cooldown time ends, the policy execution condition is checked again.
Modifying a Policy
You can modify a policy of an Auto-Scaling Group. To modify a policy of an Auto-Scaling Group, follow these steps:
All Services > Compute > Virtual Server menu, click. Move to the Service Home page of Virtual Server.
Auto-Scaling Group menu should be clicked. It moves to the Auto-Scaling Group list page.
In the Auto-Scaling Group list page, click on the resource to check the detailed information. It moves to the Auto-Scaling Group details page.
Click on the Policy tab. It moves to the Policy tab page.
Click on the More > Edit button of the policy to be modified. The Policy modification popup opens.
Classification RequiredDetailed Description Classification Required Policy classification - Scale In: Server count return
- Scale Out: Server count increase
Policy Name Required Policy name for distinction Execution Condition Required Condition for executing the policy - Statistic: Method of calculating Metric Type
- Average: Average of servers in Auto-Scaling Group
- Min: Minimum value among servers in Auto-Scaling Group
- Max: Maximum value among servers in Auto-Scaling Group
- Metric Type: CPU Usage, Memory Usage, Network In(bytes), Network Out(bytes), Network In(Packets), Network Out(Packets)
- Note: Memory usage policy cannot be set for Windows servers
- Operator:
>=><=<
- Threshold: Threshold corresponding to Metric Type
- Period: Continuous time (N minutes) to trigger the execution condition
Execution Unit Required Method of executing the policy - Policy Type: Select the type of policy to be executed.
- Increase or decrease the server count by a specified number: Increase or decrease the server count by the target value
- Increase or decrease the server count by a specified ratio: Increase or decrease the server count by the target value ratio
- Fix the server count to the input value: Fix the server count to the target value
- Target Value: The number or ratio of the selected Policy Type to be executed
Cooldown Required Waiting time (in seconds) when a server is started or terminated due to a policy - Default value is 300 seconds, and it can be set from 1 second to a maximum of 3,600 seconds
Table. Policy modification popup itemsClick the Confirm button after entering the required values in the Policy modification popup window.
Policy Addition and Modification Restrictions
There are restrictions when adding or modifying policies, depending on the policy classification, execution condition, and execution condition range. Refer to the examples of restrictions below and add or modify policies accordingly.
Example 1 - Check for duplicate registration of policy classification and execution condition
Duplicate registration is not allowed when the policy classification (Scale Out or Scale In) and execution condition (Metric type) are the same.
| Policy Classification | Policy Name | Execution Condition (Statistic) | Execution Condition (Metric Type) | Execution Condition Range |
|---|---|---|---|---|
Scale Out | ScaleOutPolicy | Average | CPU Usage | >= 60% |
If a policy is already registered as shown above, it is not possible to add or modify a policy with the same classification (Scale Out) and execution condition (Metric type = CPU Usage).
Example 2 - Check the execution condition range for the same execution condition (Metric type) and execution condition (Statistic)
When the policy distinction (Scale Out or Scale In) is different, the execution condition range (Comparison operator + Threshold) cannot be duplicated for the same execution condition (Metric type) and execution condition (Statistic).
| Policy Distinction | Policy Name | Execution Condition (Statistic) | Execution Condition (Metric type) | Execution Condition Range |
|---|---|---|---|---|
Scale Out | ScaleOutPolicy | Average | CPU Usage | >= 60% |
In the case where a policy is registered as above, it is not possible to add a policy or modify it as follows: If the CPU Usage is 60% or higher on average, since the Scale Out policy is already registered, it is not possible to register a Scale In policy for CPU Usage average of 60% or lower, as the 60% case would be a duplicate of the same execution condition.
| Policy Distinction | Policy Name | Execution Condition (Statistic) | Execution Condition (Metric type) | Execution Condition Range |
|---|---|---|---|---|
Scale In | AddUpdatePolicy | Average | CPU Usage | <= 60% |
If a policy is already registered as shown above, it is not possible to add or modify a policy with the same execution condition (Metric type = CPU Usage) and execution condition (Statistic = Average), and an execution condition range that overlaps with the existing policy.
Example 3 - Check the execution condition range for the same execution condition (Metric type) and execution condition (Statistic)
When the policy distinction (Scale Out or Scale In) is different, the execution condition range (Comparison operator + Threshold) cannot be duplicated for the same execution condition (Metric type) and execution condition (Statistic).
| Policy Distinction | Policy Name | Execution Condition (Statistic) | Execution Condition (Metric type) | Execution Condition Range |
|---|---|---|---|---|
Scale In | ScaleInPolicy | Average | CPU Usage | <= 10% |
In the case where a policy is registered as above, it is not possible to add or modify a policy as follows: Since the Scale In policy is already registered when the CPU usage is 10% or less on average, it is not possible to register a Scale Out policy when the CPU usage is less than 60%, less than or equal to 60%, greater than 10%, or greater than 9%.
| Policy Distinction | Policy Name | Execution Condition (Statistic) | Execution Condition (Metric type) | Execution Condition Range |
|---|---|---|---|---|
Scale Out | AddUpdatePolicy1 | Average | CPU Usage | < 60% |
Scale Out | AddUpdatePolicy2 | Average | CPU Usage | <= 60% |
Scale Out | AddUpdatePolicy3 | Average | CPU Usage | >= 10% |
Scale Out | AddUpdatePolicy4 | Average | CPU Usage | > 9% |
Example 4 - Registration is possible when the execution condition range does not overlap
When the policy distinction (Scale Out or Scale In) is different, it is possible to register even if the execution condition (Statistic) is different or the execution condition range (Comparison operator + Threshold) does not overlap for the same execution condition (Metric type).
| Policy Distinction | Policy Name | Execution Condition (Statistic) | Execution Condition (Metric type) | Execution Condition Range |
|---|---|---|---|---|
Scale Out | ScaleOutPolicy | Average | CPU Usage | >= 60% |
In the case where a policy is registered as above, it is possible to add or modify a policy as follows. If the execution condition range does not overlap or the execution condition (Statistic) is different, registration is possible.
| Policy Distinction | Policy Name | Execution Condition (Statistic) | Execution Condition (Metric type) | Execution Condition Range |
|---|---|---|---|---|
Scale In | AddUpdatePolicy1 | Average | CPU Usage | <= 10% |
Scale In | AddUpdatePolicy2 | Min | CPU Usage | <= 60% |
Deleting a Policy
It is possible to delete a policy from an Auto-Scaling Group. To delete a policy, follow the procedure below.
- All Services > Compute > Virtual Server menu, click. Move to the Service Home page of Virtual Server.
- Auto-Scaling Group menu, click. Move to the Auto-Scaling Group List page.
- On the Auto-Scaling Group List page, click the resource to check the detailed information. Move to the Auto-Scaling Group Details page.
- Click the Policy Tab. Move to the Policy Tab page.
- Select the policy to delete and click the Delete button. The Policy Delete Confirmation popup window opens.
- Confirm the Policy Delete Confirmation popup window and click the Confirm button.