Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Amazon AMI and EBS snapshot

My basic need is that i should be able to make new instance from my saved image for current running Centos with all settings.

I am thinking of two options

  1. Create the AMI from the any state
  2. Create the snap shots of EBS

I am confused what is the differnece between them. Are they same or different.

can i make new instances from EBS snapshots/

Also can i use AMI on my localhost to create the same OS

like image 360
user1958218 Avatar asked Jul 01 '13 05:07

user1958218


2 Answers

There are two types of AMIs/instances: EBS boot and instance-store (sometimes referenced as S3-based). You are probably using EBS boot, so this answer will relate to that type.

An EBS boot AMI is an EBS snapshot of a boot EBS volume with some extra attributes including:

  • Registered as an AMI with an AMI id
  • AKI (kernel)
  • ARI (ramdisk)
  • architecture (e.g., 64-bit)
  • block device mappings (e.g., where volumes should be created/attached)
  • description, name
  • permissions (who is allowed to run the AMI)

If you create an AMI of the running instance, you should be able to start new instances in the same state. Make sure you test this process so that you know it works.

If you simply snapshot the EBS volume(s) of your running instance, you will be able to create volumes from those snapshots to access the configuration and data.

It is also possible to take an EBS snapshot of an EBS boot volume and register it as an EBS boot AMI so that you can run more instances starting with that state. When registering the AMI, you'll need to specify the correct AKI, architecture, and other meta-data in order for this to work, so research and practice before you trust this approach.

like image 187
Eric Hammond Avatar answered Sep 24 '22 13:09

Eric Hammond


It took me a while to understand it as I am new with it, but here is a thing if you are using EBS backed:

  1. If you want to start immediately create AMI Image( which creates image of OS and store data as EBS Snapshot), then the whole AMI Image contains current state of your instance which is installed OS which is all config and data files.

  2. If you only take EBS snapshot, then for restore you need to launch new AMI, and you can attach this volume to it for just to access data. If your new AMI has different OS or upgraded may be few of your config won't work and you need to install your packages from scratch. So you should check this first.

In simple words EBS Snapshot can not be used as root volume unless you make and own its AMI image :-)

like image 20
Adeel Ahmad Avatar answered Sep 20 '22 13:09

Adeel Ahmad