Help Center/ Elastic Cloud Server/ Billing/ Billing Modes/ Spot Pricing (for Spot Instances)
Updated on 2024-05-11 GMT+08:00

Spot Pricing (for Spot Instances)

ECSs that use spot pricing are called spot instances. You need to set a maximum price you are willing to pay for a spot instance. The maximum price must be greater than or equal to the market price but less than or equal to the pay-per-use price.

You can purchase a spot instance at a discounted rate, but there is a trade-off for that reduced cost. If inventory resources are insufficient or the market price exceeds your expected price, the spot instance will be reclaimed. Compared with pay-per-use and yearly/monthly ECSs, spot instances offer the same performance at a lower price.

Application Scenarios

Spot instances are a good option if you want to enjoy the same performance at a lower price.

  • Applicable scenarios

    Image rendering, stateless web services, DNA sequencing, offline analysis, function computing, batch computing, sample analysis, CI/CD, and test.

    When the market price is higher than the maximum price you are willing to pay or the inventory resources are insufficient, the spot instances will be reclaimed. Therefore, back up data when using such ECSs.

  • Inapplicable scenarios

    The applications need to run for a long time or deliver a high level of stability.

Billed Items

A spot instance consists of compute resources (vCPUs and memory), EVS disks, an image, and an EIP. You are billed for the following items:

Table 1 Billing items

Spot instance resources billed

Description

Market Price

The ECS (with vCPUs and memory) is billed at the market price.

Images

If an image, including a Marketplace image, is created along with a spot instance, this image is billed on a pay-per-use basis.

NOTE:
  • Public images are free of charge.
  • Private images: Private images for system disks and data disks can be used for free. For full-ECS images, you will be billed for using the server backup vault of CBR.
  • Shared images: Shared images for system disks and data disks can be used for free. For full-ECS image shared by others, you will be billed for using the server backup vault of CBR.

EVS disks

If an EVS disk (a system disk or a data disk) is created with a spot instance, this EVS disk is billed on a pay-per-use basis.

EIP bandwidth

If an EIP is purchased along with a spot instance and the EIP is billed by bandwidth, you are billed for the bandwidth on a pay-per-use basis.

EIP traffic

If an EIP is purchased with a spot instance and the EIP is billed by traffic, you are billed for the actual traffic used.

If you want to purchase a spot instance with a Linux image, a data disk, and an EIP that is billed by bandwidth, the prices will be displayed as follows:

The price includes:

  • The market price for the current specifications (including vCPUs and memory)
  • The EVS disks (system disks and data disks)
  • The EIP bandwidth

Billing Principles

The market price for ECSs fluctuates due to supply-and-demand changes. You can purchase spot instances at a low market price to reduce computing costs.

When purchasing a spot instance, you need to set the maximum price you are willing to pay for a specified flavor. A higher price means a higher probability of getting a spot instance.

  • If the maximum price you are willing to pay is greater than or equal to the current market price and the inventory resources are sufficient, you will be provisioned with a spot instance. This spot instance will be billed at the current market price.
  • If the maximum price you are willing to pay is less than the current market price, you will not be provisioned with a spot instance.

After purchasing a spot instance, you can use it like the other types of ECS. The system will periodically compare the maximum price you are willing to pay with the market price and check the inventory resources.

  • If the price you are willing to pay is greater than or equal to the market price and the inventory resources are sufficient, you can continue using the spot instance.
  • If the price you are willing to pay is less than the market price or the inventory resources are insufficient, you will be notified that the spot instance will be released, and then deleted in about 5 minutes.
Figure 1 Lifecycle of a spot instance

Billed Usage Period

The spot instance usage is calculated by the second and billed every hour. The billing starts when the spot instance is launched and ends when the spot instance is deleted.

It takes a certain time to launch a spot instance. The billing starts from the Launched time on the ECS Summary page.

For example, if you purchased a spot instance at 8:45:30 and deleted it at 8:55:30, you are billed for the 600 seconds from 8:45:30 to 8:55:30.

Price Change After Specification Change

Spot instance specifications cannot be changed.

Impact of Arrears

Figure 2 shows the statuses a spot instance can have throughout its lifecycle. After a spot instance is purchased, it enters the valid period and runs normally during this period. If your account goes into arrears, the instance enters a grace period and then a retention period.

Figure 2 Lifecycle of a spot instance

Arrears Reminder

The system will bill you for a spot instance after each billing cycle ends. If your account goes into arrears, we will notify you by email, SMS, or in-app message.

Impact of Arrears

  • If your account is insufficient to pay your amount due:

    Your account will go into arrears, and the spot instance will enter the grace period. Spot instance resources are not stopped immediately. You are still responsible for expenditures generated during the grace period. You can view the expenditures on the Billing Center > Overview page and pay any past due balance as needed.

  • If you do not bring your account balance current before the grace period expires:

    The ECS status turns to Frozen and it enters a retention period. You cannot perform any operations on the ECS.

  • If you do not bring your account balance current before the retention period ends:

    The compute resources (vCPUs and memory), EVS disks, and EIPs will be released and the data cannot be restored.

Billing for a Stopped Spot Instance

The billing for a stopped spot instance varies according to the ECS type.

Table 2 Billing for a stopped ECS

Instance Type

Description

Billed Items

Billed or Not

Action on Resources

Common instances

Common instances include:
  • Non-bare-metal instance
  • Instances without local disks
  • Instances without FPGA cards

ECS (compute resources including vCPUs and memory)

No

  • If ECSs are created from public resource pools, basic resources (vCPUs and memory) are no longer retained.

    The ECS may fail to be started due to insufficient resources. Wait patiently and try again later.

  • If ECSs are created on a DeH or in an edge AZ, basic resources (vCPUs and memory) will be retained.

Images

No

Resources are retained but are not billed.

GPU

No

After GPU-accelerated ECSs without local disks attached are stopped, GPU resources are no longer retained.

EVS disks (system disks and data disks)

Yes

The ECS resources are still billed based on the billing rules.

EIP bandwidth

Yes

Special instances

Special instances include:
  • BMS instances
  • Instances with local disks

    such as disk-intensive, ultra-high I/O ECSs.

  • ECSs with FPGA cards,

ECS (compute resources including vCPUs and memory)

Yes

The ECS resources are still billed based on the billing rules.

To stop the billing, you need to delete the instance and its associated resources.

Images

Yes

GPU

Yes

EVS disks (system disks and data disks)

Yes

EIP bandwidth

Yes

Conditions for Reclaiming

Huawei Cloud may reclaim your spot instance at any time. When it is being reclaimed, you cannot use it to create an image.

A spot instance may be reclaimed when:

  • The market price is higher than the maximum price you would be willing to pay.
  • The inventory resources are insufficient.
    • If a spot instance is reclaimed for either of the preceding reasons, the first hour of usage is not billed.
    • In the first settlement period, the instance is billed, regardless of whether it is running.
    • It takes 5 minutes to reclaim a spot instance. If during that 5 minutes, the spot price hour is exceeded, any time in excess of that hour will be billed at the new market price.
    • The spot instance price is updated every hour. After a spot instance is restarted, or it is stopped and then started, it is billed at the market price when the ECS starts.

Back up data on spot instances. You can configure the ECS to notify you of an upcoming release. For details, see Purchasing a Spot ECS.