All Products
Search
Document Center

Elastic Compute Service:Restore data when a preemptible instance is reclaimed

Last Updated:Jul 05, 2024

Preemptible instances may be forcefully reclaimed due to price fluctuations or changes in demand and supply. Before a preemptible instance is forcefully reclaimed, you are notified that the instance will be automatically released in 5 minutes. If you stored important data or configurations on the preemptible instance, you can restore the data by using different methods as described in the following table.

Scenario

Description

References

You want to restore only the data that is stored on the system disk or data disks of a preemptible instance and do not want to retain the system environments.

Disable the Release Disk with Instance feature for the system disk or data disks of the preemptible instance. This way, the system disk or data disks are retained as data disks when the preemptible instance is forcefully reclaimed. Attach the retained disks as data disks to a different instance to restore the data of the preemptible instance.

Method 1: Restore the data of an instance by attaching the system disk or data disks of the instance to another instance

Important data is stored on the system disk and data disks of the preemptible instance whose data you want to restore. You want to restore the environments that are configured on the preemptible instance.

After an interruption event of the preemptible instance is received, the system uses SDK for Java 2.0 code to create a custom image from the instance and then create a new preemptible instance from the custom image. This way, the data of the original preemptible instance can be restored.

Method 2: Create a new preemptible instance by using a custom image that was created from a source preemptible instance

No important data is stored on the data disks of the preemptible instance whose data you want to restore, and you want to restore only the data that is stored on the system disk.

Disable the Release Disk with Instance feature for the system disk when the preemptible instance is running as expected. After an interruption event of the preemptible instance is received, the system uses SDK for Java 2.0 code to create a snapshot for the system disk of the instance and create a custom image from the system disk snapshot. Then, you can use the custom image to create a new preemptible instance. This way, you can restore the data of the source preemptible instance.

Method 3: Restore the data of an instance by using a custom image created from a system disk snapshot of the instance to create a new instance