Overview
An AMI defines every aspect of the software state at instance launch, including:
- The Operating System (OS) and its configuration
- The initial state of any patches
- Application or system software
An AMI includes the following:
-
One or more Amazon Elastic Block Store (Amazon EBS) snapshots, or, for instance-store-backed AMIs, a template for the root volume of the instance (for example, an operating system, an application server, and applications).
-
Launch permissions that control which AWS accounts can use the AMI to launch instances.
-
A block device mapping that specifies the volumes to attach to the instance when it's launched.
AMI Sources
All AMIs are based on x86 OSs, either Linux or Windows. There are four sources of AMIs:
- Published by AWS
- The AWS Marketplace
- Generated from Existing Instances
- Uploaded Virtual Servers
AMI Types
You can select an AMI to use based on the following characteristics:
-
Region
-
Operating system
-
Architecture (32-bit or 64-bit)
-
Launch permissions
-
Storage for the root device
Region
-
AMIs are specific to a region, but can be copied over to other regions
Launch permissions
The owner of an AMI determines its availability(who has access to the AMI) by specifying launch permissions. Launch permissions fall into the following categories.
Launch permission | Description |
---|---|
public | The owner grants launch permissions to all AWS accounts. |
explicit | The owner grants launch permissions to specific AWS accounts. |
implicit | The owner has implicit launch permissions for an AMI. |
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 Elastic Block Store (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.
The following table summarizes the important differences when using the two types of AMIs.
Characteristic | Amazon EBS-backed AMI | Amazon instance store-backed AMI |
---|---|---|
Boot time for an instance |
Usually less than 1 minute |
Usually less than 5 minutes |
Size limit for a root device |
16 TiB |
10 GiB |
Root device volume |
EBS volume |
Instance store volume |
Data persistence |
By default, the root volume is deleted when the instance terminates(By default, EBS root volumes have the |
Data on any instance store volumes persists only during the life of the instance. |
Modifications |
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 |
You're charged for instance usage, EBS volume usage, and storing your AMI as an EBS snapshot. |
You're charged for instance usage and storing your AMI in Amazon S3. |
AMI creation/bundling |
Uses a single command/call |
Requires installation and use of AMI tools |
Stopped state |
Can be in a stopped state. Even when the instance is stopped and not running, the root volume is persisted in Amazon EBS |
Cannot be in stopped state; instances are running or terminated |
AWS EBS vs Instance Store: https://jayendrapatil.com/aws-ebs-vs-instance-store/
Linux AMI virtualization types
- Linux Amazon Machine Images use one of two types of virtualization:
- paravirtual (PV)
- hardware virtual machine (HVM).
- The main differences between PV and HVM AMIs are the way in which they boot and whether they can take advantage of special hardware extensions (CPU, network, and storage) for better performance.
- For the best performance, we recommend that you use current generation instance types and HVM AMIs when you launch your instances.
- Historically, PV guests had better performance than HVM guests in many cases, but because of enhancements in HVM virtualization and the availability of PV drivers for HVM AMIs, this is no longer true, HVM guests can get the same, or better, performance than paravirtual guests.
HVM
- HVM AMIs are presented with a fully virtualized set of hardware and boot by executing the master boot record of the root bloc