All Products
Search
Document Center

Operation Orchestration Service:Start or shut down ECS instances at a scheduled time

Last Updated:May 11, 2021

Background information

You can use the Scheduled Startup/Shutdown feature of Operation Orchestration Service (OOS) to start or shut down multiple Elastic Compute Service (ECS) instances at a scheduled time. You can run a scheduled startup or shutdown task every day or on the specified days of each week.

Procedure

  1. Log on to the OOS console.

  2. In the left-side navigation pane, choose Common O&M Tasks > Scheduled Startup/Shutdown.

  3. In the Select Task Type section, set the Task Name, Execution Cycle, Task Type, Time Zone, Startup Time, Shutdown Time, and End Time parameters. The duration between the startup time and the shutdown time must be a minimum of 10 minutes.

  4. Set the Stop Mode parameter.

  5. Set the Hibernation Mode parameter. A hibernated instance is different from a stopped instance. A hibernated instance automatically restores the applications on the instance to the original status before hibernation when the instance is awoken. This allows the instance to resume the provision of services in a short period of time.2

  6. Set the Permissions parameter to Specify RAM Role and Use Permissions Granted to This Role. Select a Resource Access Management (RAM) role from the OOSAssumeRole drop-down list.

    In this example, select OOSServiceRole.

    If no RAM roles are available, create a RAM role for OOS. For more information, see Grant RAM permissions for OOS. If you do not require further details about how to create a RAM role for OOS, you can directly click View Authorization Policies and Manual Authorization to complete RAM permission settings.

  7. In the Select Instances section, select Specify Instance Tags and click Add.

    Valid values for the Instance Selection Methods parameter include Manually Select Instances and Specify Instance Tags. In this example, select Specify Instance Tags and enter the preset tag key and value.

  8. Click Advanced(Optional).

    Set the Concurrency and Error Threshold parameters as required.

    Valid values for the Rate Control parameter include Concurrency-based Control or Batch-based Control. In this example, select Concurrency-based Control.

  9. Click Confirm and Create.

  10. On the Executions page, view the new execution. If the execution status appears as waiting, the scheduled startup and shutdown task is created.

  11. When the scheduled startup time or shutdown time is reached, the execution status changes to running and the specified ECS instance automatically starts or shuts down.

  12. To view more information about the execution, click Details next to the execution. On the page that appears, click the Logs tab.