Showing posts with label S3. Show all posts
Showing posts with label S3. Show all posts

HOW TO: Revert a Snapshot of an Instance In Amazon Web Services (AWS)

I write about this topic because it's one that may not be immediately obvious to those new to AWS and with previous visualization experience.

In AWS there is a much looser tie between various components that make up a server. An EC2 instance is nothing more than a reservation for some allocation of processor power and memory. Persistent block storage (EBS) or ephemeral instance storage is associated with an instance reservation and assigned a device mapping that tells the hypervisor how the volume is related to the instance. A single device either an EBS volume or ephemeral instance storage can be attached as the root (boot) device. The number of other attachable devices depends on your instance type. See the reference link below to AWS documentation for further explanation of these device mappings and these concepts.

A snapshot is related to a volume and only to an instance through the attachment of a volume. Hence a snapshot is not per say a point in time for an instance, rather it is a point in time for a volume. If you want to take a snapshot of an instance, you would in fact need to assess each attached volume and take snapshots of each as needed. If you want to snapshot the instance what you probably want to do is take a snapshot of the root drive.

Snapshots capture each block in a volume that has changed since the last snapshot was taken. Each block in a snapshot of a volume is stored as an S3 object. The more changes and time between snapshots the longer your snapshots will take as more blocks will likely need to be copied and stored as S3 objects. There is no way to revert a volume to a previous state from these snapshots. Instead, a snapshot allows you to create a new volume using the snapshotted blocks giving you a copy of a volume at a specific point in time. You'll need to then replace the attached volume on your instance with this new volume created from the snapshot.