All Products
Search
Document Center

CloudOps Orchestration Service:Monitor real-time prices and discounts of preemptible instances in a scaling group

Last Updated:Jun 10, 2026

Alibaba Cloud Elastic Compute Service (ECS) offers spot instances at discounts of up to 90%. When a scaling group is configured with a spot instance template, spot instances are created automatically during scale-out events. Because spot instance prices fluctuate with supply and demand, unexpected charges can appear on your monthly bill. CloudOps Orchestration Service (OOS) lets you track real-time prices and discounts for spot instances in a scaling group and send alerts before costs exceed your threshold.

Configure the execution schedule

  1. On the Scheduled O&M page, click Create. On the Create Scheduled O&M Task page, go to the Set Scheduled Task section. Set Scheduled Task Type to Executed Periodically, then configure the execution frequency.

    Spot instance prices change with supply and demand but rarely shift within a short window. Set the polling interval to 50 minutes to 1 hour. Shorter intervals risk API throttling, which causes gaps in monitoring data; longer intervals may miss a price spike before it affects your budget. The following figure shows an example configuration.image

Configure template parameters

  1. In the Select Template section, search for Alarm or enter the full template name ACS-ECS-AlarmWhenDiscountOrSpotPriceExceedsThresholdByScalingGroup in the search box, then click the search icon. Select the ACS-ECS-AlarmWhenDiscountOrSpotPriceExceedsThresholdByScalingGroup template.

  2. Configure the following parameters.

    1. RegionId: Select the region of the scaling group to monitor. Each task covers one region. To monitor scaling groups across multiple regions, create a separate scheduled O&M task for each region.

    2. ScalingGroupId: Enter the ID of the scaling group to monitor. You can enter multiple scaling group IDs.

    3. TaskType: Choose how to express the monitoring threshold.

      1. Discount: Triggers an alert based on the real-time discount rate. The discount is calculated as 1 - (spot price / on-demand price). For example, if the on-demand price for ecs.c6.large is USD 0.39/hour and the spot price is USD 0.071/hour, the discount is 82% (1 - 0.071/0.39 = 0.82). Select this option to receive an alert when the discount drops below a threshold you define—for example, when the discount falls below 80%.

      2. Price: Triggers an alert based on the real-time spot price. For example, if the on-demand price for ecs.c6.large is USD 0.39/hour and the spot price is USD 0.071/hour. Select this option to receive an alert when the spot price exceeds a threshold you define—for example, when the price rises above USD 0.1/hour.

    4. Threshold:

      1. If TaskType is Discount, enter an integer in the Threshold field. Examples:

      2. A value of 5 alerts when the discount falls below 95%.

      3. A value of 11 alerts when the discount falls below 89%.

      4. A value of 32 alerts when the discount falls below 68%.

      5. If TaskType is Price, enter the maximum acceptable hourly price in USD, such as 0.1.

    5. Configure the webhook URL for receiving alert notifications.