Amazon Elastic Compute Cloud
User Guide (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...

Creating an Amazon EBS Volume

To use Amazon EBS, you first create a volume that can be attached to any Amazon EC2 instance within the same Availability Zone. You can create an Amazon EBS volume with data from a snapshot stored in Amazon S3 or as a new blank volume with no data. You can also create and attach Amazon EBS volumes when you launch instances. For more information on volumes and snapshots, see Amazon Elastic Block Store. The following procedure walks you through the process of creating an Amazon EBS volume from a snapshot.

AWS Management Console

To create an Amazon EBS volume

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

  2. Click Volumes in the Navigation pane.

    The console displays a list of current volumes.

  3. Click Create Volume.

    The Create Volume dialog box appears.

  4. Configure the following settings and click Create.

    • Size of the volume (in GiB)

    • Availability Zone in which to launch the instance

    • The ID of the snapshot from which you are launching the volume (optional)

      [Note]Note

      If you specify both a volume size and a snapshot ID, the size must be equal to or greater than the snapshot size.

    Amazon EC2 begins creating the volume.

New volumes created from existing Amazon S3 snapshots load lazily in the background. This means that after a volume is created from a snapshot, there is no need to wait for all of the data to transfer from Amazon S3 to your Amazon EBS volume before your attached instance can start accessing the volume and all of its data. If your instance accesses data that hasn’t yet been loaded, the volume will immediately download the requested data from Amazon S3, and then will continue loading the rest of the data in the background.

Accessing data for the first time from Amazon S3 might cause latency during the loading period. To avoid the possibility of an increased latency during the background loading of the data, you first access/read all performance-critical data from the volume (or read the entire volume) to ensure it has been loaded to the EBS volume from Amazon S3 before running the application.

Command Line Tools

To create an Amazon EBS volume

  1. Enter the following command.

    PROMPT>  ec2-create-volume --size 80 --availability-zone us-east-1a

    Amazon EC2 returns information about the volume that is similar to the following example.

    VOLUME  vol-c7f95aae    80             us-east-1a      creating        2010-03-30T13:54:37+0000
  2. To check whether the volume is ready, use the following command.

    PROMPT>  ec2-describe-volumes volume_id

    Amazon EC2 returns information about the volume that is similar to the following example.

    VOLUME  vol-c7f95aae    80             us-east-1a      available       2010-03-30T13:54:37+0000

API

To create an Amazon EBS volume

  • Construct the following Query request.

    https://ec2.amazonaws.com/
    ?Action=CreateVolume
    &Size=size
    &AvailabilityZone=zone
    &...auth parameters...
    

    Following is an example response.

    <CreateVolumeResponse xmlns="http://ec2.amazonaws.com/doc/2011-12-15/">
      <requestId>06eabcdf-95b8-424f-87dc-da8e976f7858</requestId>
      <volumeId>vol-d11fbbb8</volumeId>
      <size>80</size>
      <snapshotId/>
      <availabilityZone>us-east-1a</availabilityZone>
      <status>creating</status>
      <createTime>2010-03-23T09:16:24.000Z</createTime>
    </CreateVolumeResponse>