All Products
Search
Document Center

Auto Scaling:Manage vertical scaling tasks

Last Updated:Apr 26, 2024

Vertical scaling refers to automatic adjustment of Elastic Compute Service (ECS) instance types (vCPUs and memory size) on a custom schedule or instant adjustment of instance types. When your business workloads surge, you can enable vertical scaling to upgrade ECS instance types to provide sufficient computing power. When your business workloads drop, you can enable vertical scaling to downgrade ECS instance types to save resource costs. This topic describes how to create, view, clone, cancel, or delete a vertical scaling task in the Auto Scaling console.

Background information

Vertical scaling takes effect on pay-as-you-go ECS instances. You can enable vertical scaling as demanded, regardless of whether your business has specific patterns or not. For information about the benefits, billing methods, and usage notes of vertical scaling, see Overview.

Create a vertical scaling task

  1. Go to the Vertical Scaling page.

    1. Log on to the Auto Scaling console.

    2. In the left-side navigation pane, click Vertical Scaling.

    3. In the top navigation bar, select the region where Auto Scaling is activated.

  2. In the upper-left corner of the Vertical Scaling page, click Create Vertical Scaling.

  3. On the Create Vertical Scaling page, configure parameters as prompted.

    The following table describes the parameters.

    Parameter

    Description

    Type

    The direction of the vertical scaling task. Valid values:

    • Upgrade: Instance types are upgraded to increase the computing power.

    • Downgrade: Instance types are downgraded to reduce the computing power.

    Select Instance

    The instances for which you want to create the vertical scaling task.

    Select Instance Specifications

    The instance type that you want to use. If you specify multiple instance types, the vertical scaling task is executed based on the specified order of the instance types.

    Important

    In a vertical scaling task, you can upgrade or downgrade the current instance type to another instance type that belongs to the same instance family as the current one.

    • Upgrade instance types: Specify up to 10 instance types in ascending order based on their computing power. That is, an instance type that comes later in the order must have a larger number of vCPUs and memory size than the preceding instance type.

      For example, if the current instance type is ecs.g6.large, the next three instance types must be ecs.g6.3xlarge, ecs.g6.4xlarge, and ecs.g6.6xlarge. After you execute the vertical scaling task for two consecutive times, the final instance type is ecs.g6.4xlarge.

    • Downgrade instance types: Specify up to five instance types in descending order based on their computing power. That is, an instance type that comes later in the order must have a smaller number of vCPUs and memory size than the preceding instance type.

      For example, if the current instance type is ecs.g6.large, the next three instance types must be ecs.g6.4xlarge, ecs.g6.3xlarge, and ecs.g6.large. After you execute the vertical scaling task for three consecutive times, the final instance type is ecs.g6.large.

    Trigger Type

    The mode in which the vertical scaling task is triggered. Valid values:

    • Scheduled Trigger: You must specify the execution time of the task.

      • Single execution: You can set the Scheduled Task Type parameter to Execute Now or Executed Once at the Specified Time. If you set the value to Executed Once at the Specified Time, you must also configure the Execution Time parameter.

      • Repeated execution: You must set the Scheduled Task Type parameter to Executed Periodically. Then, you must also configure the following parameters: Execution Frequency, Time Zone for Periodic Execution, and End Time for Period Execution.

        You can click Quick Selection to conveniently configure the Execution Frequency parameter on the GUI. You can also configure a cron expression to specify the execution frequency. For more information about cron expressions, see Configure cron expressions.

        Important

        After you create a vertical scaling task for a pay-as-you-go ECS instance, you must restart the ECS instance to put the vertical scaling task into effect. However, instance restart causes business interruption. We recommend that you execute your vertical scaling task during off-peak hours.

    • Threshold Trigger: You must also configure the Rule Description and Trigger Mute Period parameters.

      • Rule Description: Specify a threshold trigger rule for statistical values of a CloudMonitor metric. The threshold rule contains the following items: metric name, aggregation period of monitoring data, number of times that statistics are collected, statistical method, comparison operator, and threshold.

        In the following figure, the metric is DiskIOPSWrite and the aggregation period of monitoring data is five minutes. If the average value of DiskIOPSWrite exceeds 70 for three consecutive times, the vertical scaling task is triggered. 规则示例

      • Trigger Mute Period: If the monitoring data continuously exceeds the threshold specified in the trigger rule, the vertical scaling task is executed once during the mute period.

        Important

        We recommend that you configure an appropriate threshold trigger rule. If the number of times that statistics are collected is smaller than required or if the mute period is shorter than required, ECS instances may be frequently started, stopped, and upgraded or downgraded, which interrupts business continuity.

    Permissions

    The permissions of the Resource Access Management (RAM) role that is assumed by CloudOps Orchestration Service (OOS).

    • The first time you use the vertical scaling feature, you must create a RAM role for OOS and grant the required permissions on ECS and Auto Scaling to the RAM role. For more information, see Create a RAM role for a trusted Alibaba Cloud service and Grant permissions to a RAM role.

      Note

      We recommend that you attach the AliyunECSFullAccess and AliyunESSFullAccess policies to the RAM role.

    • If this is not the first time you use the vertical scaling feature, select an existing RAM user, such as OOSServiceRole.

    Advanced

    Optional. You can add a description and tags to the vertical scaling task. This facilitates task query and management.

  4. Click Create Vertical Scaling.

    After you create the vertical scaling task, you can view the created vertical scaling task on the Vertical Scaling page.

View a vertical scaling task

After a vertical scaling task is created, the system executes the task at the specified time or when the threshold condition is met. Operations such as stopping the instance, changing the instance type, and starting the instance are automatically performed. You can view the execution details of a vertical scaling task, including the execution time, execution result, and logs.

  1. Go to the Vertical Scaling page.

  2. On the Vertical Scaling page, find the desired vertical scaling task by Task Status or Trigger Type.

  3. Click Details in the Actions column to view the details of the vertical scaling task.

    The page that appears contains the following sections: Basic Information, Task Information, and Execution Progress. The Execution Progress section contains the following tabs: Historical Executions, Pending Executions, and Execution Logs. You can view all logs on the Execution Logs tab.

    垂直伸缩.png

    Note

    In the Execution Progress section, you can click View Execution Flowchart to learn about the specific steps in the task.

    • On the Historical Executions tab, you can view the execution results and logs of each historical task.

    • On the Pending Executions tab, you can view the point in time when the task is to be executed.

Clone a vertical scaling task

If you want to quickly create a new vertical scaling task, you can clone an existing vertical scaling task and modify it to adapt to your business requirements.

  1. Go to the Vertical Scaling page.

  2. On the Vertical Scaling page, find the vertical scaling task that you want to clone and click Clone in the Actions column.

  3. On the Clone Vertical Scaling page, modify the vertical scaling task based on your business requirements.

    For information about parameter settings, see Create vertical scaling tasks.

  4. Click Create Vertical Scaling.

Cancel or delete a vertical scaling task

If you do not require a vertical scaling task that is in the Pending state for now, you can cancel the execution of the task. You can also delete a canceled or completed vertical scaling task.

  1. Go to the Vertical Scaling page.

  2. Select one of the following methods based on your business requirements:

    • Find the desired vertical scaling task that is pending to be executed and click Cancel in the Actions column.

    • Find the desired vertical scaling task that is canceled or completed and click Delete in the Actions column.

  3. In the message that appears, click OK.