All Products
Search
Document Center

Elastic Compute Service:FAQ about relationships between images, snapshots, and instances

Last Updated:Jan 29, 2024

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?

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

  • Quickly deploy environments. You can use an image to create an ECS instance with a specific environment.

  • Batch deploy environments. You can create a custom image either from an ECS instance that is deployed with specific environments or from disk snapshots. Then, you can use the custom image to batch create multiple identical ECS instances.

  • Replace operating systems. You can use an image to replace the operating system (system disk) of an ECS instance.

  • Back up disk data on a regular basis. You can use automatic snapshot policies to automatically create snapshots of disks to back up disk data on a daily, weekly, or monthly basis.

  • Back up disk data contingently. Before you perform critical operations such as updating operating systems or resizing disks, you can create snapshots to back up disk data.

Feature

  • Images can be used to create ECS instances, but snapshots cannot.

  • An image can contain the data of only the system disk on an ECS instance or the data of both the system disk and data disks on an ECS instance.

  • An image can be used to replace the operating system (system disk) of an instance regardless of whether the image is associated with the instance.

  • Images can be copied and shared across regions or accounts. The image copies and shared images can be used to create identical ECS instances in the destination regions and accounts.

  • Snapshots can back up the data of system disks and data disks on ECS instances.

  • Snapshots can be used to restore data to disks on existing ECS instances.

  • Snapshots can be copied to back up disk data across regions.

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:

Important
  • 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.