All Products
Search
Document Center

Elastic Compute Service:Use the scheduled startup and shutdown feature to reduce ECS costs

Last Updated:Oct 09, 2024

If your business workloads considerably fluctuate over time, such as when enterprise office software and collaboration tools are frequently used during working hours and seldom used during the night, a large number of Elastic Compute Service (ECS) instances are required to run the business workloads during a specific period of time of the day. After the business workloads return to normal, a large number of ECS instances remain idle and result in unnecessary costs. To resolve this issue, ECS provides the economical mode. You can stop ECS instances in economical mode to release specific resources of the instances. This way, you can retain the ECS instances and reduce costs. However, manually starting and stopping ECS instances is slow and may cause errors. You can use the scheduled startup and shutdown feature of CloudOps Orchestration Service (OOS) to automatically start and stop ECS instances to reduce human effort and save time. This topic describes how to use the scheduled startup and shutdown feature of OOS and the economical mode to reduce ECS costs.

Prerequisites

Pay-as-you-go ECS instances, including preemptible ECS instances, are available.

Before you begin

We recommend that you use tags to group existing ECS instances and to differentiate the ECS instances that you want to start and stop every day from the ECS instances that you do not want to start and stop every day. For example, add the machine:StopAndStart tag to the ECS instances that you want to start and stop at a specific point in time every day, and add the machine:Daily tag to the ECS instances that you do not want to start and stop every day. You can filter ECS instances by tag and batch start or stop the ECS instances to which a specific tag is added. For more information, see Overview.

image

Procedure

  1. Log on to the CloudOps Orchestration Service (OOS) console.

  2. In the left-side navigation pane, choose Automated Task > Common O&M Tasks. In the left-side navigation pane of the Common O&M Tasks page, click Scheduled Startup/Shutdown. Then, click Create.

    image

  3. In the Select Task Type section, configure the parameters, such as the Task Name, Execution Cycle, Task Type, Time Zone, Shutdown Time, Startup Time, and End Time parameters.

    For example, you can set the Startup Time parameter to 08:00:00 and the Shutdown Time parameter to 21:00:00 to start specific ECS instances at 08:00:00 and stop the instances at 21:00:00 every day. After you configure the preceding parameters, you can view the scheduled startup times and shutdown times in the value of the Execution Time Preview parameter.

    image

  4. Configure the Resource Type and Stop Mode parameters. Turn on or off Hibernate Instance.

    • Resource Type: Select ECS Instance.

    • Stop Mode: Select Economical Stop Mode.

      Note

      You can stop pay-as-you-go ECS instances in economical mode to retain instance data and configurations and reduce costs. After you stop pay-as-you-go ECS instances in economical mode, you are no longer charged for computing resources (vCPUs and memory), static public IP addresses, and images. You are still charged for resources. such as system disks, data disks, elastic IP address (EIPs), and snapshots. For more information, see Economical mode.

    • Hibernate Instance: Do not turn on this switch.

    • Permissions: Select Default Service-linked Role.

  5. Click Select Instances, click the Specify Instance Tags tab, configure the Select a region parameter, and then select an existing tag, such as machine:StopAndStart.

    image

  6. Click Advanced(Optional), set the Rate control type parameter to Concurrency-based Control and then configure the Concurrency and Error Threshold parameters.

    image

  7. In the Execution Settings(Optional) section, retain the default values for the parameters and click Create.

  8. In the Parameter Confirmation dialog box, verify that the configurations are correct and click OK.

    image

  9. View the execution details.

    On the Scheduled Startup/Shutdown page, find the scheduled startup and shutdown task that you created and click Details in the Actions column to view the execution details of the task.

    image

References

OOS is a comprehensive, automated O&M service provided by Alibaba Cloud free of charge to help you manage and execute O&M tasks in the cloud. You can use OOS to run repeated, event-driven, scheduled, and cross-region O&M tasks, batch handle multiple O&M tasks, and manage approval requests. OOS also serves as a standardization platform for O&M tasks and allows you to create templates from O&M manuals, operation manuals, and maintenance manuals based on best practices for Operations as Code. For more information, see What is OOS?