25

Amazon EBS snapshots capture changed blocks from a baseline, so snapshots will often be much smaller than the source volume. Billing is based on the actual size, which is nice. However, I cannot find a way to determine the snapshot actual size. ec2-describe-snaphots only provides the size of the volume that was snapshotted.

If for no other reason, I need this information to verify billing. But I'd also like to have it because I may find that by reconfiguring my volumes, and what I do with them, I can reduce the size of my incremental snapshots.

2 Answers 2

20

Amazon does not currently provide a method to report on the storage used by snapshots other than the total usage and cost numbers for all snapshots in the account.

Snapshots of the same or related volumes can share storage (where blocks have not changed between snapshots) so this makes it difficult to define the size of a single snapshot.

A new snapshot only saves blocks that have been modified since the last snapshot, but it keeps pointers to the previously saved blocks that have not been modified.

If you delete a single snapshot, it would only free up the blocks that are not shared by any other snapshot (whether created before or after the one you're deleting).

Blocks on the EBS volume that have not been written to are not included in the snapshot.

Snapshot blocks are compressed before storage, further saving you in storage costs.

8
  • 7
    Thanks for the extensive answer. However, it must not be TOO difficult, because amazon does it, so that they can bill it. If I thought that only 10% of my data was changing between snaps, but it was actually 90%, I'd like to know that (in a direct fashion.) Jan 31, 2012 at 3:11
  • 3
    Amazon bills for the total storage used by all snapshots in the aggregate. The difficulty is in defining what you mean by how much storage a single snapshot uses in such a way that it doesn't completely confuse people who don't understand the levels of indirection that are going on behind the scenes to save you money. What you ask for in your comment is actually a count of the blocks that are in one snapshot but not a specific other one. Jan 31, 2012 at 4:39
  • 3
    Depending on how you define a snapshot size, you end up giving numbers that either don't add up to the total you're actually paying for (confusing) or that don't match how much less you pay when you delete a specific snapshot (also confusing). Jan 31, 2012 at 4:44
  • Where do I see the "total usage and cost numbers for all snapshots in the account"? I'm trying to determine how encryption affects snapshot size. If I encrypt an EBS volume using dm-crypt, will EC2 still be able to compress it when making a snapshot, and will incremental blocks still help for subsequent snapshots? The answer affects will affect my database backup strategy.
    – Mark Berry
    Jun 18, 2014 at 0:46
  • 1
    Sad that the situation is the same 7 years later. @EricHammond you said that it's hard to describe how much storage a snapshot uses in a way that's not confusing. That's true, but it doesn't preclude from giving, say, per-volume snapshot prices. I sure wish I knew which of my volumes' snaps are using the space and which aren't.
    – Dan Pritts
    Sep 27, 2019 at 20:04
5

I wrote this small script for determining the snapshot's size. Right now doesn't take any params, it just gets all snapshots.

https://github.com/akirsman/Snapshots/blob/master/snapshotsSize.py

3
  • This is great! For others reading, this is using the "EBS Direct APIs", available since Dec 2019, to get the number of changed blocks between each two snapshots. There are some issues with the script, but these APIs should give all the info needed.
    – Ralf
    May 28, 2021 at 9:06
  • @Ralf Would you mind clarifying the "issues" with the script? I'd like to use this script without reservations.
    – mastov
    Apr 5 at 9:58
  • 1
    @mastov This specifically: github.com/akirsman/Snapshots/issues/2
    – Ralf
    Apr 6 at 10:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .