Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing the instance storage Amazon EC2

I know it is a newbie question but the documentation is really not clear about that.

I have successfully launched a Cluster Instances Amazon Linux AMI 2011.02.1 cc1.4xlarge instance. I need to upload and process a 15 GB text file and I don't know how to activate the "additional" storage.

By default, I have just 8 GB of storage. Can someone help me writing simple and clear instruction on how to activate all the storage (1690 GB) I should have?

Thanks a lot in advance.

Regards,

Eugenio

like image 652
Eugenio Avatar asked Sep 02 '11 20:09

Eugenio


People also ask

Does EC2 instance have storage?

Amazon EC2 instance storeMany instances can access storage from disks that are physically attached to the host computer. This disk storage is referred to as instance store. Instance store provides temporary block-level storage for instances.

Where are AWS EC2 instances stored?

With Amazon EC2 instance store-backed AMIs, each time you customize an AMI and create a new one, all of the parts are stored in Amazon S3 for each AMI.


2 Answers

It's a very common question and there's a large confusion that everyone has around this when starting to work with AWS EC2.

There are 2 things to have in mind here :

  1. Instance Type
  2. AMI (Amazon Machine Image, basically a disk snapshot with some operating system)

Each AMI has some requirements that will dictate parts of the configuration of your created instance.

Here we're concerned with the Root Device type of an AMI :

EBS-backed AMI

These AMI's only work on instances that have an EBS volume attached. And therefore if you choose an EBS-backed AMI, the wizard will by default add an EBS volume (usually of size 8 GiB) without you noticing, and you'll be charged for this EBS separately in addition to the EC2 hourly charge. In this case when you ssh to your instance you will only find 8 GiBs of storage and not the large storage you're promised when you view the EC2 Pricing table at https://aws.amazon.com/ec2/pricing/ . And that is confusing.

If you also want to use your -usually large- instance store with these AMIs, then when you create that instance you have to explicitly add a volume and select Instance Store 0 from Volume Type (in Step 4 - Add Storage). You may have more than 1 drives assigned to your instance type, you need to add all of them in this case (Instance Store 0,1,..etc). These volumes can only be added at creation time. If the volumes were automatically mounted then you'll find them at /media/ephemral*, if not, you'll have to mount them manually.

Instance-Store-backed AMI

Those images use the Instance Storage as their root device (the OS will be installed on the instance store at / ). I think the confusion comes from the fact that these AMI's are not instantly viewable in the Quick Start tab of Step 1 at which you choose the AMI. All AMIs in the Quick Start tab are EBS-backed, and Instance Store AMIs are very uncommon these days, everyone uses EBS-backed AMIs because of their various speed and persistence benefits, and that's recommended by Amazon as well.

If you want an instance-store-backed AMI to avoid dealing with any EBS whatsoever, then in Step 1, choose the tab Community AMIs, and filter them by Root Device Type = Instance Store, then choose your AMI. Whether or not you add Instance Store 0 in Step 4 - Add Storage, the instance store will be available.

like image 115
MohamedEzz Avatar answered Nov 06 '22 06:11

MohamedEzz


You should be able to mount your ephemeral drives by following this guide.

Cheers.

like image 40
Nicolas Avatar answered Nov 06 '22 05:11

Nicolas