ec2-create-snapshot

Description

Creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You can use snapshots for backups, to make identical copies of instance devices, and to save data before shutting down an instance. For more information about Amazon EBS, go to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.

When taking a snapshot of a file system, we recommend unmounting it first. This ensures the file system metadata is in a consistent state, that the 'mounted indicator' is cleared, and that all applications using that file system are stopped and in a consistent state. Some file systems, such as xfs, can freeze and unfreeze activity so a snapshot can be made without unmounting.

For Linux/UNIX, enter the following command from the command line.

umount -d /dev/sdh

For Windows, open Disk Management, right-click the volume to unmount, and select Change Drive Letter and Path. Then, select the mount point to remove and click Remove.

Syntax

ec2-create-snapshot volume_id [-d description]

Options

NameDescriptionRequired

volume_id

The ID of the Amazon EBS volume of which to take a snapshot.

Type: String

Default: None

Example: vol-4d826724

Yes

--description description

Description of the Amazon EBS snapshot.

Type: String

Default: None

Constraints: Up to 255 characters

Example: Daily backup

No

Output

The command returns a table that contains the following information:

  • SNAPSHOT identifier

  • ID of the snapshot

  • ID of the volume

  • Snapshot state (e.g., pending, completed, error)

  • Time stamp when snapshot initiated

  • ID of the owner

  • Size of the volume

  • Description

Amazon EC2 displays errors on stderr.

Examples

Example Request

This example creates a snapshot of volume vol-4d826724.

PROMPT> ec2-create-snapshot vol-4d826724 --description "Daily Backup"
SNAPSHOT snap-c070c5a9 vol-9539dcfc pending 2009-09-16T14:31:29+0000
							218213537122 1 Daily Backup