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.
Log on to the OOS console.
In the left-side navigation pane, choose Common O&M Tasks > Scheduled Startup/Shutdown.
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.
Set the Stop Mode parameter.
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.
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.
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.
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.
Click Confirm and Create.
On the Executions page, view the new execution. If the execution status appears as waiting, the scheduled startup and shutdown task is created.
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.
To view more information about the execution, click Details next to the execution. On the page that appears, click the Logs tab.