Amazon Elastic Compute Cloud
User Guide (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Copying an Amazon EBS Snapshot

Amazon Elastic Block Store (Amazon EBS) provides block level storage volumes for use with Amazon Elastic Compute Cloud (Amazon EC2) instances. With Amazon EBS, you can create point-in-time snapshots of volumes and store them on Amazon Simple Storage Service (Amazon S3). After you've stored a snapshot in Amazon S3, you can copy it from one AWS region to another, or within the same region, using the Amazon EC2 console, Amazon EC2 CLI, or the API. You can use snapshot copies to create backups of data, to create new Amazon EBS volumes, or to create Amazon Machine Images (AMIs).

You can have up to five snapshot copy requests in progress to a single destination per account. You can copy any accessible Amazon EBS snapshots that have "completed" status, including shared snapshots and snapshots that you've created. You can also copy AWS Marketplace, VM Export/Import, and Storage Gateway snapshots, but you must verify that the snapshot is supported in the destination region.

Note

You cannot copy an Amazon Relational Database Service (Amazon RDS) snapshot.

When you copy a snapshot, you are only charged for the data transfer and storage used to copy the snapshot data across regions and to store the copied snapshot in the destination region. You are not charged if the snapshot copy fails. However, if you cancel a snapshot copy that is not yet complete, or delete the source snapshot while the copy is in progress, you are charged for the bandwidth of the data transferred. Unlike the create snapshot operation, which is incremental, the copy snapshot operation copies all of the bytes in the snapshot every time. The snapshot is copied across regions using the secure Amazon Simple Storage Service Copy and the snapshot copy receives a snapshot ID that's different from the original snapshot's ID.

You can use a copy of an Amazon EBS snapshot in the following ways:

  • Geographic Expansion: You can launch your applications in a new region.

  • Migration: You can migrate an application to a new region, to enable better availability and minimizing cost.

  • Disaster Recovery: You can back up your data and logs across different geographical locations at regular intervals. In case of disaster, you can restore your applications using point-in-time backups stored in the secondary region. This minimizes data loss and recovery time.

The Amazon EC2 console, Amazon EC2 CLI, and the API are designed to provide an intuitive customer experience. We use the push model in the console design to minimize user clicks for the Amazon EBS snapshot use cases discussed earlier. You can easily initiate a copy from the console by starting with the source region. We use a pull model in the API and the Amazon EC2 CLI, because these experiences factor in how customers use automation. You only need to know the source snapshot ID and source region to initiate the copy using the Amazon EC2 CLI or API.

AWS Management Console

To copy a snapshot using the Amazon EC2 console:

You can create a copy of an Amazon EBS snapshot using the Amazon EC2 console.

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, under ELASTIC BLOCK STORE, click Snapshots.

  3. In the EBS Snapshots pane, right-click the snapshot you want to copy, and then click Copy Snapshot.

  4. In the Copy Snapshot dialog box, update the following as necessary:

    • Snapshot: Select another snapshot from the drop-down list, if appropriate.

    • Destination region: Select the region where you want to write the copy of the snapshot from the drop-down list.

    • Description: By default, the description includes information about the source snapshot so that you can identify a copy from the original. You can change this description as necessary.

  5. Click Yes, Copy.

    Copy Snapshot dialog box
  6. In the Copy Snapshot confirmation dialog box, you can click Snapshots to go to the EBS Snapshots pane in the region specified, or click Close.

    Copy Snapshot confirmation dialog box

    To view the progress of the copy process later, switch the Amazon EC2 console to the destination region, and then refresh the EBS Snapshots pane. Copies in progress are listed at the top of the EBS Snapshots pane.

Command Line Interface

You can create a copy of an Amazon EBS snapshot using the ec2-copy-snapshot command. You can view the progress of the copy process using the ec2-describe-snapshots command. For more information, see ec2-copy-snapshot and ec2-describe-snapshots.

The Amazon EC2 CLI tools share a -region parameter that defines the region to which the API call will be directed. When copying a snapshot using the ec2-snapshot-copy command, you can use the -region parameter to specify the destination region.

To copy a snapshot using the CLI

  1. At a command prompt, switch to the destination region, and then type the following:

    ec2-copy-snapshot -r source-region -s source-snapshot-id [-d description] [-region destination-region]
  2. To track the progress of the copy, at a command prompt, switch to the destination region, and then type the following:

    ec2-describe-snapshots [snapshot_id ...] [-a] [-o owner...] [-r user_id] [[--filter"name=value"] ...]

API

To copy a snapshot using the API

  • Use the CopySnapshot action to construct the following request:

    https://ec2.amazonaws.com/?Action=CopySnapshot
    &AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE
    &Description=My%20snapshot
    &Signature=VjpSFePIKxDc1IUy92W3SBApdLiap7nno4pEc9iEXAMPLE
    &SignatureMethod=HmacSHA256
    &SignatureVersion=2
    &SourceRegion=us-west-1
    &SourceSnapshotId=snap-2EXAMPLE
    &Timestamp=2012-12-11T02%3A03%3A35.713Z
    &Version=2012-12-01

    The following is an example response.

    <CopySnapshotResponse xmlns="http://ec2.amazonaws.com/doc/2012-12-01/">
    <requestId>60bc441d-fa2c-494d-b155-5d6a3EXAMPLE</requestId>
    <snapshotId>snap-8EXAMPLE</snapshotId>
    </CopySnapshotResponse>