This topic describes how to create a preemptible instance in the ECS console.
Background information
To create and use a preemptible instance, take note of the following items:
- Set an appropriate bidding price and take into account the estimated market price
fluctuations. An appropriate bidding price can result in a higher probability of creating
a preemptible instance and ensure that the instance is not released due to small changes
in price. The bidding price must also meet your business expectations.
Note If you do not know what price to bid for your preemptible instances, we recommend that you use the market price at the time of purchase as the bidding price.
- Use an image that contains the configurations of all the required software to ensure that the instance can be started any time after it is created. You can also use user data of the instance to run commands when you start the instance. For more information, see Prepare user data.
- To prevent data loss caused by instance release, store important data in a storage medium that is not affected when preemptible instances are released, such as separately created cloud disks, OSS buckets, or ApsaraDB for RDS instances.
- Break your jobs down into smaller tasks by using grids, Hadoop, or queue-based architecture, or use checkpoints to save calculation results.
- Monitor the status of a preemptible instance by checking the instance release notifications from ECS. ECS updates the instance metadata five minutes before ECS releases a preemptible instance. You can obtain the status of a preemptible instance every minute by checking instance metadata. For more information, see Metadata.
- Run your applications on a pay-as-you-go instance and release the instance to verify whether your applications can automatically adjust themselves when the instance is released.
You can use developer tools such as Alibaba Cloud CLI, OpenAPI Explorer, and Alibaba
Cloud SDK to call the RunInstances operation and create a preemptible instance.
Note You can set the SpotStrategy parameter to SpotAsPriceGo to use the market price at the time of purchase. Alternatively, you can set the SpotStrategy parameter to SpotWithPriceLimit to use the acceptable maximum price.
This topic describes configurations to create a preemptible instance. For more information about other configurations for creating an instance, see Create an instance by using the wizard.