Amazon Elastic Compute Cloud
API Reference (API Version 2011-12-15)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

CreateVolume

Description

Creates a new Amazon EBS volume that any Amazon EC2 instance in the same Availability Zone can attach to. For more information about Amazon EBS, go to the Amazon Elastic Block Store.

[Note]Note

You must specify an Availability Zone when creating a volume. The volume and the instance to which it attaches must be in the same Availability Zone.

Request Parameters

NameDescriptionRequired

Size

The size of the volume, in GiBs.

Type: String

Valid Values: 1-1024

Default: If you're creating a volume from a snapshot and don't specify a size, the default is the snapshot size.

Condition: Required if you're not creating a volume from a snapshot.

Conditional

SnapshotId

The snapshot from which to create the new volume.

Type: String

Default: None

Condition: Required if you are creating a volume from a snapshot.

Conditional

AvailabilityZone

The Availability Zone in which to create the new volume. Use DescribeAvailabilityZones to display Availability Zones that are currently available to your account.

Type: String

Default: None

Yes

Response Elements

The elements in the following table are wrapped in a CreateVolumeResponse structure.

NameDescription

requestId

The ID of the request.

Type: xsd:string

volumeId

The ID of the volume.

Type: xsd:string

size

The size of the volume, in GiBs.

Type: xsd:string

snapshotId

Snapshot from which the volume was created, if applicable.

Type: xsd:string

availabilityZone

Availability Zone in which the volume was created.

Type: xsd:string

status

Volume state.

Type: xsd:string

Valid Values: creating | available | in-use | deleting | deleted | error

createTime

Time stamp when volume creation was initiated.

Type: xsd:dateTime

Examples

Example Request

This example creates a new 80 GiB volume in Availability Zone us-east-1a.

https://ec2.amazonaws.com/?Action=CreateVolume
&Size=80
&AvailabilityZone=us-east-1a
&AUTHPARAMS

Example Response

<CreateVolumeResponse xmlns="http://ec2.amazonaws.com/doc/2011-12-15/">
  <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
  <volumeId>vol-4d826724</volumeId>
  <size>80</size>
  <snapshotId/>
  <availabilityZone>us-east-1a</availabilityZone>
  <status>creating</status>
  <createTime>2008-05-07T11:51:50.000Z</createTime>
</CreateVolumeResponse>