Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon EC2 - difference between Images and Volumes

BTW, I'm running my LAMP server on m1.Small (running on Amazon AMI 32bit) at the moment. (EBS)

Data regarding this question Linux and its configuration (e.g. Timezone) apps I install (e.g. s3cmd, apache) "/var/www/html" - where my Web is stored mysql data After hours of googling and reading their help manuals I am confused with concepts as the following. * Images have 1,2,3,4 * Volumes have 2,3,4? (i.e. No OS data in Volume)

Is my understanding correct?

So if I want to go back to a specific snapshot. Using Volumes. (i.e. only works if they share the same AMI) 1. create the Volume from the snapshot 2. detach a Volume from the instance 3. attach the new Volume created by above process to the instance

Using Images. 1. create Image from snapshot 2. launch an instance from the Image 3. Associate Old Elastic IP to the New instance 4. Terminate Old instance etc

I'm sure I am misunderstanding something here. Basically what the difference between Images and Volumes?

like image 813
user706087 Avatar asked Dec 10 '22 05:12

user706087


1 Answers

Your descriptions of how to get back to old copies of the system are pretty much correct, you just ned a little clarification in terminology.

An EBS volume is like a hard disk drive connected to your instance.

You can have multiple volumes attached at the same time at different mount points, just like on a physical server.

One of those volumes has the root file system with the core of the OS you are running. It might also have your web pages and MySQL data or you might configure those on a separate attached volume.

A snapshot is like a copy of a hard disk drive that can be used to create new hard disk drives (volumes) with the same content. You can take snapshots of any volume(s), os root or data. When you create a new AMI (image) it is done using snapshots.

An AMI is a snapshot of the root EBS volume that is also registered in a special way so that it can be used to start new instances. The registered AMI can also reference additional snapshots that should be copied to new volumes and attached to the new instance.

You can detach and attach non-root volumes from/to instances while they are running. You can also detach and attach root EBS volumes, but only while the instance is stopped (not common, but occasionally useful).

A data volume can be moved or copied between instances even if they are not running the same AMI.

like image 135
Eric Hammond Avatar answered Feb 12 '23 10:02

Eric Hammond