AWS AMI – Amazon Machine Image

Filed Under: AWS
Amazon Machine Image Ami

AWS AMI or Amazon Machine Image (AMI) is a way to launch a virtual machine in the AWS cloud. In general, to launch a virtual machine we use the standard distribution of the providers. But what if you want to launch several identical instances of virtual machines. You need something that can give you identical instances each time you launch with a very short launch time.

The answers to all questions is Amazon Machine Image (AMI). You can launch identical instances as many as you want, all in one go. And it takes a very short time in AWS to launch a virtual machine with AMIs. We have launched an EC2 machine with an AMI in our post “Amazon EC2 – AWS Elastic Compute Cloud”.

What is AMI?

AMI is an abbreviation for “Amazon Machine Image”. Amazon Machine Image provides essential information to launch a virtual machine in the cloud. You can launch several instances at a time in case you want multiple instances with the same configurations.

An AMI typically contains three below things in it:

  1. Template – For the root volume for the instances (An application server, an OS, and applications)
  2. Permissions to Launch – Which account can use this AMI to launch instances.
  3. Block Device Mapping – that specifies the volumes to attach to the instance during its launch time.

AWS provides you the web interface to launch Amazon EC2 instance. It has ready to instantiate AMIs (Amazon Machine Images) available.

Types of AWS AMI

There are no certain types of AMI but you can choose an AMI based on the below characteristics:

  1. Operating System Based – You can choose a machine image based on the operating System such as Linux, Windows etc.
  2. Architecture (32-bit or 64-bit) Based – Based on the architecture of the underlying operating system.
  3. Region Specific – Region and availability zone specific machines images.
  4. Storage Based – Based on the storage for the root device. All Amazon Machine Images are either backed by Amazon EBS or by instance store.

    See the below summary table: (reference : https://aws.amazon.com)

    Storage Based Summary

    Storage Based Summary

  5. Launch Permission Based – The owner of the AMI can decide the visibility and launch permission of the AMI. Available launch permissions are:
    1. public – All AWS accounts gets the access of these AMIs.
    2. explicit – Owners grants the permission to specific AWS accounts.
    3. implicit – Only owner has the implicit permissions to launch the AMI.

Amazon Linux AMI Virtualization Types

AWS uses two types of virtualization for Amazon Machine Images:

  1. PV (paravirtual)
  2. HVM (hardware virtual machine)

The main differences between PV and HVM AMIs are their booting process. On how they can take advantage of special hardware extensions (CPU, network, and storage) for better performance.

Find/Use a Amazon Linux AMI

There are a couple of ways you can find a Linux Amazon Machine Images.

1. Choose AMI during the EC2 Launch

We have discussed and used this option during the EC2 instance launch in our post “Amazon EC2 – AWS Elastic Compute Cloud”.

Follow the below steps:

  1. Go to the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. Click on the “Launch Instance” button.

    Create Instance Ec2

    Create Instance EC2

  3. You will see the below option to “Choose an Amazon Machine Image (AMI)”. Choose an existing AMI for quick start.
    Step 1 Choose AMI

    Choose AMI

    You can see that there are three options available to choose the AMIs.

    • My AMI – The AMIs created by you will be there in this tab.
    • AWS Marketplace – The AWS Marketplace is for the paid Amazon Machine Images. You can create and sell your AMIs in AWS marketplace.
    • Community AMIs – The AMIs which are build by and for public usage.

2. Choose AMI from Image Page

  1. Go to the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. Select the “AMI” option from left navigation bar under the “IMAGES” menu. You will see the below page.

    Amazon Machine List Page

    Amazon Machine Image List Page

  3. Filter in the search bar is optional. Select the “Public Images” in the dropdown. Now, search on the any parameters such as Name, Owner, Architecture, Creation. Description, Image Type etc. There are many options available to search the AMI.

    List Public Amazon Machine Images

    List Public Amazon Machine Images

  4. Once you found the AMI of your choice, click on the “Launch” button. You will see the second step of launching an EC2 instance below:

    Choose Instance Type

    Choose Instance Type

Note: From here now on, you can follow the steps described in post Amazon EC2 – AWS Elastic Compute Cloud under heading “Setup EC2 Instance”.

Shared AMIs

As per the name, Shared AMIs are the Amazon Machine Images which are created by developers and are publically available for use. You can create and share the EMIs on AWS.

If you are going to use the shared AMIs then use these on your own risk. Amazon or developers can’t vouch for the integrity or security of AMIs shared by other Amazon EC2 users. AWS recommends using the AMIs from trusted sources only for security reasons.

Find Shared AMIs

We have already discussed this in the section above under the heading “Choose AMI from Image Page”. See the steps that we use to find public shared AMIs.

Publish a Public AMI

AWS allows you to create your own Amazon Machine Images and share them with other AWS users. You can restrict the use to certain AWS accounts also. You will not be billed if someone uses your AMI, only the user will be billed.

After you make an AMI public it will be available in the “Community AMIs” section. Follow the below steps to create a public AMI:

  1. Go to the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. Select the “AMI” option from left navigation bar under the “IMAGES” menu.
  3. Select the AMI from the list that you want to make public and then choose “Actions” option “Modify Image Permissions”.
  4. Choose option “Public” and “Save”.

Note: If you want to share the AMI to a certain AWS account then you can choose the “AWS Account Number” field and then “Add Permissions”.

You can purchase AWS AMI from the “Amazon Marketplace”.

Amazon EC2 is also integrated to use the Amazon Marketplace where developers can buy and sell their AMIs. You can find, Buy, and deploy your AMI here at https://aws.amazon.com/marketplace.

Launching an AMI from the Amazon Marketplace is exactly similar to any other instance launch. So, the steps are almost the same to find a paid AMI:

  1. Go to the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. Select the “AMI” option from left navigation bar under the “IMAGES” menu.
  3. Choose “Public Images” from the filter.
  4. Now in search bar, choose “Owner : AWS Marketplace”. And you will see the list of paid AMIs. See below screenshot for your reference:

    Paid Amazon Machine Images

    Paid Amazon Machine Images

  5. The rest of the steps are same to launch the instance from the chosen AMI.

Creating your own AMI

AWS provides you the options to create your own AMI as well. The classical case of creating AMI is that you have an EC2 instance running and want to make an AMI of it. So that you can launch other instances in the future from this.

Let’s create an AMI from the running EC2 instance. Please follow the below steps:

  1. Go to the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. Select the EC2 instance, click on “Actions”. Drag mouse on the “Image” submenu and you will see the below options:

    Create Amazon Machine Image

    Create Amazon Machine Image

  3. Click on “Create Image”, below dialog will open with some inputs to fill.
    Fill Details To Create Amazon Machine Image

    Fill Details To Create Amazon Machine Image

    • Instance Id – EC2 instance Id
    • Image Name – You can give any name to your AMI
    • Image Description – (optional)
    • Instance Volume – AWS will pick the default volume settings which is attached with your instance. You can change the volume size and volume type as per your requirements.
    • You can also attach new volume to your AMI
  4. Click on “Create Image” button. AWS will start creating your AMI in back and you will receive a message that “Create Image request receive”.

    Create Image Request Received

    Create Image Request Received

  5. You can on the Image name or “Close” button and you will see that your image has been listed in AMIs under “Owned by me” section.
    Amazon Machine Image Created

    Amazon Machine Image Created

Deregister Your AMI

If the AMI is no longer required then you can deregister it in simple steps.

  1. Go to the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. Select the “AMI” option from left navigation bar under the “IMAGES” menu.
  3. Select option “Owned by me” and choose the AMI to deregister from the “Actions”.

    Deregister Amazon Machine Image

    Deregister Amazon Machine Image

  4. Click on “Deregister” and you system will prompt a dialog with an options to “Continue”.

    Deregistered Amazon Machine Image

    Deregistered Amazon Machine Image

Click on “Continue” button and your AMI will be deregistered. You will not have the AMI under the section “Owned by me”.

Leave a Reply

Your email address will not be published. Required fields are marked *

close
Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages