What is OOS?
Operation Orchestration Service (OOS) is a free platform that provides comprehensive, automated operations and maintenance (O&M) services. It automatically manages and runs O&M tasks. You can use OOS to manage and run event-driven, scheduled, and cross-region O&M tasks. OOS also allows you to handle multiple O&M tasks at a time and configure the approval and notification features as required. OOS provides best practices of operations as code and helps you perform O&M in a standard manner. For more information about OOS, see What is OOS.
Assume that you need a large number of Elastic Compute Service (ECS) instances to maintain your business during the specified peak hours every day. If you still retain the ECS instances beyond the peak hours, the maintenance cost will be high. In this case, you may want to retain the ECS instances without generating extra costs.
ECS provides the No Fees for Stopped Instances feature that allows some ECS resources to be recycled while retaining the ECS instances, reducing instance costs. You can stop some ECS instances beyond the peak hours and restart them during the peak hours without the need to initialize them. This gives rise to another issue, that is, how to start and stop ECS instances on a regular basis.
This issue is not complicated but involves a large number of ECS instances. Using manual operations is a choice, but it is time-consuming and error-prone. The best solution is using an automatic system to enable scheduled startup and shutdown. Currently, you can use OOS to implement such a solution based on the No fees for stopped instances feature of ECS.
- You must enable the No Fees for Stopped Instances feature for the specified ECS instances. For more information about how to enable this feature and its impacts, see Enable the featue and Impacts in the topic No Fees for Stopped Instances (VPC-Connected).
Group and tag ECS instances
Group and tag the ECS instances that need to be started and stopped on a regular basis. For example, you can group ECS instances with two tags, namely, machine:Stop and machine:Daily. In this way, you can operate ECS instances with the same tag at a time.
Configure scheduled startup and shutdown
Use OOS to schedule ECS instances with a specified tag to start and stop on a regular basis. Make sure that the No Fees for Stopped Instances feature has been enabled for these ECS instances. The following figure shows the process.
- Log on to the OOS console.
- Choose Common O&M Tasks > Scheduled Startup/Shutdown in the left-side navigation pane.
- On the Scheduled Startup/Shutdown page, click Create Task.
- Click Select Operations. In this section, set the name, time zone, startup time, shutdown time, and frequency of the task.
- Click Select Instances. In this section, select Specify Instance Tags and click Select Tags.
- Click Advanced. In this section, select Concurrency-based Control for the Rate Control field and specify the concurrency and error threshold. You can also use the default values.
- Click Confirm and Create. Then, OOS will automatically start and stop the specified ECS instances as scheduled.
- On the Scheduled Startup/Shutdown page, find the target task and click Details in the Actions column. Click Scheduled Execution List. You can find the future scheduling information on the Last Trigger Time Preview tab and the execution history on the Historical Execution List tab.
- Go to the ECS console and search for ECS instances with the specified tag. You can find that these ECS instances are in the Stopped state except during the specified running period. They automatically start and stop as scheduled.
In the OOS console, you can configure scheduled startup and shutdown for a large number of ECS instances with the same tag at a time. You can enable the No Fees for Stopped Instances feature for these ECS instances in advance so that some ECS resources can be recycled. This solution saves both time and costs.