Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

First, how can I retrieve the space consumed by my EBS snapshots?

Second, according to the documentation, Amazon EBS snapshot only backs up the blocks of an EBS volume that have been modified since the last snapshot creation. Suppose I have a 10GB EBS volume. I created the 1st snapshot for it. Since there is no "last" snapshot, I assume the first snapshot's size is 10GB. OK. And then I modified 1GB of data and created a 2nd snapshot. The 2nd snapshot's size should be around 1GB, right? However what if I deleted the 1st snapshot at this point? Is the 2nd snapshot still 1GB? If yes, can I still restore the 10GB EBS volume from the 2nd snapshot? Or does the 2nd snapshot automagically become 10GB?

share|improve this question
    
Bounty: Amazon charges me per gigabyte of snapshots per month. Bounty goes to the answer that explains how to find out how many gigabytes Amazon is currently charging me for my snapshots. –  romkyns Jun 14 '11 at 23:38
add comment

4 Answers

up vote 4 down vote accepted

This may answer Q2 (from http://aws.amazon.com/ebs/):

Even though the snapshots are saved incrementally, when you delete a snapshot, only the data not needed for any other snapshot is removed. So regardless of which prior snapshots have been deleted, all active snapshots will contain all the information needed to restore the volume

In your example after deleting the first snapshot you would not pay anymore for the 1GB in the first overwritten by the second snapshot, and you won't be able to restore the state of the first snapshot.

But it's still quite opaque about how much a set of snapshots costs in terms of S3 usage.

share|improve this answer
add comment

See this message and the reply two messages below it. Essentially, there is only one copy of each block and multiple snapshots can refer to the same block. Snapshots can be deleted in any order and any snapshot can be used to restore the volume to the state it was in at the moment the snapshot was made.

share|improve this answer
    
You should have answered my Q2. I think you mean when a block is referenced by more than one snapshots, when one of the snapshots is deleted, the block won't be deleted until no more snapshot references to the block. How about Q1? –  Michael Chan Sep 1 '09 at 2:12
add comment

The snapshot contains I believe only blocks that have been written to at least once. So, if you created a new EBS, then formatted it using some kind of 'quick' format, that just writes the file allocation tables, then I think that only the blocks used by the file allocation tables will be written to the initial snapshot.

When using the EBS for a database store, you might consider initializing the entire EBS prior to using the database, which appears to speed up the database, since the drive has already been entirely initialized. The downside is that this means that the initial snapshot will probably be the entire EBS drive, ie 10GB.

share|improve this answer
add comment

Regardless of Amazon...

first of all there are two types of snapshots. One is Full and second is Incremental. In your example you mention 10GB and 1GB so you can guess which one is which. Without a Full snapshot it is not possible to recover the data entirely if at all. Incremental snapshot is a way of saving space and time so as not to backup the whole image over and over again. So while you can retain zero incremental snapshots you must have ATLEAST one Full snapshot.

The restore is done in the following way.
1. get the Latest FULL snap
2. Is there any more incremental snap since the last full backup?
yes
  2.1 Apply the incremental changes in order from the last full backup to the latest | END
no
  2.2 END

You can therefore plan how much you need. Maybe a full backup once a week and incremental everyday? or whatever suits your case. However amazon differs here a bit...

As for the cost it seems Amazon is assuming (for sake of simplicity on their part) that the

  1. Entire EBS is snapshotted(not a real word, i just made it up) including the free space.
  2. Also compression is not accounted for and if they are compressing its still not considered here.
  3. a Full snapshot or incremental will all go to S3 uncompressed so you 'll be paying for S3 storage and transfers
  4. A full snapshot is more like an AMI already. So you're better of using an AMI as the AMI does not seem to include the unused space for the image size and therefore the S3 storage equirement is smaller.
  5. as mentioned by others Amazon protects users from deleting the wrong snaps by making >sure deletion of snaps does not affect recovery. I think they internalize the process where > they will apply the incremental snap to the full one and display it as delete. effect they > still store the whole EBS volume once

Now I am not a pro at AWS but this is to the best of my understanding. I could be wrong

share|improve this answer
    
i checked just now in my account. Your EBS usage and backup usage will be displayed in the AWS console (if you use it). It always reads to be the full size as of the disk space for the first snapshot. –  Vangel Jun 20 '11 at 7:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.