How to Create or Delete an Amazon EBS Volume

How to Create or Delete an Amazon EBS Volume

The Amazon Elastic Block Store (Amazon EBS) offers persistent storage for Amazon EC2 instances. Amazon EBS volumes provide a scalable storage service, which  persists independently of the instance life. An EBS volume is cheaper, scalable and comes with a new High IOPS option. An EBS volume can be attached as a root partition to an EBS backed AMI instance or as a detachable device to an Instance store backed AMI instance. The user can attach upto 16 EBS volumes to an instance. Amazon EBS volumes provide highly available as well as extremely reliable persistent data storage.

The present guide demonstrates how to create or delete an EBS volume.

1. Go to the AWS console through the URL Select the EC2 service. From the EC2 dashboard, select EBS Volumes or Volumes.

2. The EBS Volumes dashboard lists all the volumes available in that region. Click on “Create Volume”.

3. In the Create Volume dialog, select the volume types. AWS provides two types of volumes. A standard EBS volume generally provides about 100 IOPS on an average. However, in comparison AWS offers a new type of volume called Provisioned IOPS, which provides for a performance of up to 2000 IOPS.

4. For the standard volume, provide the value for the volume size and select the availability zone and snapshot. The availability zone is very important as a volume can be attached to only an instance in the same availability zone. Click on “Yes, Create”.

5. The volume will be created and available in the EBS dashboard. Since it has not been assigned to any instance it will be in the “available” state.

6. Select “Provisioned IOPS” in step#3, if the user wants to create a provisioned IOPS volume. Provide the value for IOPS, the size (GB) and select the availability zone. Click on “Yes, Create”.

7. The resultant volume type will be io1. It will display the IOPS in brackets.

8. To delete a volume, select the volume and right click.. Select “Delete Volume”.

9. AWS will confirm before deleting the volume. Click on “Yes, Delete”.

10. The volume will be in a deleting state for sometime. It will then be deleted.

11. To run the above mentioned steps through the command line interface, first setup AWS EC2 CLI to launch an instance with the command line option, as explained here.

12. Run the following command to create the volume in the specified region.:

Ec2-create-volume --region <region name> --availability-zone <zone name> --size <size in GB>

To list all the volumes available in the region:

ec2-describe-volume -- region <region name>

To create a provisioned IOPS volume, run the command:

ec2-create-volume --region <region name> --availability-zone <availability zone name> --size <size in GB> -t io1 –i  <IOPS>

To delete a volume, run the command:

Ec2-delete-volume --region <Region Name> <volume name>

13. The actual output is shown below:

You must be to post a comment.

* As a bonus, you'll receive our weekly newsletter!

Hitchhiker's Guide to The Cloud

Newvem's eBook for Cloud Operations