Azure: Moving from ASM to ARM with ASR (Part 8) - Finishing up
Now that we have our VM’s up and running in ARM, there are still some things to configure.
Some main items still need our direct attention and that’s what will be covered in this blog:
Public IP, Load Balancers and Availability Sets
Availability Sets
Besides the Load Balancers, we also need to put the Web VMs in an availability set if we want to make use of Azure fault tolerance.
It would be a great addition if you could specify this in the ASR replication policy, as you will see that we will need to delete and recreate the VMs to make this happen.
https://i2.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/avset.png?resize=885%2C407
Thanks to the community and in this case especially SAMIR FARHAT for his script that does this for us:
https://gallery.technet.microsoft.com/Set-Azure-Resource-Manager-f7509ec4/view/Discussions#content
This script will guide you through the whole process, the only thing you might want to do is to create the Availability Set that you want to use:
https://i0.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/createavset.png?resize=262%2C390
Starting the script:
https://i1.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/psscript-1.png?resize=1024%2C577
Checking if the WebVMs show that they are member of the Availability Set that we specified:
https://i0.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/newavset.png?resize=930%2C428
https://i2.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/webvm2avset-1.png?resize=935%2C433
and they are, moving on to the next step:
Load Balancers
When it comes down to load balancers, VMs deployed within a cloud service boundary can be grouped to use a load balancer.
In the ASM model a public IP address and a FQDN are assigned to the cloud service itself.
The load balancer does port translation and load balances the network traffic by using the public IP address for the cloud service.
https://i2.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/asm-lb.png?resize=466%2C476
In the Resource Manager deployment model there is no such thing as a Cloud service, the load balancer is created to route traffic among multiple virtual machines.
A public IP address is an individual resource that has a domain label (DNS name) and the public IP address is associated with the load balancer resource.
Load balancer rules and inbound NAT rules use the public IP address as the Internet endpoint for the resources that are receiving load-balanced network traffic.
Public IP
create public ip
I prefer to create the Public IP first (you are able to do this while creating the Load Balancer but then you lack the options to specify FQDN)
https://i1.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/createloadbalancerip.png?resize=377%2C614
Give your resource a name, select ‘Static’ mode for your IP and assign a DNS name.
Create the Load Balancer
https://i0.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/createloadbalancer.png?resize=814%2C315
https://i0.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/createloadbalancer-1.png?resize=510%2C658
give the resource a name, make sure the type is set to Public and select the Public IP you previously created
https://i0.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/createbackendpool.png?resize=822%2C304
click add
https://i1.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/createbackendpool2.png?resize=496%2C316
assign a name to the pool
https://i2.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/createbackendpool3.png?resize=838%2C243
select the Availability Set and Web VM’s and click OK on all the steps
Health Probes
Before we can add the load balancing rule for HTTP, we first need to configure a health probe.
For this I select the HTTP probe as this one also checks if the website is healthy (TCP probe just checks if ping requests get answered)
https://i2.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/createhealthprobe.png?resize=809%2C275
create HTTP rule
Now we can move over to adding the HTTP rule to the Load Balancer
https://i1.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/createrule.png?resize=781%2C406
click add
https://i1.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/createrule2.png?resize=589%2C762
create the rule to balance incoming HTTP traffic on port 80
Verify
Now lets take the DNS name of the public IP assigned to the load balancer and paste it in a browser
https://i0.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/verifyweb2.png?resize=726%2C184
WebVM2 is responding
https://i2.wp.com/www.prof-its.be/wp/wp-content/uploads/2017/02/verifyweb1.png?resize=723%2C229
and so is WebVM1
Hope you have enjoyed the walk through!
Remarks
Some items that were encountered during this POC but did not get published:
- There was a difference in the naming of the destination VM’s so we also had to change the SQL connection string in the ‘web.config’ file
- The SQL VM had a virtual disk (Storage Spaces) that we needed to recreate on the destination VM
In a production environment it will make more sense to make use of the SQL application replication mechanism, if that’s not possible then make sure you have a working SQL backup that you can restore on the target VM.
You should also add Networks Security Groups to the subnets and install Web Application Firewall to protect your resources!
Overview
This article is part of a series, check for the overview here: Azure: Moving form ASM to ARM with ASR (TOC)