Setting Scheduled Tasks for ECSs
Scenario
ECS supports scheduled O&M. You can schedule tasks such as starting and stopping multiple ECSs.
For example, if your services have regular peaks and lulls, you can start ECSs during peak hours and stop them during off-peak hours to reduce costs. Manually starting or stopping your ECSs is time-consuming and can be accident prone. You can set scheduled tasks for automatic O&M on multiple ECSs, reducing labor and time costs.
This section describes how to set scheduled tasks for ECSs.
Notes and Constraints
- ECS scheduled O&M is dependent on Cloud Operations Center (COC). COC must be enabled and authorized.
For IAM users, permissions for COC operations need to be granted. For details, see Configuring Custom Policies for ECS Self-Service O&M.
- Each account can create a maximum of 100 scheduled tasks.
- Scheduled tasks only apply to ECSs in the same region.
Procedure
You can create scheduled start or stop tasks for one or more ECSs.
- Log in to the management console and go to the Elastic Cloud Server console.
- In the ECS list, locate the target ECS and choose More > Set Scheduled Tasks > Set Scheduled Start or Set Scheduled Stop in the Operation column.
- (Optional) On the Enable COC and Grant Permissions page, read the service statement, select the check box, and click Enable and Authorize.
This page is displayed if COC is not enabled and authorized.
- On the Create Task page, set parameters required for the scheduled task.
Table 1 Scheduled task parameters Parameter
Description
Task Name
Name of the scheduled task to be created.
The value can contain 3 to 100 characters, including letters, digits, hyphens (-), and underscores (_).
Enterprise Project
Enterprise project that the scheduled task belongs to. It is used to manage resources and members in the project.
The default enterprise project is default.
Time Zone
Time zone of the scheduled task.
Scheduled Type
Scheduled type of the task. It can be one-time or periodic execution.
- One-time execution: A scheduled task is executed once at a specified time.
- Periodic execution: The scheduled task is executed periodically on a specific schedule.
Execute Time
Time when the scheduled task is executed.
- When One-time execution is selected for Scheduled Type, you specify the start time for the scheduled task.
- When Periodic execution is selected for Scheduled Type, you specify the execution period and time for the scheduled task.
- Simple: Specify the date and time for the scheduled task to be automatically executed every week.
- Cron: Specify the execution period and time for the scheduled task by setting the second, minute, hour, day, month, and week of a cron expression.
Rule Expired
End time of a periodic scheduled task.
This parameter is displayed only when Periodic execution is selected for Scheduled Type.
Task Type
Type of the scheduled task.
IAM Permission Agency
IAM agency assumed by COC to execute the scheduled task.
Target Instance
The instance where the scheduled task is to be executed. An instance is selected by default.
Batch Policy
The batch policy for executing a scheduled task, which can be any of the following:
- Automatic: The system automatically sets the batches for executing the scheduled task on target instances.
- Manual: You set the batches for executing the scheduled task on target instances.
- No Batch: The scheduled task is executed on all target instances at the same time.
The maximum number of target instances in each batch is 100.
- Click Submit.
- Log in to the management console and go to the Elastic Cloud Server console.
- In the ECS list, select the ECSs for which you want to create a scheduled task.
- Above the ECS list, choose More > Set Scheduled Tasks > Set Scheduled Start or Set Scheduled Stop.
- (Optional) On the Enable COC and Grant Permissions page, read the service statement, select the check box, and click Enable and Authorize.
This page is displayed if COC is not enabled and authorized.
- On the Create Task page, set parameters required for the scheduled task.
Table 2 Parameters for configuring a scheduled task Parameter
Description
Task Name
Name of the scheduled task to be created.
The value can contain 3 to 100 characters, including letters, digits, hyphens (-), and underscores (_).
Enterprise Project
Enterprise project that the scheduled task belongs to. It is used to manage resources and members in the project.
The default enterprise project is default.
Time Zone
Time zone of the scheduled task.
Scheduled Type
Scheduled type of the task. It can be one-time or periodic execution.
- One-time execution: A scheduled task is executed once at a specified time.
- Periodic execution: The scheduled task is executed periodically at a specified time.
Execute Time
Execution time of the scheduled task.
- When One-time execution is selected for Scheduled Type, you specify the start time for the scheduled task.
- When Periodic execution is selected for Scheduled Type, you specify the execution period and time for the scheduled task.
- Simple: Specify the date and time for the scheduled task to be automatically executed every week.
- Cron: Specify the execution period and time for the scheduled task by setting the second, minute, hour, day, month, and week of a cron expression.
Rule Expired
End time of a periodic scheduled task.
This parameter is only displayed when Periodic execution is selected for Scheduled Type.
Task Type
Type of the scheduled task.
IAM Permission Agency
IAM agency assumed by COC to execute the scheduled task.
Target Instance
Target instances where the scheduled task is to be executed. Instances selected in step 2 are selected by default.
Batch Policy
Batch policy for executing a scheduled task. It can be any of the following:
- Automatic: The system automatically sets the batches for executing the scheduled task on target instances.
- Manual: You set the batches for executing the scheduled task on target instances.
- No Batch: The scheduled task is executed on all target instances at the same time.
The maximum number of target instances in each batch is 100.
- Click Submit.
Follow-up Procedure
On the Scheduled O&M page, you can enable, disable, modify, and delete scheduled tasks, and configure review and notification settings for scheduled tasks.
For details, see Managing Scheduled Tasks.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot