Updated on 2024-10-18 GMT+08:00

Purchasing a Spot ECS

Scenarios

A spot ECS is billed in spot pricing mode. You can purchase and use such ECSs at a discount price. A spot ECS performs as well as the ECSs with the same specifications in other billing modes. However, when inventory resources are insufficient, or the market price increases and exceeds your expected price, the system will automatically release your ECS resources and reclaim the ECSs.

Compared with pay-per-use and yearly/monthly ECSs, spot ECSs offer the same level of performance while at lower costs.

For more information about spot ECSs, see Spot Pricing (for Spot Instances).

Notes and Constraints

  • Only KVM ECSs support spot pricing payments. For details about supported ECS flavors, see the information displayed on the management console.
  • The market prices of the ECSs of the same flavor may vary depending on AZs.
  • Spot ECSs do not support OS change.
  • Spot ECSs do not support automatic recovery.
  • Spot ECSs do not support specifications modification.
  • Spot ECSs cannot be created using a KooGallery image.
  • Spot ECSs cannot be switched to yearly/monthly ECSs.
  • Spot ECSs do not support system disk detachment.
  • When a spot ECS is being reclaimed:
    • It cannot be used to create system disk images and full-ECS images. However, data disks of the ECS can be used to create data disk images.
    • It cannot be deleted.
  • By default, the data disks and EIP of a spot ECS will not be released after it is reclaimed. If you want to be notified when a spot ECS is reclaimed so that you can determine whether to manually release data disks and EIP, set a reclaim notification.

Purchasing a Spot ECS

Follow the instructions provided in Purchasing an ECS, Login Overview (Windows), or Login Overview (Linux) to buy and log in to spot ECSs. Pay attention to the following settings:

When purchasing a spot ECS:

  • Set Billing Mode to Spot pricing.

    In Spot pricing billing mode, your purchased ECS is billed based on the service duration at a lower price than that of a pay-per-use ECS with the same specifications. However, a spot ECS may be reclaimed at any time based on the market price or changes in supply and demand.

  • Set Maximum Price, which can be Automatic or Manual.
    • Automatic is recommended, which uses the pay-per-use price as the highest price you are willing to pay for a spot ECS.
    • Manual requires you to set the upper price limit for a spot ECS. The maximum price must be greater than or equal to the market price and less than or equal to the pay-per-use price.
  • Click Next, confirm that the specifications and price are correct, agree to the service agreement, and click Submit.

    A spot ECS may be reclaimed by the system. Therefore, back up your data.

(Optional) Enabling Reclaim Notifications

After purchasing a spot ECS, you can use it like using the ECSs in other billing modes. However, a spot ECS may be reclaimed at any time based on the market price or changes in supply and demand.

You can enable reclaim notifications to be notified ahead of about 5 minutes before the system starts to release your spot ECS if the maximum price you are willing to pay is lower than the market price or the inventory resources are insufficient.

Use Cloud Trace Service (CTS) and Simple Message Notification (SMN) to enable notifications. For details, see Cloud Trace Service User Guide.

  1. Enable CTS. For details, see Enabling CTS.

    Once CTS is enabled, the system automatically identifies the cloud services enabled on the cloud platform, obtains key operations on the services, and reports traces of these operations to CTS.

  2. Configure reclaim notifications.

    You can configure key event notifications on CTS so that SMN can send messages to notify you of key operations. This function is triggered by CTS, but notifications are sent by SMN.

    1. Log in to the management console.
    2. Click in the upper left corner and select your region and project.
    3. Under Management & Governance, click Cloud Trace Service.
    4. In the navigation pane on the left, choose Key Event Notifications.
    5. Click Create Key Event Notification in the upper right corner of the page and set parameters listed in Table 1.
      Table 1 Parameters for configuring key event notifications

      Type

      Parameter

      Configuration

      Basic Information

      Notification Name

      The value is user-defined, for example, spottest.

      Operation

      Operation Type

      Select Custom.

      Operation List

      Choose ECS > server > interruptServer and click Add.

      User

      Specified users

      If you do not specify users, CTS notifies all users when key operations are initiated.

      Topic

      Send Notification

      Select Yes.

      SMN Topic

      Select a topic from the drop-down list. If there are no proper SMN topics, create one.

      1. Click Create Topic to switch to the SMN console.
      2. On the SMN console, choose Topic Management > Topics. Then, click Create Topic and set parameters as required. For details, see Creating a Topic.
      3. Locate the newly added topic and click Add Subscription in the Operation column. Then, you can receive notifications sent for the topic. For details, see Adding a Subscription to a Topic.

      After the configuration is complete, you will receive a notification 5 minutes before the system deletes your spot ECS.

  3. (Optional) View reclaimed spot ECSs.

    1. Under Management & Governance, click Cloud Trace Service.
    2. In the navigation pane on the left, choose Trace List.
    3. Specify filter criteria listed in Table 2 and search for traces as needed.
      Table 2 Setting filter criteria to search for reclaimed ECSs

      Parameter

      Configuration

      Trace Source

      ECS

      Resource Type

      server

      Search By

      Trace name > interruptServer

      Operator

      All operators

      Trace Status

      All trace statuses

    4. Locate the target trace and expand the trace details.
    5. Click View Trace in the Operation column for details.