Amazon Machine Image (AMI) gives the information required to launch an instance, which is a virtual server in the cloud. There are multiple AMI available within the AWS, But what if we want to create custom AMI in AWS. This tutorial is all about how to create custom AMI in AWS.
The following are the main reasons to create custom AMI in AWS:
- You need pre-bundle packages instead of installing them after the instance boots.
- You need to control the timing of package updates to provide a consistent base image for your layer.
- You need instances—LOAD-BASED instances in particular—to boot as quickly as possible.
Once you are ready with your customised EC2 instance. We can create custom AMI in AWS so that it can be used to launch as many required instances based on requirement. As an example we are going to create custom AMI in AWS for our web server.
Steps to create custom AMI in AWS:
- Login to AWS console
- Goto EC2 dashboard and select the instance for which you want to create custom AMI.
- Then goto Action button and select Image-> Create image as below:
- In the next pop-up window system will ask for “Image name” and “Image description“. Also you can change the size of root volume if you want to change however in our case we are keeping the same as below. Click the “Create Image” button.
How to check created Custom AMI.
- To Check the status of AMI creation process Goto Images–>AMIs. You will see pending status as below for some time.
- Once the process is completed status will become as “Available”:
- Also in the snapshot within in the EBS (ELASTIC BLOCK STORE), you can able to see the snapshot being created for the AMI image created by us.
How to Launch custom AMI in AWS.
Now in case in future if you would like to launch this customised AMI, just goto EC2 dashboard select Launch Instance. And you can able to see our custom AMI created under “My AMIs” tab.Once you select this AMI , it will get launched at the end of the process.
So this is how we can create custom AMI in AWS.