Preemptible instances may be forcefully reclaimed due to price fluctuations or changes in supply and demand. If important data is stored on your preemptible instance, you can configure the system disk or data disks of the instance not to be released with the instance to prevent data loss. This way, the system disk or data disks are retained as data disks when the instance is released. This topic describes how to configure the system disk or data disks of a preemptible instance not to be released with the instance when you create the instance and how to attach the disks as data disks to a new instance to restore data after the preemptible instance is reclaimed.
Working principles
When you create a preemptible instance, you can configure the system disk or data disks of the instance not to be released with the instance. When the preemptible instance is forcefully reclaimed, the system disk or data disks of the instance are retained as data disks. You can use the retained disks to restore the data of the preemptible instance.
The following figure shows the O&M workflow in this scenario.
Step 1: Create a preemptible instance
When you create a preemptible instance, configure the system disk or data disks not to be released with the instance. For information about how to create a preemptible instance, see Create an instance on the Custom Launch tab.
When you create a preemptible instance, take note of the following basic settings:
Set the Billing Method parameter to Preemptible Instance.
In the Storage section, clear Release with Instance for disks.
Step 2: Attach data disks
For information about the prerequisites for attaching data disks, see Attach a data disk.
You can select or create an instance to attach the retained data disks. For information about how to create an instance, see Create an instance on the Custom Launch tab.
This section describes how to attach a data disk on the Instances page.
You can also choose
in the left-side navigation pane of the ECS console. Find the disk that you want to attach and click Attach in the Actions column to attach the disk to an instance.Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
Find the instance to which you want to attach the data disks and click the instance ID.
Click the Cloud Disk tab. In the upper-left corner of the Cloud Disk tab, click Attach Disks.
In the Attach Disk dialog box, configure parameters to attach a disk.
Select the disk that you want to attach and configure the release settings for the disk. The following table describes the parameters.
Parameter or option
Description
Disk
Select the disk that you want to attach.
NoteYou can choose
to view the information of the retained disks of the reclaimed preemptible instance in the disk list.Release Disk with Instance
If you select this option, the disk is automatically released when the instance is released. If you do not select this option, the disk is retained when the instance is released.
Delete Automatic Snapshots While Releasing Disk
If you select this option, the automatic snapshots of the disk are released when the disk is released. We recommend that you do not select this option and instead retain the automatic snapshots of the disk.
Click Next.
If a data disk is attached to the new instance, a message appears indicating that the disk is attached to the instance, and the disk enters the In Use state.