An image is a template that contains a software configuration. It is used to create Elastic Compute Service (ECS) instances that have a specific operating system and application data. An ECS instance is a virtual machine that is created based on an image and other parameters. Snapshots are point-in-time backups of ECS instance data. Gaining a thorough understanding of the relationships between images, snapshots, and instances is essential for enhanced management and utilization of ECS instances, as well as for the robust protection of your instance data and configurations. This topic provides answers to some frequently asked questions (FAQ) about the relationships between images, snapshots, and ECS instances.
Does an image share the same lifecycle as an ECS instance that uses the image?
How are images related to snapshots? What are the differences between images and snapshots?
What happens to a custom image when the instance from which the image was created is released?
Does an image share the same lifecycle as an ECS instance that uses the image?
Yes, an image has the same lifecycle as an ECS instance that uses the image. When you create an ECS instance, you need to select an image. The selected image uses the same billing method as the instance, which can be subscription or pay-as-you-go.
How are images related to snapshots? What are the differences between images and snapshots?
Snapshots and images are related as follows:
When you create a custom image from an ECS instance, ECS creates a snapshot for the system disk and each data disk on the instance. Then, all created snapshots constitute a custom image. For more information, see Create a custom image from an instance.
When you delete a custom image, you can specify whether to delete the snapshots contained in the image. When you delete a snapshot, ECS checks whether the snapshot is associated with an image. If the snapshot is associated with an image, delete the image before you delete the snapshot. For more information, see Delete a custom image and Delete a snapshot.
You can use a system disk snapshot to create a custom image. For more information, see Create a custom image from a snapshot.
The following table describes the differences between images and snapshots.
Item | Image | Snapshot |
Nature | An image provides the software configuration and data that are required to create an ECS instance, such as an operating system, initialization data of applications, and pre-installed software. | A snapshot is a point-in-time backup of disk data. |
Use scenario |
|
|
Feature |
|
|
What happens to a custom image when the instance from which the image was created is released?
Releasing an instance manually or on expiration has no impact on the custom images created from the instance or the instances created from the custom images.
If I created an image from an ECS instance, can I retrieve instance data after the instance is released on expiration?
Yes, you can use one of the following methods to retrieve instance data:
Create a new ECS instance from the image. For more information, see Create a custom image from an instance.
Use the image to replace the system disk of an ECS instance. For more information, see Replace the operating system of an instance.
The image must be in the same region as the instance.
Maintain a sufficient account balance. Otherwise, data is lost when snapshots are automatically deleted 15 days after a payment becomes overdue in your account. For more information, see Snapshots.
Can a custom image created from a subscription ECS instance be used to create a pay-as-you-go ECS instance?
Yes, a custom image created from a subscription ECS instance can be used to create a pay-as-you-go ECS instance. The use of custom images is irrelevant to instance billing methods.