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...

CreateVolume

Description

Creates an Amazon EBS volume that can be attached to any Amazon EC2 instance in the same Availability Zone. Any AWS Marketplace product codes from the snapshot are propagated to the volume. For more information about Amazon EBS, see Amazon Elastic Block Store.

Request Parameters

Size

The size of the volume, in GiBs.

Type: String

Valid values: 1-1024

Valid values: If the volume type is io1, the minimum size of the volume is 10 GiB.

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

Required: No

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.

Required: Conditional

AvailabilityZone

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

Type: String

Default: None

Required: Yes

VolumeType

The volume type.

Type: String

Valid values: standard | io1

Default: standard

Required: No

Iops

The number of I/O operations per second (IOPS) that the volume supports.

Type: Integer

Valid values: Range is 100 to 4000.

Default: None

Required: Conditional

Condition: Required when the volume type is io1; not used with standard volumes.

Response Elements

The following elements are returned in a CreateVolumeResponse element.

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

The snapshot from which the volume was created, if applicable.

Type: xsd:string

availabilityZone

The Availability Zone for the volume.

Type: xsd:string

status

The volume state.

Type: xsd:string

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

createTime

The time stamp when volume creation was initiated.

Type: xsd:dateTime

volumeType

The volume type.

Type: xsd:string

Valid values: standard | io1

iops

The number of I/O operations per second (IOPS) that the volume supports.

Type: xsd:int

Valid values: Range is 100 to 4000.

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/2013-02-01/">
  <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
  <volumeId>vol-1a2b3c4d</volumeId>
  <size>80</size>
  <snapshotId/>
  <availabilityZone>us-east-1a</availabilityZone>
  <status>creating</status>
  <createTime>YYYY-MM-DDTHH:MM:SS.000Z</createTime>
  <volumeType>standard</volumeType>
</CreateVolumeResponse>