Search code examples
amazon-web-servicesaws-ebs

EBS Snapshots versioning


Are EBS snapshots versioned? If Yes, where can I find the version information.

I tried to check in Amazon official docs,but couldn't get a clear answer to this.


Solution

  • Yes and No.

    Each snapshot is, in a way, a 'version'.

    The reason for this is that, when a Snapshot is created, any block that has been added or modified since the previous snapshot is copied to Amazon S3 (in a place you can't directly access) and the Snapshot becomes the 'index' to those blocks.

    Scenario:

    • Create Snapshot1
    • Modify one block
    • Create Snapshot2

    When Snapshot2 was created, one block was copied to S3. Snapshot2 still points to all the blocks used in the volume, but they were already in S3 and didn't need to be re-copied. So, you can think of Snapshot1 and Snapshot2 as being different 'versions' of the disk.

    If Snapshot1 is deleted, the underlying data is kept in S3 because it is used by Snapshot2. If Snapshot2 is then deleted, all of the snapshot data in S3 will be deleted. (Unless the original volume was based on an AMI, which is a snapshot itself! In that case, only the changes made since the AMI was instantiated are deleted. Neat and confusing, eh!)