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 price, but their performance is the same as ECSs billed in other modes. If inventory resources are insufficient or the market price exceeds your expected price, your ECS resources will be automatically released and 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:
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 KooGallery image, is created along with a spot instance, this image is billed on a pay-per-use basis.
NOTE:
|
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, and set the maximum price, the prices will be displayed as follows.
The prices include:
- 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.
Billed Usage Period
The spot instance usage is calculated by the second and billed every hour (UTC+08:00). The billing starts when the spot instance is launched and ends when the spot instance is deleted (including when the market price is higher than what you are willing to pay or the inventory resources are insufficient).
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, a data disk, a bandwidth of 6 Mbit/s, and a preset maximum price of $0.0428 USD/hour) on April 18, 2023, 8:30:00. 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.
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 all 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.
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 KooGallery. |
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.
|
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 just examples. The actual prices are those displayed on ECS Pricing Details.
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 validity period and runs normally during this period. If your account goes into arrears, the instance enters a grace period and then a retention period.
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.
- For details about the grace period and retention period, see What Is a Grace Period of Huawei Cloud? How Long Is It? and What Is a Retention Period of Huawei Cloud? How Long Is It?
- For details about topping up your account, see Topping Up an Account.
Billing for a Stopped Spot Instance
The billing for a stopped spot instance varies according to the ECS type.
Instance Type |
Description |
Billed Items |
Billed or Not |
Action on Resources |
---|---|---|---|---|
Common instances |
Common instances include:
|
ECS (compute resources including vCPUs and memory) |
No |
|
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 resources are still billed based on the billing rules. |
||
EIP bandwidth |
Yes |
The resources are still billed based on the billing rules.
For details, see EIP Billing. |
||
Special instances |
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 (settled by hour), 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot