Amazon Computer Services
What is AMI?
The Amazon Machine Image (AMI) means the initial application that will be on an instance when it is released. An AMI represents 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
All AMIs are establishing x86 OSs, either Linux or Windows.
There are four sources of AMIs:
Published by AWS
AWS announces AMIs with versions of many different OSs, both Linux and Windows. These include multiple distributions of Linux (including Ubuntu, Red Hat, and Amazon’s distribution) and Windows 2008 and Windows 2012. It can releasing an instance based on one of these AMIs will outcome in the default OS settings, same to installing an OS from the standard OS ISO image. As with any OS installation, we should directly apply all suitable patches upon release.
AWS Marketplace is an online store that supports users find, buy, and directly start using the applications and services that run on Amazon EC2. Some AWS partners have made their application feasible in the AWS Marketplace. This provides two benefits: the customer does not need to install the software, and the license agreement is appropriate for the cloud. Instances launched from an AWS Marketplace AMI incur the standard hourly cost of the instance type plus an additional per-hour charge for the other software (some open-source AWS Marketplace packages have no other software charge).
Generated from Existing Instances
An AMI can be generated from an existing Amazon EC2 instance. This is a pervasive source of AMIs. Customers launch an instance from a published AMI, and then the instance is configured to meet all the customer’s corporate standards for updates, management, security, and so on.
An AMI is then generated from the configured instance and used to make all instances of that OS. In this way, all new instances follow the corporate standard, and it is more difficult for individual projects to launch non-conforming instances.
Uploaded Virtual Servers
It can using AWS VM Import/Export service, users can generate pictures from multiple virtualization formats, containing raw, VHD, VMDK, and OVA. The current document of provided OSs (Linux and Windows) can be found in the AWS reports. It is incumbent on the users to remain compliant with the licensing method of their OS vendor.
Types of AMI
There are two types of AMI which are as follows:
- Root device types
- Virtualization types
Root device types
While selecting an AMI, it is essential to learn the root device type related with the AMI. A bootable block device of the EC2 instance is called a rooted device. As EC2 instances are created from an AMI, it is essential to observe the root device type at the AMI.
An AMI can have two root device types:
- Amazon EBS-backed AMI (It can uses permanent block storage to save information)
- Instance store-backed AMI (It can uses ephemeral block storage to save information)
While generating an EC2 instance utilizing a web console, we can see whether an AMI is EBS or instance-backed. The following figure highlights the root device type while selecting an AMI:
Amazon EBS-backed AMIs launch faster than instance-stored AMIs as you only need to create the volume from the snapshot, for booting the instance. While AMIs with ephemeral storage take a longer time to boot, as you need to load all the software on the temporary storage before booting the instance.
Ephemeral storage devices are directly attached to the host computer, which makes it faster in accessing the data. However, stored data gets wiped out on restarting or shutting down the EC2 instance.
It is essential to remember that EBS-backed instances can be stopped; if ephemeral based instances are stopped or terminated, the data stored on the temporary storage gets wiped out from the storage.
It is similar to the root device type, and virtualization type is another aspect of an AMI that is critical to understand before choosing an AMI.
There are two types of virtualization types that are as follows:
- Paravirtual (PV): EC2 instances boots by PV-GRUB
- Hardware Virtual Machine (HVM):EC2 instances boots by Master Boot Record (MBR)
The main difference between these two virtualization types is in their booting technique and their capability to take benefits of particular hardware extensions, for a better execution of CPU, network, and storage devices.
For the best EC2 instance performance, it is hugely recommended we use the current instance type with HVM AMIs.
In the case of HVM, the OS can directly run on virtual machines without any modifications. This makes HVM-based instances faster and more efficient. PV-based instances can run on hardware without virtualization support. However, they cannot take advantage of particular hardware extensions.
Particular hardware extensions such as enhanced networking or GPU processing can make a massive difference for running certain application types. Before the enhancement in HVM technologies, PV-based instances used to perform better than HVM; however, with technological improvements, HVM is leading the race.
While creating an EC2 instance, you can see the type of virtualization against the AMI. The following figure highlights the virtualization type given against an AMI: