Lab 6 Creating and Using AMIs
By using Amazon Machine Image (AMI) provides the information required to launch an Instance, which one is virtual on the cloud. Just specify an AMI when you launch an Instance, you can launch many same Instance at the same time as you need. By using AMI we are able to make a template for the root volume to specific the Instance, also set some permissions for use,
This lab Will cover following steps which is as bellow,
- Create Image of the existing Instance
- Launch AMI Instance and create new Instance base on main Instance
- Use a new Image Instance which is base on main Instance and then run an application using AMI DNS address
Step 1. To create an image of the existing Instance just go to the Services on the AWS console and click on EC2 in Compute Section,
After come with the main page of EC2 click on Instances and select the main Instance for which You want to create Image, right click on it and go to image and select Create Image,
After click on that option there is a new popup on the screen, give a image name and the description for that image which you are going to create, Stay with default storage and if you required more then edit it. At the bottom of the popup hit on Create Image and you will got a success message for first Instance.
For Second Server do a same process as I did and you can see in bellow image please follow it,
Step 2. After creating this two image for the Instance go to the AMIs option which is on the left side of the console and click on it,
In here you are able to see a newly created Images of the Instances and also saw a status of that two images if you saw a status is panding then wait for a while till the status will become available as in second image.
Step .3 After got a available status just click on first image and right click on that image and click on launch, in this process we are going to create a new Instance using a same process but it would be an image of the main Instance,
Select Instance type,
Select subnet and also a IAM role which is use in the main Instance and go to next step,
Give a Tag for this Instance to understand this one is Image of the Original one,
Select same security group which is selected in real Instance before,
Also select a same key for the login process so it would be easy to handle both Instance by one key,
Step 4. After all the process just browse a application using a new created Instance DNS and see what is the difference, In bellow image I run a application using a original Instance’s DNS address son the server IP would be different you can see the URL and the Server IP in red highlight,
In a bellow image I run an application using AMIs Instance DNS address so you can see a URL which is different from the previous image and also a server IP would also different both different you saw in red highlights.
In this lab I learn how to make a image of the existing Instance and also how to launch and use that using new DNS so you are able to make secure your own main Instance and run your application using that image instance using same security group and same access key.
Basically we create a Instance for which one is already exist but using a different storage so for AMI, Amazon services will charge on the storage only nothing else.