Manually Snapshot Volume

Manually Snapshot EC2 Instance’s EBS Volume

Overview

  • You can create a point-in-time snapshot of an EBS volume and use it as a baseline for new volumes or for data backup. If you make periodic snapshots of a volume, the snapshots are incremental — the new snapshot saves only the blocks that have changed since your last snapshot.
  • Snapshots occur asynchronously; the point-in-time snapshot is created immediately, but the status of the snapshot is pending until the snapshot is complete (when all of the modified blocks have been transferred to Amazon S3), which can take several hours for large initial snapshots or subsequent snapshots where many blocks have changed. While it is completing, an in-progress snapshot is not affected by ongoing reads and writes to the volume. You can take a snapshot of an attached volume that is in use. However, snapshots only capture data that has been written to your Amazon EBS volume at the time the snapshot command is issued. This might exclude any data that has been cached by any applications or the operating system.
  • If you can pause any file writes to the volume long enough to take a snapshot, your snapshot should be complete. However, if you can’t pause all file writes to the volume, you should unmount the volume from within the instance, issue the snapshot command, and then remount the volume to ensure a consistent and complete snapshot. You can remount and use your volume while the snapshot status is pending.
  • To make snapshot management easier, you can tag your snapshots during creation or add tags afterward. For example, you can apply tags describing the original volume from which the snapshot was created, or the device name that was used to attach the original volume to an instance. For more information, see Tagging your Amazon EC2 resources.

Snapshot Encryption

  • Snapshots that are taken from encrypted volumes are automatically encrypted. Volumes that are created from encrypted snapshots are also automatically encrypted. The data in your encrypted volumes and any associated snapshots is protected both at rest and in motion. For more information, see Amazon EBS encryption.
  • By default, only you can create volumes from snapshots that you own. However, you can share your unencrypted snapshots with specific AWS accounts, or you can share them with the entire AWS community by making them public. For more information, see Sharing an Amazon EBS Snapshot.
  • You can share an encrypted snapshot only with specific AWS accounts. For others to use your shared, encrypted snapshot, you must also share the CMK key that was used to encrypt it. Users with access to your encrypted snapshot must create their own personal copy of it and then use that copy to restore the volume. Your copy of a shared, encrypted snapshot can also be re-encrypted with a different key.

Note: If you copy a snapshot and encrypt it to a new CMK, a complete (non-incremental) copy is always created, resulting in additional delay and storage costs.

Create a Snapshot


Use the following procedure to create a snapshot from the specified volume.

To create a snapshot using the console

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. Choose Snapshots under Elastic Block Store in the navigation panel.

Snapshot Dashboard

  1. Choose Create Snapshot.
  2. For Volume, select the volume that attached to EC2.

Create a Snapshot

  1. (Optional) Enter a description for the snapshot.
  2. (Optional) Choose Add Tag to add tags to your snapshot. For each tag, provide a tag key and a tag value.
  3. Choose Create Snapshot.

Successfully Create a Snapshot

To create a snapshot using the command line You can use one of the following commands. For more information about these command line interfaces, see Accessing Amazon EC2.

Delete a Snapshot

  • When you delete a snapshot, only the data referenced exclusively by that snapshot is removed. Unique data will not be deleted unless all of the snapshots that reference that data are deleted. Deleting previous snapshots of a volume does not affect your ability to restore volumes from later snapshots of that volume.
  • Deleting a snapshot of a volume has no effect on the volume. Deleting a volume has no effect on the snapshots made from it.
  • If you make periodic snapshots of a volume, the snapshots are incremental. This means that only the blocks on the device that have changed after your last snapshot are saved in the new snapshot. Even though snapshots are saved incrementally, the snapshot deletion process is designed so that you need to retain only the most recent snapshot in order to restore the volume. Data that was present on a volume, held in an earlier snapshot or series of snapshots, that is subsequently deleted from that volume at a later time, is still considered unique data of the earlier snapshots. This unique data is not deleted from the sequence of snapshots unless all snapshots that reference the unique data are deleted.
  • Deleting a snapshot might not reduce your organization’s data storage costs. Other snapshots might reference that snapshot’s data, and referenced data is always preserved. If you delete a snapshot containing data being used by a later snapshot, costs associated with the referenced data are allocated to the later snapshot. For more information about how snapshots store data, see How Incremental Snapshots Work and the example below.
  • In the following diagram, Volume 1 is shown at three points in time. A snapshot has captured each of the first two states, and in the third, a snapshot has been deleted.

Deletion Overview

  • In State 1, the volume has 10 GiB of data. Because Snapshot A is the first snapshot taken of the volume, the entire 10 GiB of data must be copied.
  • In State 2, the volume still contains 10 GiB of data, but 4 GiB have changed. Snapshot B needs to copy and store only the 4 GiB that changed after Snapshot A was taken. The other 6 GiB of unchanged data, which are already copied and stored in Snapshot A, are referenced by Snapshot B rather than (again) copied. This is indicated by the dashed arrow.
  • In State 3, the volume has not changed since State 2, but Snapshot A has been deleted. The 6 GiB of data stored in Snapshot A that were referenced by Snapshot B have now been moved to Snapshot B, as shown by the heavy arrow. As a result, you are still charged for storing 10 GiB of data; 6 GiB of unchanged data preserved from Snapshot A and 4 GiB of changed data from Snapshot B.

Note: You can’t delete a snapshot of the root device of an EBS volume used by a registered AMI. You must first deregister the AMI before you can delete the snapshot. For more information, see Deregistering your Linux AMI.

To delete a snapshot using the console

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. Choose Snapshots in the navigation pane.
  3. Select a snapshot and then choose Delete from the Actions list.
  4. Choose Yes, Delete.

Delete Snapshot

To delete a snapshot using the command line You can use one of the following commands. For more information about these command line interfaces, see Accessing Amazon EC2.

Note: Although you can delete a snapshot that is still in progress, the snapshot must complete before the deletion takes effect. This may take a long time. If you are also at your concurrent snapshot limit (five snapshots in progress), and you attempt to take an additional snapshot, you may get the ConcurrentSnapshotLimitExceeded error.