All Products
Search
Document Center

Elastic Compute Service:How snapshots work

Last Updated:Nov 10, 2025

A snapshot is a point-in-time data backup of a disk. You can use a snapshot to restore a disk to the state it was in when the snapshot was created. This topic describes the processes for creating, archiving, and deleting snapshots. It also explains how snapshot size is calculated and its relationship with disk capacity.

How creating snapshots works

You can create a snapshot for a disk or create an automatic snapshot policy as needed.

How it works

Snapshots use blocks, which are the basic units for managing data in a storage system, as the minimum granularity for data backup. Snapshots are categorized as full snapshots and incremental snapshots. The first standard snapshot that you create for a disk is a full snapshot, which backs up all data on the disk at that point in time. Subsequent standard snapshots are incremental snapshots. They back up only the blocks that have changed (new or modified) since the previous snapshot was created. This method reduces the required storage space and saves on snapshot storage costs. Although an incremental snapshot does not contain all the data from the disk, it references the unchanged data from the previous snapshot in the snapshot chain. This lets you use any snapshot to roll back a disk and restore all of its data to the state it was in when that snapshot was created.

After a snapshot is created, it is stored by default in Object Storage Service (OSS). This OSS bucket is not visible to users. Storing snapshots in OSS ensures long-term data security and flexible recovery. You cannot use an OSS bucket that you created to store snapshot data.

Example

Assume that an ECS instance has a disk where data is modified and new data is written at 10:00 and 11:00. The following example explains how snapshots for this disk work:

  1. At 9:00, the disk contains data blocks A and B. You create the first snapshot, Snapshot 1. This is a full snapshot that backs up blocks A and B, storing all data on the disk at that time.

  2. More data is written to the disk, and block B is modified to B1. At 10:00, you create a second snapshot, Snapshot 2. This is an incremental snapshot that backs up only the changed block B1. The unchanged block A is not backed up. Instead, it is referenced from Snapshot 1.

  3. More data is written, and a new block C is added. At 11:00, you create a third snapshot, Snapshot 3. This is an incremental snapshot that backs up only the new block C. The unchanged blocks A and B1 are not backed up. Instead, block A is referenced from Snapshot 1, and block B1 is referenced from Snapshot 2.

  4. This process continues for subsequent snapshots.

image

How archiving snapshots works

How it works

You can archive standard snapshots that you do not need to access frequently but must retain for a long time. Archiving converts them into archived snapshots, which reduces storage costs. Archived snapshots use a full and incremental model to store data. The first snapshot in a disk's snapshot chain that is archived becomes a full archived snapshot. Subsequent archived snapshots for the same disk are incremental. They are based on this full archived snapshot and back up only the blocks that have changed since the previous archived snapshot was created. For more information, see Archive snapshots.

Examples

Example 1: Archiving the only snapshot of a disk

Assume that a disk has only one standard snapshot. When you archive this snapshot, the resulting archived snapshot has the same size as the original standard snapshot. After the operation, the disk has only one archived snapshot, and the standard snapshot size becomes zero.

image

Example 2: Archiving an incremental snapshot of a disk

Assume that a disk has three standard snapshots. You then archive the incremental Snapshot 2 and the incremental Snapshot 3.

  1. When you archive standard Snapshot 2, it is converted into a full archived snapshot. It contains all the data of standard Snapshot 2, which means that the archived Snapshot 2 contains blocks A and B1. Before archiving, block B1 in standard Snapshot 2 was referenced by standard Snapshot 3. Therefore, block B1 is retained and becomes associated with standard Snapshot 3.

  2. Later, when you archive standard Snapshot 3, it becomes an incremental archived snapshot. It contains only the incremental data, which is block C. The unchanged blocks A and B1 are not backed up. They are referenced from the archived Snapshot 2.

  3. This process continues for subsequent snapshots.

After archiving, the disk has two snapshot chains: a standard snapshot chain with one standard snapshot, and an archived snapshot chain with two archived snapshots.

image

How deleting snapshots works

If you no longer need a snapshot, or if the number of snapshots exceeds the quota, you can delete snapshots to free up storage space. For more information, see Delete a snapshot.

Note

For more information about the quotas on manual, automatic, and archived snapshots for each disk, see Limits.

How it works

Although an incremental snapshot does not contain all the data from the disk, it references unchanged data from the previous snapshot in its chain. This means that after you delete a snapshot, you can still use any of the remaining snapshots to restore the disk to the state it was in when that snapshot was created.

Examples

Assume that an ECS instance has a disk for which Snapshot 1, Snapshot 2, and Snapshot 3 have been created. The data blocks in each snapshot are as follows:

  • Snapshot 1: A full snapshot that contains data blocks A and B.

  • Snapshot 2: An incremental snapshot that contains only the incremental data, which is block B1. The unchanged block A is not backed up. Instead, it is referenced from Snapshot 1.

  • Snapshot 3: An incremental snapshot that contains only the incremental data, which is block C. The unchanged blocks A and B1 are not backed up. Instead, block A is referenced from Snapshot 1, and block B1 is referenced from Snapshot 2.

Example 1: Deleting a full snapshot of a disk

When you delete the full Snapshot 1, the next snapshot in the chain, Snapshot 2, becomes a full snapshot. Because Snapshot 2 references block A from Snapshot 1, block A is retained and merged into Snapshot 2. Block B, which is unique to Snapshot 1, is deleted. For Snapshot 3, the reference for block A changes to Snapshot 2, while the reference for block B1 remains unchanged.

image

Example 2: Deleting an incremental snapshot of a disk

