Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon Elastic Block Store and EC2 drive

I am fairly new with AWS(just have a free AWS EC2 instance to test out AWS stuff) so the question might sound silly.

Today I got a mail that my Amazon Elastic Block Storeage has reached 85% usage on my free AWS account which is about 25 GB of the allocated 30 GB. From what I read today, Amazon EBS is a persistent store used for EC2 instances.

However I can see in my EC2 instance that df -h just show 2 GB usage and available disk as 28 GB as this is just my practice instance.

Am I missing some important piece of information here?

like image 823
Pulkit Gupta Avatar asked Jun 01 '18 13:06

Pulkit Gupta


People also ask

Is EC2 instance store block storage?

An instance store provides temporary block-level storage for your instance. This storage is located on disks that are physically attached to the host computer.

What is the difference between EBS and EC2 instance store?

The instance store is ideal for temporary storage, because the data stored in instance store volumes is not persistent through instance stops, terminations, or hardware failures. For data you want to retain longer, or if you want to encrypt the data, use Amazon Elastic Block Store (Amazon EBS) volumes instead.

What is Amazon Elastic Block Store used for?

Amazon Elastic Block Store (Amazon EBS) provides block level storage volumes for use with EC2 instances. EBS volumes behave like raw, unformatted block devices. You can mount these volumes as devices on your instances.

What is EC2 block storage?

Amazon Elastic Block Store (Amazon EBS) is an easy-to-use, scalable, high-performance block-storage service designed for Amazon Elastic Compute Cloud (Amazon EC2).


2 Answers

EBS devices are block devices.

This means the service does not know how much data you actually store on them -- it only knows how much storage space you allocated. So, the results of df -h don't matter. The actual size of the volume is all that matters -- that's the basis for billing. The rest of the space (that space you aren't current using) is still storing something, even it if's just 0's, but the service is unaware of what you've stored. (Other storage services like S3 and EFS bill for actual data stored, because they are not block storage services.)

Now, the free tier allows 30 gigabyte-months of EBS volume usage. You can use more than that, but this is the limit that's provided for free. You'll be billed for any more than this.

A gigabyte-month means 1 gigabyte of block storage space, allocated for 1 month, regardless of how you use it.

Also, 2 gigabytes of allocated storage for 15 days is 1 GB-month.

Also, 10 gigabytes of allocated storage for 3 days is 1 GB-month.

...etc.

The free tier, then, would allow you to have a 30 GB volume for 30 days, or a 60 GB volume for 15 days, or even a 900 GB volume... but you could have it for only 1 day. But to avoid continuing charges, such a volume must be deleted -- not just the files on the volume.

The warning message was correct. If you have a 30 GB volume in place for 26 days, then you have used 26 GB-months of storage, which is 86.7% of the free tier limit of 30 GB-months.

like image 64
Michael - sqlbot Avatar answered Sep 21 '22 19:09

Michael - sqlbot


For anyone stumbling upon this in 2021:

Free Trial provides 750 Hrs of Amazon EC2 Linux t2.micro and 750 Hrs of Amazon EC2 Windows t2.micro per month. However, both of them will add in to the free 30GB EBS pool. So make sure the memories allotted to both the VMs sum up to 30 GB or less.

like image 34
Harshith Thota Avatar answered Sep 20 '22 19:09

Harshith Thota