A day with .Net

My day to day experince in .net

Load balance virtual machines in azure

Posted by vivekcek on December 16, 2012

The new IasS (Infrastructure as a service) facility in windows azure helps us to create virtual machines in azure cloud platform. We can install additional software’s to these virtual machines. We can create a server farm by networking these virtual machines. So we have a lot of control than the PaaS (Platform as a service) feature of azure cloud.

So in this post I am going to explain how to create 2 virtual machine, network them and configure load balancing. My final aim is to host an asp.net application in these 2 machines.

load

If you don’t know how to create virtual machines in azure read my old blog post. Create a virtual machine in azure and host an asp.net web site.

Setup Machine1

1. Select Windows Server 2012 from gallery.

1

2. Provide machine name and password. This password is used to login to your virtual machine through remote desktop.

2

3. Provide a DNS name. This DNS name is used to access the web site hosted in that virtual machine. We create a Standalone virtual machine.

3

4. We don’t want to create an availability set. So select none.

4

5. It will take some time to create a virtual machine. After that you have to add a TCP endpoint to this machine.

8

6. Give name and settings as shown below.

9

7. So all settings for the first machine over now.

Setup Machine2

1. Select Windows Server 2012 from gallery. Use the same VHD used for Machine1.

2. Provide machine name and password.

5

3. This time we are not going to create a standalone machine. We want to connect our Machine2 to Machine1.So select connect to existing virtual machine.

6

4. Select none for availability set.

7

5. After the Machine2 is created we need to configure endpoint for that machine. This time we create a load balance endpoint that connected to endpoint of first machine.

10

6. Give the endpoint settings as given below.

11

Now verify endpoints in Machine1 and Machine2

Machine1

14

Machine2

12

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