- Manage and Operate Auto Scaling – Overview
- Manage and Operate Auto Scaling – Introduction
- Manage and Operate Auto Scaling – Concepts
- Manage and Operate Auto Scaling – Scaling Group
- Manage and Operate Auto Scaling – Scaling Configuration
- Manage and Operate Auto Scaling – Scaling Rules
- Manage and Operate Auto Scaling – Manual Operations
- Manage and Operate auto scaling – Scaling Trigger Tasks
- Manage and Operate Auto Scaling – Quiz
This topic describes how to create a scheduled task for scaling computing resources to cope with predictable business changes in the future. By creating a scheduled task, you can enable the system to automatically get sufficient computing resources ready before a business peak or release idle computing resources after the peak.
Background information
A scheduled task is preconfigured to execute a specified scaling rule at a specified time in the future. When the specified time arrives, a scheduled task automatically scales computing resources to meet business requirements with the optimal cost. You can also specify the recurrence for scheduled tasks if business changes are regular.
Only one scaling activity can be executed in a scaling group at one time. Therefore, a scheduled task will fail to trigger a scaling activity if another scaling activity is still in progress in the scaling group. To guarantee the timely execution of the scheduled task, you can set the retry expiration time in which the scheduled task is automatically retried. If multiple scheduled tasks are to be executed in one minute, Auto Scaling executes the scheduled task that is created most recently.
Procedure
- Log on to the Auto Scaling console.
- In the left-side navigation pane, choose Scaling Tasks > Scheduled Tasks.
- In the top navigation bar, select a region.
- Click Create Scheduled Task.
- In the dialog box that appears, set parameters for the scheduled task:
- Enter the description of the scheduled task.You can enter the details about the scheduled task, such as its purpose and function.
- Set the time to execute the scheduled task.The scheduled task will be triggered when the specified time arrives.
- Select a scaling rule.Specify the scaling rule to be executed when the scheduled task is triggered.
- Set the retry expiration time.The value ranges from 0 to 21600, in seconds. If a scaling activity fails to be executed at the specified time, Auto Scaling retries the scheduled task within the retry expiration time.
- Optional. Set the recurrence for executing the scheduled task.You can configure the scheduled task to be repeatedly executed on a daily, weekly, or monthly basis. You can also use a cron expression to specify complex recurrence settings. For more information, see Cron expression.
6. Click OK.
Cron expression
Cron expressions use the UTC+0 time zone. Add eight hours when you convert the time to the local system time in China. In addition, the time when a cron expression is first executed must be earlier than the end time of the recurrence that you set for the scheduled task. Otherwise, the scheduled task fails to be created.
A cron expression is a string separated with spaces. It is divided into five to seven fields. Currently, scheduled tasks in Auto Scaling support cron expressions with five fields, including minute, hour, day, month, and week. The following table describes the value range of each field.
You can enter multiple values in a field by using the following methods:
- Specify multiple values by separating them with commas (,), for example, 1,3,4,7,8.
- Specify the range of values by using a hyphen (-). For example, 1-6 is equivalent to 1,2,3,4,5,6.
- Specify any possible values by using an asterisk (*). For example, you can enter an asterisk in the hour field to represent each hour, which is equivalent to 0-23.
- Specify the frequency by using a slash (/). For example, 0-23/2 in the hour field indicates that the task is executed every 2 hours. Slashes (/) can be used with asterisks (*). For example, */3 in the hour field indicates that the task is executed every 3 hours.