Copied.
Creating a Scheduled Task
Scenarios
Workspace supports scheduled O&M. You can create scheduled tasks to start, shut down, restart, and hibernate desktops or desktop pools, rebuild system disks, execute remote scripts, and take snapshots of desktops or desktop pools at a scheduled time. This function applies when you need to start, shut down, restart, or delete multiple desktops or desktop pools at a specific time.
For example, if your services have regular peaks and off-peaks, you can start desktops or desktop pools during peak hours and shut them down during off-peak hours to reduce costs. Manually starting or shutting down desktops or desktop pools is time-consuming and prone to errors. You can create scheduled tasks for automatic O&M on multiple desktops or desktop pools on schedule, reducing labor and time costs.
This section describes how to create scheduled tasks for desktops or desktop pools.
Procedure
You can create scheduled start, shutdown, restart, and hibernation tasks for one or more desktops or desktop pools.
Creating a Scheduled Shutdown Task
- After a desktop is shut down, personal application data that is not saved in the desktop may be lost.
- Scheduled shutdown tasks can be performed only on desktops that have been created and are running.
- Log in to the console.
- In the navigation pane, choose Tasks > Scheduled Tasks.
The Scheduled Tasks page is displayed.
- Click Create Scheduled Task in the upper right corner of the page.
The Create Scheduled Task dialog box is displayed.
- Configure a scheduled task.
- Task Type: Select Shutdown.
After configuring a scheduled shutdown task, the desktop will not be stopped when it is still connected, even if the scheduled time arrives. Instead, the task is automatically postponed to the next scheduled time. If you choose to force-execute the shutdown task, the desktop will be forcibly stopped when the scheduled time arrives.
- Scheduled Task Name: This parameter is user-defined.
- Execution Interval: You can select one of the following intervals:
- Specified time: The time is accurate to seconds.
- By day: You can specify Time, Executed Once Per, and Expires At.
- By week: You can specify Weekday, Time, and Expires At.
- By month: You can specify Month, Day, Time, and Expires At.
- Time Zone: The local time zone is selected by default.
- Description (Optional): This parameter is optional and user-defined.
- Task Type: Select Shutdown.
- Determine whether to notify users.
- Yes: Set Earlier Than Scheduled Task to a value ranging from 1 to 10,080 minutes. Enter the notification, which can only be text in 1 to 400 characters.
- No: Perform 6.
Notifications are supported only for Windows.
- Click Next: Select Object. The Select Object page is displayed.
- Select target objects as required. The objects include all desktops, desktop, desktop pool, and desktop tag.
You can search for desktops in batches by entering multiple filter criteria. Use commas (,) to separate multiple values, for example, Desktop1,Desktop2,Desktop3.
- Click Create Now.
Creating a Scheduled Startup Task
Scheduled startup tasks can be performed only on desktops or desktop pools that have been created and shut down.
- Log in to the console.
- In the navigation pane, choose Tasks > Scheduled Tasks.
The Scheduled Tasks page is displayed.
- Click Create Scheduled Task in the upper right corner of the page.
The Create Scheduled Task dialog box is displayed.
- Configure a scheduled task.
- Task Type: Select Startup.
- Scheduled Task Name: This parameter is user-defined.
- Execution Interval: You can select one of the following intervals:
- Specified time: The time is accurate to seconds.
- By day: You can specify Time, Executed Once Per, and Expires At.
- By week: You can specify Weekday, Time, and Expires At.
- By month: You can specify Month, Day, Time, and Expires At.
- Time Zone: The local time zone is selected by default.
- Description (Optional): This parameter is optional and user-defined.
- Click Next: Select Object. The Select Object page is displayed.
- Select target objects as required. The objects include all desktops, desktop, desktop pool, and desktop tag.
You can search for desktops in batches by entering multiple filter criteria. Use commas (,) to separate multiple values, for example, Desktop1,Desktop2,Desktop3.
Creating a Scheduled Restart Task
- After a desktop or desktop pool is restarted, personal application data that is not saved in the desktop may be lost.
- Scheduled restart tasks can be performed only on desktops or desktop pools that have been created and are running.
- Log in to the console.
- In the navigation pane, choose Tasks > Scheduled Tasks.
The Scheduled Tasks page is displayed.
- Click Create Scheduled Task in the upper right corner of the page.
The Create Scheduled Task dialog box is displayed.
- Configure a scheduled task.
- Task Type: Select Restart.
After configuring a scheduled restart task, the desktop will not be restarted when it is still connected, even if the scheduled time arrives. Instead, the task is automatically postponed to the next scheduled time. If you choose to force-execute the restart task, the desktop will be forcibly restarted when the scheduled time arrives.
- Scheduled Task Name: This parameter is user-defined.
- Execution Interval: You can select one of the following intervals:
- Specified time: The time is accurate to seconds.
- By day: You can specify Time, Executed Once Per, and Expires At.
- By week: You can specify Weekday, Time, and Expires At.
- By month: You can specify Month, Day, Time, and Expires At.
- Time Zone: The local time zone is selected by default.
- Description (Optional): This parameter is optional and user-defined.
- Task Type: Select Restart.
- Determine whether to notify users.
- Yes: Set Earlier Than Scheduled Task to a value ranging from 1 to 10,080 minutes. Enter the notification, which can only be text in 1 to 400 characters.
- No: Perform 6.
Notifications are supported only for Windows.
- Click Next: Select Object. The Select Object page is displayed.
- Select target objects as required. The objects include all desktops, desktop, desktop pool, and desktop tag.
You can search for desktops in batches by entering multiple filter criteria. Use commas (,) to separate multiple values, for example, Desktop1,Desktop2,Desktop3.
- Click Create Now.
Creating a Scheduled Hibernation Task
Scheduled hibernation tasks can be performed only on desktops or desktop pools that have been created and are running.
- Log in to the console.
- In the navigation pane, choose Tasks > Scheduled Tasks.
The Scheduled Tasks page is displayed.
- Click Create Scheduled Task in the upper right corner of the page.
The Create Scheduled Task dialog box is displayed.
- Configure a scheduled task.
- Task Type: Select Hibernation.
- Scheduled hibernation can be performed only on Windows desktops.
- After configuring a scheduled hibernation task, the desktop will not be hibernated when it is still connected, even if the scheduled time arrives. Instead, the task is automatically postponed to the next scheduled time. If you choose to force-execute the hibernation task, the desktop will be forcibly hibernated when the scheduled time arrives.
- Scheduled Task Name: This parameter is user-defined.
- Execution Interval: You can select one of the following intervals:
- Specified time: The time is accurate to seconds.
- By day: You can specify Time, Executed Once Per, and Expires At.
- By week: You can specify Weekday, Time, and Expires At.
- By month: You can specify Month, Day, Time, and Expires At.
- Time Zone: The local time zone is selected by default.
- Description (Optional): This parameter is optional and user-defined.
- Task Type: Select Hibernation.
- Determine whether to notify users.
- Yes: Set Earlier Than Scheduled Task to a value ranging from 1 to 10,080 minutes. Enter the notification, which can only be text in 1 to 400 characters.
- No: Perform 6.
Notifications are supported only for Windows.
- Click Next: Select Object. The Select Object page is displayed.
- Select target objects as required. The objects include all desktops, desktop, desktop pool, and desktop tag.
You can search for desktops in batches by entering multiple filter criteria. Use commas (,) to separate multiple values, for example, Desktop1,Desktop2,Desktop3.
- Click Create Now.
Creating a Scheduled System Disk Rebuilding Task
For details about the impact and constraints of system disk rebuilding, see Rebuilding a System Disk or Rebuilding System Disks in a Desktop Pool.
- Log in to the console.
- In the navigation pane, choose Tasks > Scheduled Tasks.
The Scheduled Tasks page is displayed.
- Click Create Scheduled Task in the upper right corner of the page.
The Create Scheduled Task dialog box is displayed.
- Configure a scheduled task.
- Task Type: Select System disk recomposing.
- Scheduled Task Name: This parameter is user-defined.
- Rebuilding Method: Select Reinstall OS or Change OS.
- Reinstall OS (default value): Use the original desktop image to rebuild the system disk.
- Change OS: Use a new image to rebuild the system disk.
- Image Type: This parameter is valid only when Re-establishment Mode is set to Change OS. You can select Public image or Private image, and then select the OS and image of the selected type.
- Execution Interval: You can select one of the following intervals:
- Specified time: The time is accurate to seconds.
- By day: You can specify Time, Executed Once Per, and Expires At.
- By week: You can specify Weekday, Time, and Expires At.
- By month: You can specify Month, Day, Time, and Expires At.
- Time Zone: The local time zone is selected by default.
- Description (Optional): This parameter is optional and user-defined.
- Enter Reinstalling the System Disk to confirm the system disk rebuilding.
- Determine whether to notify users.
- Yes: Set Earlier Than Scheduled Task to a value ranging from 1 to 10,080 minutes. Enter the notification, which can only be text in 1 to 400 characters.
- No: Perform 6.
Notifications are supported only for Windows.
- Click Next: Select Object. The Select Object page is displayed.
After you click Next: Select Object, the authorization description is displayed for the first time.
Cloud service administrator permissions: Workspace supports scheduled system disk rebuilding and auto scaling. Therefore, the tenant administrator permissions are required.
After the permission is granted (only once), an agency named workspace_admin_trust will be created in IAM. Do not delete or modify the agency when performing a scheduled task or using a desktop pool. For details, see System Agencies.
- Select target objects as required. The objects include all desktops, desktop, desktop pool, and desktop tag.
You can search for desktops in batches by entering multiple filter criteria. Use commas (,) to separate multiple values, for example, Desktop1,Desktop2,Desktop3.
- Click Create Now.
Creating a Scheduled Remote Script Execution Task
- Log in to the console.
- In the navigation pane, choose Tasks > Scheduled Tasks.
The Scheduled Tasks page is displayed.
- Click Create Scheduled Task in the upper right corner of the page.
The Create Scheduled Task dialog box is displayed.
- Configure a scheduled task.
- Task Type: Select Remote script.
- Scheduled Task Name: This parameter is user-defined.
- Execution Interval: You can select one of the following intervals:
- Specified time: The time is accurate to seconds.
- By day: You can specify Time, Executed Once Per, and Expires At.
- By week: You can specify Weekday, Time, and Expires At.
- By month: You can specify Month, Day, Time, and Expires At.
- Time Zone: The local time zone is selected by default.
- Description (Optional): This parameter is optional and user-defined.
- Add Script: Click Add Script. In the window displayed, select the desired scripts and click OK.
- Specify Timeout. The value ranges from 1 to 600 minutes.
- Determine whether to notify users.
- Yes: Set Earlier Than Scheduled Task to a value ranging from 1 to 10,080 minutes. Enter the notification, which can only be text in 1 to 400 characters.
- No: Perform 7.
Notifications are supported only for Windows.
- Select I've checked. No problem. and click Next: Select Object. The Select Object page is displayed.
- Select target objects as required. The objects include all desktops, desktop, desktop pool, and desktop tag.
You can search for desktops in batches by entering multiple filter criteria. Use commas (,) to separate multiple values, for example, Desktop1,Desktop2,Desktop3.
- Click Next: Execute Configuration. The Script Execution Configuration page is displayed.
- Select an execution policy, as shown in Table 1.
Table 1 Execution policies Policy Execution Method
Parameter
Operation
Delivery to all
By default, the script is executed for all selected desktops or desktop pools.
- Set Execution Policy to Delivery to all.
- Set the script execution timeout, which ranges from 1 to 600 minutes.
Gray delivery
Specified: whether the desktop or desktop pool for which the script is to be executed belongs to the first batch of objects.
- Set Execution Policy to Gray delivery and Gray Rule to Specified.
- Toggle on the First-Batch Execution (Yes/No) switch and select a desktop. NOTE:
First-batch execution is allowed only for running desktops whose login status is Disconnected, In use, or Ready.
- Set the script execution timeout, which ranges from 1 to 600 minutes.
- Enter the threshold for stopping executing the next batch if the number of desktops with script execution failure in the first batch is greater than or equal to x.
Random: The desktop or desktop pool for which the script is to be executed is randomly selected.
NOTE:The gray delivery policy divides desktops into the gray batch and non-gray batch. If the number of desktops with script execution failure in the first batch is greater than or equal to x, scripts will not be executed for desktops in the non-gray batch. If the threshold x is not reached, scripts will be executed for desktops in the non-gray batch.
- Set Execution Policy to Gray delivery and Gray Rule to Random.
- Set the script execution timeout, which ranges from 1 to 600 minutes.
- Enter the threshold (x) for the number of desktops that are randomly selected for script execution in the first batch.
- Enter the threshold for stopping executing the next batch if the number of desktops with script execution failure in the first batch is greater than or equal to x.
- Click Create Now.
Creating a Scheduled Snapshot Creation Task
- Log in to the console.
- In the navigation pane, choose Tasks > Scheduled Tasks.
The Scheduled Tasks page is displayed.
- Click Create Scheduled Task in the upper right corner of the page.
The Create Scheduled Task dialog box is displayed.
- Configure a scheduled task.
- Task Type: Select Snapshot creation.
- The Huawei Cloud Workspace snapshot service is in the open beta test (OBT) and is not charged. The service will be charged in the future.
- You can save a maximum of five system disk snapshots and five data disk snapshots for each desktop, including those created on the console and those created by end users.
- Rebuilding the system disk, deleting a desktop, deleting a disk, or unbinding a desktop from a user and binding it to another user will automatically delete the snapshots of the desktop.
- Scheduled Task Name: This parameter is user-defined.
- Snapshots Apply To
- System disks and data disks: A snapshot is created for both the system disk and data disks.
- System disks only: A snapshot is created only for the system disk.
- Data disks only: A snapshot is created only for the data disks.
- Execution Interval: You can select one of the following intervals:
- Specified time: The time is accurate to seconds.
- By day: You can specify Time, Executed Once Per, and Expires At.
- By week: You can specify Weekday, Time, and Expires At.
- By month: You can specify Month, Day, Time, and Expires At.
- Time Zone: The local time zone is selected by default.
- Description (Optional): This parameter is optional and user-defined.
- Task Type: Select Snapshot creation.
- Determine whether to notify users.
- Yes: Set Earlier Than Scheduled Task to a value ranging from 1 to 10,080 minutes. Enter the notification, which can only be text in 1 to 400 characters.
- No: Perform 6.
Notifications are supported only for Windows.
- Click Next: Select Object. The Select Object page is displayed.
- Select target objects as required. The objects include all desktops, desktop, desktop pool, and desktop tag.
You can search for desktops in batches by entering multiple filter criteria. Use commas (,) to separate multiple values, for example, Desktop1,Desktop2,Desktop3.
- Click Create Now.
Follow-up Operations
After a scheduled task is created, you can enable, disable, edit, modify, and delete the scheduled task, and modify objects on the Scheduled Tasks page. For details, see Scheduled Task Management.
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