Amazon Machine Images (AMI) is a template for the root volume for the instance such as an operating system, an application server, and applications. It gives the information required to launch an instance, which is a virtual server in the cloud.
- A block device mapping that specifies the volumes to attach to the instance when it’s launched
Benefits and features
- The benefit of the AMI is that you can launch as many instances as you need and you can also specify an AMI or as many different AMIs as you need.
- You can define the permission during launch for controlling which AWS account can use the AMI to launch.
- You can also specify a block device mapping of the volumes to attach to the instance while it is launching. (Sources: docs.aws.amazon.com)
Task list for the module 6:
- To create a new image(template) of current Web Server instance
- To launch the EC2 AMIs of Web Server and queue server instance
- To configure the resources for WEB SERVER 02 Instance read Replica from original Web Server
The architecture of the project:
Steps for the task: To create a new image(template) to current Web Server instance
In this task, I will demonstrate how to create AMI from original Server. You can launch as many instances as you want from your virtual machines template. AMI helps to create a real only replica server as the same configuration of production Server. It helps to maintain load balancing and high-performance execution environment for applications running on Amazon EC2, control failover and data loss.
- For creating an image file, go to EC2 Console from services menu in the AWS management tools. Right click on your web server EC2 instance. Select “Image” and Click “Create Image“.
- Define the name and description for your new image. As it is your Dinostore Webserver AMI. Then give a meaningful name so that you can identify easily which AMI it is! In my case, I gave Image ID: “DinoStoreWebServer”, and image description: “Image of DinoStore websiteVMm”. Then Click “Create Image”. Your AMI will be ready in a minute.
- Now You need to create another AMI for your queue Server. Follow the same procedure that I did for web server AMI. In this case, Image Name: “DinoQueueServer”, and image Description: “Image of DinoStore queue server VM”
- Now go to the “IMAGES” options under EC2 Dashboard from EC2 management console page. Click “AMIs“. You can view now your newly created two images.
Steps for the task: To launch the EC2 AMIs of Web Server and queue server instances
In this Steps, We will see how to launch the EC2 AMIs for creating the read-only replica servers. The configuration of original servers and replica servers would be same.
- For launching EC2 instance from AMI images of Web Server, Click on “DinostoreWebServer” and select “Launch“
- Choose the instance type = General purpose, t2.micro. And Click “Next Configure Instance Details”.
- In the subnet section, If you want to spread up your Web Server instance in AZ choose “No Preference” or you can choose your own preference. In my case, I chose my own preference. And IAM role= “WebServerRole” that we made previously.
- Add storage, leave it to default if you don’t want to change.Then click “Add Tag“. Give a name “WebServer02”
- Click “Next: Configure Security Group”. Select an existing security group = WebRDPGroup.
- Click “Launch and Review“. After reviewed, click “launch“. You will get key pair wizard. You can choose a new key pair or existing selected key pair. In my case, I chose existing key pair.
- Click “Launch Instances“. Your instance will be ready in a minute.
- You can now view the instance from the EC2 instances Dashboard.
Steps for the task: To configure the resources for WEB SERVER 02 Instance read Replica from original Web Server.
In this task, I will show how to configure DNS string for the dinostore website in the replica server. You will see your Dinostore website from the second instance. You can also view the IP Address of the replica server. The whole configuration will be a mirror of the production Web Server.
- Launch your replica Server “WebServer 02” by clicking “Connect”. Give right credential to the remote connection. Note: You will not “Get password” retrieve option here. You have to give your production web server password because it is the replica of that server.
- The website from Orginal Web Server:
- The website from replica Web Server. Notice the private IP address on the top left of the webpage. Both websites private IP address is different. That means, Our website is running on both servers successfully.
This module is easy to compare to our previous modules. I hope You will not face any problem during deployed your AMI instance for replica Server. A replica Server is essential because It makes the system highly available to the end users. And it also provides high performace by sharing load balance.
The next Module I will discuss “Using Elastic IPs”
Thank you 🙂