Module 6: Creating and using AMIs

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:diagram5.png

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.

  1. 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“.1.jpg
  2. 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.2.jpg3.jpg
  3. 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”4.jpg5.jpg6.jpg
  4. 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.7.jpg8.jpg

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.

  1. For launching EC2 instance from AMI images of Web Server, Click on “DinostoreWebServer” and select “Launch9.jpg
  2. Choose the instance type = General purpose, t2.micro. And Click “Next Configure Instance Details”.10.jpg
  3. 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.10.jpg
  4. Add storage, leave it to default if you don’t want to change.Then click “Add Tag“. Give a name “WebServer02”11.jpg12.jpg
  5. Click “Next: Configure Security Group”. Select an existing security group = WebRDPGroup. 13.jpg
  6. 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.14.jpg15.jpg
  7. Click “Launch Instances“. Your instance will be ready in a minute. 16.jpg
  8. You can now view the instance from the EC2 instances Dashboard. 17.jpg

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.

  1. 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.18.jpg19.jpg
  2. The website from Orginal Web Server: 20.jpg
  3. 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.21.jpg

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  🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s