Design for Virtual Machines with High Availability Using Azure
Because anything can happen. Take a look at how you can harness the high-availability features of Azure to make robust VMs.
Join the DZone community and get the full member experience.Join For Free
in this article, we will see how we can create highly available vms in azure. we will understand the concept of fault domains and update domains and how we can effectively leverage availability sets and vm scale sets to ensure high availability for our applications running on azure vms.
high availability is one of the most important aspects of any application. if we have our application deployed on a vm in the cloud, the high availability becomes more important because essentially we are not relying on the vms that ing managed by our cloud vendor. if we are designing an application where high availability is the key and we are going to deploy the application on azure vms, we need to know the various constructs and configurations provided by azure to get high availability.
when it comes to hardware reliability few thing that is certain is that systems are bound to fail, wires are going to break, connections are going to fail. so what will happen to our applications if our application is hosted on such vms where the failure has happened? azure acknowledges these facts and provides us ample solutions to be able to deign our vm infrastructure in such a way that even with these failures, our application is available.
design for highly available vms
before getting into how we can ensure high availability in azure, let's try to understand what all type of failures could happen:
- planned maintenance : this is when the azure vms are getting updated to provide us with new set of features.
- unplanned maintenance : this is when azure find that the vms or networks are about to go bad (based on health checks) and perform maintenance activities.
- unexpected downtime : some failure which is due to unforeseen circumstances.
now with these types of potential failures in our on-premise servers; we used to keep redundant servers on separate networks. in azure, the vm selection is a black box for us so we need to somehow be still able to keep redundant servers and separate networks.
to achieve this redundancy, azure has the concept of availability sets. when we put two or more vms in an availability set, these vms will be distributed across multiple hardware that is isolated in terms of electrical and network supply. how will azure ensure this redundancy, it does that using the concept of fault domains and update domains. let's try to understand them in details now.
fault domain: a fault domain is a set of machines (or essentially a rack) in a data center that is susceptible to a fault. any electrical or network fault will impact all the vms in a fault domain.
update domain: an update domain is a set of machines that will receive os or azure feature updates in one chunk(and will perhaps be rebooted together). it has nothing to do with racks its just a logical grouping that defines an update domain.
when we put our vms in an availability set, azure ensure that our vms are put in separate fault domains and update domains. this will ensure that in case of a rack fault or any update on any of the vms will not effect the other vms in the availability set and this our application will still be available.
by default when we choose an availability set, and our vms will be put in 2 fault domains and 5 update domains.
vm scale sets
choosing an availability set for our vms ensure that our vms are highly available but since we are choosing multiple vms for the sake of high availability, we will have to manage these vms independently too. is it not possible for us to somehow manage the identical vms as a group and have high availability too.
this is exactly where the azure vm scale sets come in picture. azure vm scale sets let us create and manage a group of load balanced vms together. scale sets ensure the high availability for our vms and at the same time let us manage all the vms as a group. also, the scale set can be configured to automatically scale based on load which will further help is in achieving our goal of high availability for vms.
here are few of the benefits of using vm scale sets
- easy to manage multiple load balanced vms
- high availability
- automatic scaling
- automatic load balancing
so whenever we find ourselves in need of the above-mentioned requirements, we should choose vm scale sets rather than creating multiple vms manually ourselves.
point of interest
in this small article, we got ourselves acquainted with the concepts of availability sets and vms scale sets in azure. we learned about fault domains and update domains and we can use availability sets to effectively manage our vms to ensure high availability. i hope this has been informative.
Published at DZone with permission of Rahul Rajat Singh, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.