When you delete the incremental Snapshot 2, the system manages the data references. Snapshot 2 references block A from Snapshot 1, and Snapshot 3 references block B1 from Snapshot 2. Therefore, after you delete Snapshot 2, the reference from Snapshot 2 to block A is removed, and block B1 is retained and merged into Snapshot 3.

image

How snapshot size is calculated

How it works

The total snapshot size for a disk is calculated based on its snapshot chain, which is the chain of relationships among all snapshots for that disk. The size is calculated by measuring the storage space that is occupied by the data blocks of all current snapshots. After you archive some snapshots, a disk has two snapshot chains: a standard snapshot chain and an archived snapshot chain. The system calculates storage fees for standard snapshots and archived snapshots separately based on the size of each chain. For more information, see View the snapshot size of a single disk by snapshot chain and Snapshot billing.

Note

The snapshot size calculation based on the snapshot chain may have a latency of several minutes. For the actual charges, refer to your bill.

The following concepts are related to snapshot size:

  • Full size of a snapshot: The total storage space that is occupied by all data blocks of a single snapshot.

  • Incremental size of a snapshot: The storage space that is occupied by the data blocks that are different between the current snapshot and the previous snapshot in the same snapshot chain.

  • Total snapshot size: The sum of the full size of the first snapshot (the full snapshot) and the incremental sizes of all subsequent incremental snapshots in the chain.

Example of snapshot size calculation

  1. Assume that a disk has a capacity of 100 GiB and 30 GiB of data has been written to it. Data is modified and new data is written at 10:00 and 11:00. The following example explains how the snapshot size for this disk is calculated:

    • Standard Snapshot 1: At 9:00, the disk contains 30 GiB of data. You create the first standard snapshot, Snapshot 1. This is a full snapshot that backs up all data on the disk. Its full size is 30 GiB.

    • Standard Snapshot 2: An additional 10 GiB of data is overwritten on the disk. At 10:00, you create a second standard snapshot, Snapshot 2. This is an incremental snapshot that backs up only the 10 GiB of changed data. The other 20 GiB of unchanged data is not backed up. Instead, it is referenced from Standard Snapshot 1.

    • Standard Snapshot 3: Another 10 GiB of new data is written to the disk, which brings the total data on the disk to 40 GiB. At 11:00, you create a third standard snapshot, Snapshot 3. This is an incremental snapshot that backs up only the 10 GiB of data that has changed since Standard Snapshot 2 was created. The 30 GiB of unchanged data is not backed up. Of this unchanged data, 20 GiB is referenced from Standard Snapshot 1, and 10 GiB is referenced from Standard Snapshot 2.

    These three standard snapshots form the standard snapshot chain for the disk. Before archiving, the total standard snapshot size is calculated as follows: Full Standard Snapshot 1 + Incremental Standard Snapshot 2 + Incremental Standard Snapshot 3 = 50 GiB.

  2. Assume that you archive Snapshot 2 and Snapshot 3. These two archived snapshots form the archived snapshot chain for the disk.

    • Archived Snapshot 2: A full snapshot that backs up all data. Its full size is 30 GiB.

    • Archived Snapshot 3: An incremental snapshot that backs up only the 10 GiB of changed data. The 30 GiB of unchanged data is not backed up. Instead, it is referenced from Archived Snapshot 2.

    After archiving, the disk has two snapshot chains:

    • Total archived snapshot size = Full Archived Snapshot 2 + Incremental Archived Snapshot 3 = 40 GiB

    • Total standard snapshot size = Full Standard Snapshot 1 = 30 GiB

    When you compare the sizes, the total snapshot size after archiving has increased by 20 GiB. Archiving only some of a disk's snapshots may not reduce your costs. For a detailed cost comparison before and after you archive all snapshots, see Archive snapshots.

image

Relationship between snapshot size and disk capacity

The size of a single snapshot for a disk does not exceed the disk's capacity. However, as you create more snapshots, the total size of all snapshots can become larger than the disk's capacity.

For example, assume that you create a 40 GiB disk and write 30 GiB of data to it. The snapshot that you create at this point is 30 GiB. Later, you overwrite that data with another 30 GiB of data and create a second snapshot. The disk capacity is still 40 GiB, but because 30 GiB of data has changed, the total snapshot size for the disk is now 60 GiB, which is larger than the disk capacity.

You can view the capacity of a single disk and its snapshot size using the snapshot chain. For more information, see View the snapshot size of a single disk by snapshot chain. In the following figure, ① indicates the disk capacity, and ② indicates the total size of all snapshots for the disk.

image

Differences between snapshot size and system capacity

  • Snapshots use fixed-size data blocks as the minimum granularity for data backup. The snapshot size is calculated based on these data blocks.

  • When you delete a file on a disk, the available capacity displayed by the operating system increases. However, for most file systems, deleting a file only marks it as deleted and does not physically erase the corresponding data. From the disk's perspective, deleting a file is a write operation that modifies metadata. This operation does not reduce the actual space occupied by data on the disk. If you create a snapshot at this point, the snapshot still contains the data blocks for the deleted file. This data is removed only when the file system physically deletes the file, for example, using the TRIM command.

  • Even if you do not actively write to a system disk, its snapshot size may still increase. This is because the operating system generates system files during runtime. These files are written to the disk and are then backed up in snapshots.

  • The size of a snapshot might be slightly larger than the amount of data that you write to the disk. This is because file system metadata also occupies space on the disk. The snapshot's data blocks include this metadata in addition to the actual data that you wrote. For example, if you create a 1 MB text file on a disk, the size of the backed-up data in the snapshot is slightly larger than 1 MB because it includes file system metadata.