Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Memory, Instance Storage and Volume in AWS

I am new to AWS functionality and is confused in these 3 things. To me if I consider

  1. Memory as the RAM
  2. Instance Storage as the hard disk space then what is size and volume type means?

enter image description here

like image 704
Ankur Verma Avatar asked Feb 11 '14 06:02

Ankur Verma


1 Answers

When you launch an instance on EC2, Amazon has to look for a physical server that will host your instance with enough unallocated capacity to be able to run your instance.

In the case of an m1.medium instance, this physical host would need to have enough unallocated resources so that the m1.medium instance specs would fit into it:

  • at least 1 unallocated core
  • at least 3.7 GiB of unallocated RAM
  • at least 1 disk with 410 GiB of unallocated space

So, from this description you see that "Memory" is the amount of RAM and "Instance Storage" is the amount of disk space inside the physical host that is running your instance.

Note that, I insist, this "Instance Store" is disk space local to the physical host. What does this imply? Well, if you stop the instance, you will deallocate all those resources so that another customer can use them. This means that you will deallocate the cores, the RAM and the disks. Which means the data saved on Instance Store is lost when you stop/terminate the instance, or whenever the physical host running the instance fails for whatever reason ("Everything fails, all the time" -- Werner Vogels, CTO at Amazon). This is why Instance Store is called ephemeral storage.

If you want persistent storage, then you'd need to use a service called Amazon EBS -- Amazon Elastic Block Store. In EBS, you create volumes. EBS Volumes are a kind of network attached storage. You can attach a Volume to any EC2 Instance in the same Availability Zone, then you can detach without losing data, then attach to another instance, and so on. When you stop an Instance, you don't lose data stored on EBS Volumes -- this is why they are called persistent storage.

In the screenshot in your question, what you see is that the Root volume (i.e., the "disk" where your operating system will be running) is an standard EBS volume (there's another kind of EBS volume, called PIOPS). This implies that any OS settings you change (and save to the root volume) will be persisted and survive an stop-start sequence, or instance restarts due to crashes.

There are some AMIs (Amazon Machine Images) that use Instance Store as the Root Volume. Instances launched with those AMIs won't persist any changes to the OS settings that are saved to the root volume -- therefore, if you stop them and start them again, you'd get a fresh OS.

I hope this answers your questions.

like image 80
Bruno Reis Avatar answered Sep 23 '22 04:09

Bruno Reis