8
votes

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

3

3 Answers

9
votes

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.

3
votes

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 :-)

0
votes

In brief, EBS boot AMI = EBS root volume snapshot + metadata


For better understanding, you can play it through hands on.

create an EBS snapshot for a particular running instance.

enter image description here

Find this snapshot.

enter image description here

Fill some meta data, and build image(AMI)

enter image description here

You did it. A brand new AMI has been created.

enter image description here