28

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.

EEAA
  • 110,608

3 Answers3

21

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.

Eric Hammond
  • 11,275
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

Ariel
  • 423
0

AWS provide several tools in Billing and Cost Management. Cost Explorer Reports, Daily, weekly, monthly comparisons. Total and Average costs and storage for the periods. Metrics by storage type, eg:

  • EBS:SnapshotUsage
  • APS2-EBS:SnapshotUsage
  • EBS:SnapshotArchiveStorage

My dropdown list shows 372 metrics available for reporting.

And via Data Exports, I receive a daily download of all costs from the start of the month until today. This is placed into an S3 bucket for download and analysis. I can filter the EBS snapshot costs for a single volume, and analyse each day's incremental cost.

For example, on 23 October I received a download of 18273 rows of data, 149 columns, covering 22 days from 1st to 22nd October.

I filter data values for one snapshot, created 5th October, from a 250GB volume attached to SQL server.

  • resourceTags/user:Name = SQL-G-BACKUP
  • product/usagetype = EBS:SnapshotUsage
  • resourceTags/user:BackUp = Daily
  • lineItem/ResourceId = arn:aws:ec2:us-east-1:123456789012:snapshot/snap-abc123def45678901
  • lineItem/Operation = CreateSnapshot

This gives me 16 rows of data covering 5th to 22nd. lineItem/UsageAmount has gradually increasing storage values for each day: 0.57, 0.76, 0.76, ... ,4.49, 4.49, 4.49 I think it shows that the LifeCycle removes or archives older snapshots and so the incremental storage cost increase.

Compared to a snapshot taken in September then archived to cold storage on 20th. EBS:SnapshotUsage has 20 rows of data with a consistent usage amount of 0.73. ModifySnapshotTier has 3 rows of data with usage amounts: 4.70, 8.05, 8.05. I guess the first entry is a half day amount.

This is the link I followed to set up a Data Export task. https://docs.aws.amazon.com/cur/latest/userguide/dataexports-create-legacy.html