Amazon Elastic Compute Cloud
User Guide (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

AMI Basics

An AMI contains all information necessary to boot an Amazon EC2 instance with your software. An AMI is like a template of a computer's root volume. For example, an AMI might contain the software to act as a web server (Linux, Apache, and your web site) or it might contain the software to act as a Hadoop node (Linux, Hadoop, and a custom application). You launch one or more instances from an AMI. An instance might be one web server within a web server cluster or one Hadoop node.

Available AMIs

Public AMIs can be launched by all AWS accounts. They are advertised and shared in the AWS AMI catalog. Amazon and the Amazon EC2 community provide a large selection of public AMIs. For more information, go to Amazon Machine Images (AMIs) in the AWS forum (https://forums.aws.amazon.com/).

Paid AMIs are AMIs that you purchase from the AWS Marketplace, developers, or through a service contract from an organization such as Red Hat. If you are interested in the AWS Marketplace, visit AWS Marketplace. If you're interested in selling an AMI to other developers, go to http://aws.amazon.com/devpay.

The AWS Management Console (at http://aws.amazon.com/console) enables you to search for an AMI that meets specific criteria, and then launch instances from that AMI. For example, you can view the AMIs that Amazon has provided, the AMIs that the EC2 community has provided, or AMIs that use a certain platform (such as Windows, Red Hat, CentOS, or Ubuntu).

You might find that public AMIs suit your needs. However, you might want to customize a public AMI and save that customized AMI for your own use later on. For more information about creating your own AMIs, see Creating Your Own AMIs.

After you create a new AMI, you can keep it private so that only you can use it, or you can share it with only specific AWS accounts that you specify. Another option is to make your customized AMI public so that the EC2 community can use it. Building safe, secure, usable AMIs for public consumption is a fairly straightforward process, if you follow a few simple guidelines. For information on how to use shared AMIs and how to share AMIs, see Shared AMIs and Sharing AMIs Safely.

To help categorize and manage your AMIs, you can assign tags of your choice to them. For more information, see Tagging Your Amazon EC2 Resources.

Storage for the Root Device

All AMIs are categorized as either backed by Amazon EBS or backed by instance store. The former means that the root device for an instance launched from the AMI is an Amazon EBS volume created from an Amazon EBS snapshot. The latter means that the root device for an instance launched from the AMI is an instance store volume created from a template stored in Amazon S3. For more information, see Amazon EC2 Root Device Volume.

This section summarizes the important differences between the two types of AMIs. The following table provides a quick summary of these differences.

CharacteristicAmazon EBS-BackedAmazon instance store-backed

Boot Time

Usually less than 1 minute

Usually less than 5 minutes

Size Limit

1 TiB

10 GiB

Root Device Volume

Amazon EBS volume

Instance store volume

Data Persistence

Data on Amazon EBS volumes persists after instance termination; you can also attach instance store volumes that don't persist after instance termination

Data on instance store volumes persists only during the life of the instance; you can also attach Amazon EBS volumes that persist after instance termination

Upgrading

The instance type, kernel, RAM disk, and user data can be changed while the instance is stopped.

Instance attributes are fixed for the life of an instance

Charges

Instance usage, Amazon EBS volume usage, and Amazon EBS snapshot charges for AMI storage

Instance usage and Amazon S3 charges for AMI storage

AMI Creation/Bundling

Uses a single command/call

Requires installation and use of AMI tools

Stopped State

Can be placed in stopped state where instance is not running, but the instance is persisted in Amazon EBS

Cannot be in stopped state; instances are running or terminated

Size Limit

Amazon EC2 instance store-backed AMIs are limited to 10 GiB storage for the root device, whereas Amazon EBS-backed AMIs are limited to 1 TiB. Many Windows AMIs come close to the 10 GiB limit, so you'll find that Windows AMIs are often backed by an Amazon EBS volume.

Note

All Windows Server 2008, Windows Server 2008 R2, and Windows Server 2012 AMIs are backed by an Amazon EBS volume by default because of their larger size.

Stopped State

You can stop an Amazon EBS-backed instance, but not an Amazon EC2 instance store-backed instance. Stopping causes the instance to stop running (its status goes from running to stopping to stopped). A stopped instance persists in Amazon EBS, which allows it to be restarted. Stopping is different from terminating; you can't restart a terminated instance. Because Amazon EC2 instance store-backed AMIs can't be stopped, they're either running or terminated. For more information about what happens and what you can do while an instance is stopped, see Stopping Instances.

Default Data Storage and Persistence

Instances that use instance store for the root device automatically have instance stores available on them (for the root partition and other data you want to add). Any data on those stores is deleted if the instance fails or terminates (except for data on the root device). However, after you launch an instance, you can provide it with persistent non-root data by attaching one or more Amazon EBS volumes.

Instances that use Amazon EBS for the root device automatically have an Amazon EBS volume attached. The volume appears in your list of volumes like any other. The instances don't expose ephemeral storage by default. However, you can add ephemeral storage by using a block device mapping. You can also add additional Amazon EBS volumes for non-root data; for more information, see Block Device Mapping). For information about what happens to the ephemeral storage and volumes when you stop an instance, see Stopping Instances.

Boot Times

Amazon EBS-backed AMIs launch faster than Amazon EC2 instance store-backed AMIs. When you launch an Amazon EC2 instance store-backed AMI, all the parts have to be retrieved from Amazon S3 before the instance is available. With an Amazon EBS-backed AMI, only the parts required to boot the instance need to be retrieved from the snapshot before the instance is available. However, the performance of an instance that uses an Amazon EBS volume for its root device is slower for a short time while the remaining parts are retrieved from the snapshot and loaded into the volume. When you stop and restart the instance, it launches quickly, because the state is stored in an Amazon EBS volume.

AMI Creation

To create Linux/UNIX AMIs backed by instance store, you must create an image of your instance on the instance itself, but there aren't any API actions to help you. To create a Windows AMI backed by instance store, there's an API action that creates an image and another API action that registers the AMI.

AMI creation is much easier for AMIs backed by Amazon EBS. The CreateImage API action creates the AMI on both Linux/UNIX and Windows. This API action creates your Amazon EBS-backed AMI and registers it. There's also a button in the AWS Management Console that lets you create an image from a running instance. For more information, see Creating Amazon EBS-Backed Linux AMIs.

How You're Charged

With AMIs backed by instance store, you're charged for AMI storage and instance usage. With AMIs backed by Amazon EBS, you're charged for volume storage and usage in addition to the AMI and instance usage charges.

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. So, the storage footprint for each customized AMI is the full size of the AMI. For Amazon EBS-backed AMIs, each time you customize an AMI and create a new one, only the changes are stored. So the storage footprint for subsequent AMIs you customize after the first is much smaller, resulting in lower AMI storage charges.

When an Amazon EBS-backed instance is stopped, you're not charged for instance usage; however, you're still charged for volume storage. We charge a full instance hour for every transition from a stopped state to a running state, even if you transition the instance multiple times within a single hour. For example, let's say the hourly instance charge for your instance is $0.10. If you were to run that instance for one hour without stopping it, you would be charged $0.10. If you stopped and restarted that instance twice during that hour, you would be charged $0.30 for that hour of usage (the initial $0.10, plus 2 x $0.10 for each restart).