Configure vertical scaling tasks

更新时间:
复制 MD 格式

Vertical scaling allows you to adjust the instance type (vCPUs and memory) of specified ECS instances on a schedule or based on real-time metrics. You can upgrade the instance type to ensure sufficient computing power when business demand increases, or downgrade the instance type to save costs when business demand decreases. This topic describes how to create, view, clone, cancel, or delete vertical scaling tasks in the Auto Scaling console.

Background information

Vertical scaling allows you to adjust the instance type (vCPUs and memory) for pay-as-you-go instances. This feature applies to business scenarios with both regular and fluctuating workloads. For more information about the benefits, billing, and limits of vertical scaling, see Vertical scaling overview.

Create a vertical scaling task

  1. Go to the Vertical Scaling page.

    1. Log on to the Auto Scaling console.

    2. In the navigation pane on the left, click Vertical Scaling.

    3. In the top navigation bar, select a region.

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

  3. On the Create Vertical Scaling Task page, configure the parameters for the task.

    The following table describes the parameters.

    Parameter

    Description

    Task Type

    The scaling direction.

    • Upgrade: Upgrades the target instance's type to increase its computing power.

    • Downgrade: Downgrades the target instance's type to decrease its computing power.

    Select Instance

    The target instance for the task.

    Select Instance Type

    The target instance types. If you specify multiple types, the task scales the instance to them in the specified order.

    Important

    Vertical scaling tasks can only adjust instance types within the same instance family.

    • Scale-up instance types: Specify up to 10 instance types in ascending order of computing power. The vCPU and memory of a subsequent instance type must be greater than those of the previous instance type.

      For example, the current instance type is ecs.g6.large. You specify ecs.g6.3xlarge, ecs.g6.4xlarge, and ecs.g6.6xlarge in this order. If two consecutive scale-up tasks run successfully, the instance type changes to ecs.g6.4xlarge.

    • Scale-down instance types: Specify up to 5 instance types in descending order of computing power. The vCPU and memory of a subsequent instance type must be less than those of the previous instance type.

      For example, the current instance type is ecs.g6.6xlarge. You specify ecs.g6.4xlarge, ecs.g6.3xlarge, and ecs.g6.large in this order. If three consecutive scale-down tasks run successfully, the instance type changes to ecs.g6.large.

    Trigger Type

    The method used to trigger the task. Valid values:

    • Scheduled Trigger: You must specify the frequency and time at which the task is run.

      • One-time execution: You can select Execute Now, or select Executed Once at the Specified Time and then configure an execution time.

      • Recurring execution: You must select Executed Periodically and then configure the recurrence frequency, its time zone, and the end time of the rule.

        You can click Quick Selection to configure the recurrence frequency in the UI or specify a cron expression. For more information about cron expressions, see Cron expressions.

        Important

        Vertical scaling requires restarting your pay-as-you-go instance, which causes service interruptions. We recommend scheduling the task to run during off-peak hours.

    • Threshold Trigger: You must specify a threshold-based rule and a trigger silence period.

      • Rule: Define a threshold condition for a CloudMonitor metric. A threshold-based rule includes the metric name, aggregation period, number of consecutive periods, statistical method, comparison operator, and threshold.

        For example, a vertical scaling task is triggered if the average value of the DiskIOPSWrite metric exceeds 70 count for three consecutive 5-minute periods. To configure this, set Metric to DiskIOPSWrite, Aggregation Period to 5 Minutes, Consecutive Periods to 3, Method to Average, Comparison Operator to >, and Threshold to 70 (Unit: count).

      • Trigger Silence Period: If monitoring data continuously exceeds the alert threshold, only one task runs during the silence period.

        Important

        We recommend that you configure threshold conditions with caution. If the number of consecutive periods is too small or the silence period is too short, your ECS instance might restart frequently, which could affect your services.

    Permissions

    Grant permissions to the RAM role used by CloudOps Orchestration Service (OOS).

    • If this is your first time using vertical scaling, you must create a RAM role for OOS and grant it permissions to manage ECS and Auto Scaling resources. 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.

    • If you have used vertical scaling before, select an existing RAM role, such as OOSServiceRole.

    Advanced

    Optional. Add a description and tags to help you identify and manage the task.

  4. Click Create Vertical Scaling Task.

    After the task is created, you can view the details of the task on the Vertical Scaling page.

View a vertical scaling task

After a vertical scaling task is created, it runs at a specified time or when a threshold condition is met. The task automatically stops the target instance, adjusts the instance type, and then starts the instance. You can view the task's execution details, including the execution time, result, and logs.

  1. Go to the Vertical Scaling page.

  2. On the Vertical Scaling page, find the task you want to view by its trigger type and task type. The task type can be scale-up or scale-down.

  3. In the Actions column, click Details to view the task's details.

    You can view the Basic Information, Task Information, and Execution progress of the task. You can also view the results of past executions on the Historical executions tab and the scheduled execution times on the To be Executed tab. In addition, the Execution Logs tab displays all logs for the current execution.

    Note

    In the Execution Progress section, click View Execution Flowchart to view the detailed steps of the task execution.

    • On the Historical executions tab, you can view the execution result and logs of each past execution.

    • On the To be Executed tab, you can view the scheduled execution times.

Clone a vertical scaling task

To quickly create a vertical scaling task, clone an existing one and modify its configuration as needed.

  1. Go to the Vertical Scaling page.

  2. 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 task's configuration as needed.

    For more information about the parameters, see the parameter descriptions in the "Create a vertical scaling task" section of this topic.

  4. Click Create Vertical Scaling Task.

Cancel or delete a vertical scaling task

If a vertical scaling task is no longer required, you can cancel a pending task or delete a canceled or completed one.

  1. Go to the Vertical Scaling page.

  2. Perform one of the following operations based on your business requirements:

    • Find a pending task and click Cancel in the Actions column.

    • Find a canceled or completed task and click Delete in the Actions column.

  3. In the message that appears, click OK.