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

CreateSnapshot

Description

Creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You can use snapshots for backups, to make copies of instance store volumes, and to save data before shutting down an instance. For more information about Amazon EBS, see Using Amazon Elastic Block Store.

When a snapshot is created, any AWS Marketplace product codes from the volume are propagated to the snapshot.

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 may 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 cannot pause all file writes to the volume, you need to unmount the volume from within the instance, issue the snapshot command, and then remount the volume to ensure a consistent and complete snapshot.

To create a snapshot for Amazon EBS volumes that serve as root devices, you should stop the instance before taking the snapshot.

To unmount the volume in Linux/UNIX

  • Enter the following command from the command line.

    umount -d device_name

    For example:

    # umount -d /dev/sdh

To unmount the volume in Windows

  1. In Disk Management, right-click the volume to unmount, and select Change Drive Letter and Path.

  2. Select the mount point to remove and click Remove.

Request Parameters

VolumeId

Required: Yes

Description

A description of the Amazon EBS snapshot.

Type: String

Default: None

Constraints: Up to 255 characters

Required: No

Response Elements

The following elements are returned in a CreateSnapshotResponse element.

requestId

The ID of the request.

Type: xsd:string

snapshotId

The ID of the snapshot.

Type: xsd:string

volumeId

The ID of the volume.

Type: xsd:string

status

The snapshot state.

Type: xsd:string

Valid values: pending | completed | error

startTime

The time stamp when the snapshot was initiated.

Type: xsd:dateTime

progress

The progress of the snapshot, as a percentage.

Type: xsd:string

ownerId

The AWS account ID of the Amazon EBS snapshot owner.

Type: xsd:string

volumeSize

The size of the volume, in GiB.

Type: xsd:string

description

A description of the snapshot.

Type: xsd:string

Examples

Example Request

This example creates a snapshot of volume vol-1a2b3c4d.

https://ec2.amazonaws.com/?Action=CreateSnapshot
&VolumeId=vol-1a2b3c4d
&Description=Daily+Backup
&AUTHPARAMS

Example Response

<CreateSnapshotResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
  <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
  <snapshotId>snap-1a2b3c4d</snapshotId>
  <volumeId>vol-1a2b3c4d</volumeId>
  <status>pending</status>
  <startTime>YYYY-MM-DDTHH:MM:SS.000Z</startTime>
  <progress>60%</progress>
  <ownerId>111122223333</ownerId>
  <volumeSize>30</volumeSize>
  <description>Daily Backup</description>
</CreateSnapshotResponse>