Cloning your Instances on Amazon EC2

Multiple front-end web server setups are almost always in use these days. Instead of just one server serving web traffic, you create two or more servers which will share the load evenly to serve requests from users. These servers usually connect to a backend database server. On this tutorial, we’ll walk through the steps on adding another web-front end server by cloning you current web server node.

1. Create an AMI image

Login to your EC2 web console.

For cloning, we’ll use the AMIs feature of Amazon EC2 to create an image of you current web instance.

Go to Instances and click the instance you want to clone.

Click Actions> Create Image and a dialog window will appear to input the details.

Image name: Name of the image you’ll create

Image Description: Descriptive name for the image you’ll create

No Reboot: Check to ensure that current instance is not rebooted while imaging is done.

 

Once done with the adjustments, click Create Image to start imaging.

The created image will be shown on the Images > AMIs section. Wait until Amazon finishes the imaging.

This may take a few minutes (or hours), depending on the instance size.

 

2. Launch a New instance

Go to Images > AMIs and select the new AMI that you registered.

Click Actions > Launch

You’ll be prompted with the 7 Steps on creating a new instance.

  • Configure Instance Type

On Configure Instance Type, you’ll select the instance type for the new node. Choose the same specs that your current web server has.

  • Configure Instance

Click Configure Instance to proceed to the next screen. It is important here to select the same subnet or availability zone as you current instance to make sure they are on the same network location. Also check “Enable Termination Protection” option to ensure you don’t accidentally delete you instance.

  • Add Storage

On Add Storage Section, add additional storage to the instance if you need to. You have to configure this new disk on the OS side once the server is running.

  • Tag instance

On Tag instance Section, put a name for the instance.

  • Configure Security Group

On Configure Security Group section, you can create a new security group or just select from your current security group. You should select the same security group for you current web server instance.

  • Review and Launch

Lastly on Review and Launch, you’ll be presented with the summary of the options you’ve chosen for your instance.

When click Launch, you’ll be asked to assign a key pair for the instance. You can either generate a new one or use an existing key pair.

Now you can click Launch Instances and you’ll be able to see the new server in the “Instances” Section.

 

***Next steps for this is to add this instance to you Load Balancer which will be a topic for another post.

 

Notes:

You can delete AMI image you created by selecting it and clicking Actions > Deregister.

You should also delete the snapshot created so that you won’t incur additional fees.

Elastic Block Store > Snapshots and select the created snapshot. Click Actions > Delete to delete it.

 

 

———————————————

masterkenneth

Leave a Reply

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