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: Only KylinOS and UnionTechOS images are billed.
  • 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.
  • Marketplace images: See the price provided by the image provider.

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:

Figure 1 Example prices (for a spot instance)

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 2 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.

Billing Examples

A spot instance is billed by the usage duration (in seconds). The unit price is the market price when the spot instance is purchased. When the market price is higher than what you are willing to pay or the inventory resources are insufficient, the spot instance will be released.

Suppose you purchased a spot instance (c6.large.4 with a CentOS 7.9 64-bit image and a bandwidth of 6 Mbit/s) on April 18, 2023, 8:30:00 at the price of $0.0428 USD/hour. The spot instance was released on April 18, 2023, 10:30:00, because the market price was higher than what you are willing to pay.

You are billed for the usage of 7,200 seconds.

Table 2 Billed usage of the spot instance

Billed Hour

Billed Usage Period

Usage Duration

Market Price

Your Maximum Price

Market Price VS Your Maximum Price

Unit Price of the Spot Instance

8:00:00 – 9:00:00

8:30:00 – 9:00:00

1,800 seconds

$0.0228 USD/hour

$0.0428 USD/hour

Market price < Your maximum price

$0.0228 USD/hour

9:00:00 – 10:00:00

9:00:00 – 10:00:00

3,600 seconds

$0.0328 USD/hour

$0.0428 USD/hour

Market price < Your maximum price

$0.0328 USD/hour

10:00:00 – 11:00:00

10:00:00 – 10:30:00

1,800 seconds

$0.0428 USD/hour

$0.0428 USD/hour

Market price = Your maximum price

$0.0428 USD/hour

You are billed for both usage periods. ECS resources are billed individually as described in Table 3. The price displayed in the pricing details is per hour, so you need to divide it by 3,600 to obtain the price for each second and then multiply the per-second price by the total number of seconds.

Table 3 Formulas for billing a spot instance

Resource

Formula

Unit Price

ECS (compute resources including vCPUs and memory)

Unit price of the ECS flavor x Required duration

For details, see Specification Price in ECS Pricing Details.

Images

Unit price of the image x Required duration

See the price displayed on the purchase page or the Marketplace.

EVS disks (system disks and data disks)

Unit price of an EVS disk x Required duration

See EVS Pricing Details or Disk Price in ECS Pricing Details.

EIP bandwidth

Tiered pricing based on fixed bandwidth.

  • 0 Mbit/s to 5 Mbit/s (included): billed at a fixed unit price per Mbit/s
  • Greater than 5 Mbit/s: billed at a different price per Mbit/s

See EIP Pricing Details or Bandwidth Price in ECS Pricing Details.

Figure 3 shows how the total price is calculated.

The prices in the figure are for reference only. The actual calculation is subject to the prices in the ECS Pricing Details.

Figure 3 Total price for a spot instance

Price Change After Specification Change

Spot instance specifications cannot be changed.

Impact of Arrears

Figure 4 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 4 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 4 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.