When you use public resources to create Data Science Workshop (DSW) instances, you can create preemptible instances to reduce operating costs. This topic describes how to configure a preemptible DSW instance.
User Guide
Pay-as-you-go instances created by using public resource groups can be configured as preemptible instances. Preemptible instances have the same features and performance as regular instances and use the pay-as-you-go billing method. Fees are calculated on a minute-by-minute basis and bills are settled on an hourly basis. Preemptible instances have the following characteristics:
Dynamic pricing: The instance price fluctuates based on the market supply and demand but does not exceed the pay-as-you-go price of the instance type. This saves up to 90% of costs.
Release mechanism: If the market price exceeds the set maximum price, the instance will be released during the non-protection period. To avoid data loss, we recommend that you periodically save intermediate data during task execution.
Billing
Instance usage duration | Billing rule | Calculation formula |
1 hour or less | Market price at the time of purchase | Market price at the time of purchase x Billable duration |
More than 1 hour | Market price in each period | Market price at the time of purchase × 1 hour + Σ(Real-time market price in each period 1 × Time duration in each period) |
No specified usage duration | Market price in each period | Σ(Real-time market price in each period 1 × Time duration in each period) |
Usage notes
After you select an instance type, if the inventory of the instance type is insufficient, you cannot turn on Bidding Purchase.
Resources of bidding purchases are not covered by savings plans.
If you have a free or paid DSW resource plan and select an instance type that can be purchased by using resource plans, the original price prevails regardless of whether you turn on Bidding Purchase or the market price at the time of purchase. If you have resource plans, we recommend that you do not use the bidding purchase feature.
The market price of the same instance type may vary in different zones. If you specify a vSwitch, we recommend that your bidding price cannot be less than the lowest price in the zone in which the vSwitch resides. Otherwise, the purchase may fail.
For example, you select the following instance type and configure a vSwitch in Zone H of Hangzhou in the network information. If your bidding price is less than USD 0.8603, the purchase may fail.

Procedure
Go to the Data Science Workshop (DSW) page.
Log on to the PAI console.
On the Overview page, select a region in the top navigation bar.
In the left-side navigation pane, click Workspaces. On the Workspaces page, click the name of the workspace that you want to manage.
In the left-side navigation pane, choose .
Click Create Instance. On the Create Instance page, configure the parameters described in the following table. For information about other parameters, see Create a DSW instance.
Parameter
Description
Instance type
Select Public Resources.
Bidding Purchase
Turn on Bidding Purchase.
Instance Usage Duration
Valid values:
1-Hour Usage: Your preemptible instance is not released during the usage duration. After the duration ends, the system checks the market price and the inventory of the instance type every 5 minutes to determine whether you can retain the instance.
No Specified Usage Duration: Preemptible instances have no protection period. Preemptible instances without a protection period are more cost-effective than those with a protection period.
Maximum Instance Price
Valid values:
Use Automatic Bid: If you are unable to determine a bidding price for your preemptible instances, we recommend that you use the market price at the time of purchase as the bidding price.
When the inventory is sufficient, the system bids based on the market price but does not bid higher than the pay-as-you-go price of the instance type.
When the inventory is insufficient, the instance is automatically released.
Set Maximum Price: You can specify a maximum bidding price for your preemptible instances.
When the maximum bidding price is greater than or equal to the market price and the inventory is sufficient, the preemptible instance is purchased, and the instance runs. The instance is billed at the current market price.
If the maximum bidding price is less than the market price or the inventory is insufficient, the purchase fails and the instance is automatically released. We recommend that you keep an eye on the trend of historical prices when you configure this parameter.
NoteWe recommend that you consider market price fluctuations and set a bid strategy to improve the success rate of creation and reduce the risk of resource recycling due to price changes.

After you confirm the configurations, click Yes.
Protection strategies for data and environments
Similar to regular pay-as-you-go instances, each DSW preemptible instance is equipped with 100 GiB of free system disks. If an instance is released due to a market price increase, the environment configurations and data in the system disk are retained and can be restored at the next startup.
However, the running processes cannot be recovered. Therefore, when you use a preemptible instance, we recommend that you save the intermediate data generated during task execution in a timely manner.