0

I am having difficulty understanding Azure Availability sets, specifically, what exactly i need to to do ensure my app running on my vm is utilizing Availability sets to be more available.

Lets say i am creating an application that runs on a single VM and i want to make it more resistant to hardware failure.

Option 1: I create an Availability Set with 2 fault domains and then create a VM on this Availability set.

Is that it? If there is a hardware failure on the rack hosting my VM, does azure now take care of ensuring the VM stays up and running?

Option 2: i have to have two servers Vm1 & Vm2, both in the availability set but one on fault domain 1, one on fault domain 2. i have to then set up a cluster of sorts for my application. In this case the availability set is simply allowing me to be sure that the two servers in my cluster are not on the same hardware, but the plumbing to ensure the application can take advantage of two servers and is highly available is still down to me.

Is option 1 or option 2 the correct way in which Availability Sets work in relation to fault domains?

Appreciate any clarity that can be provided.

wilson_smyth
  • 1,202
  • 1
  • 14
  • 39

2 Answers2

1

Azure deals with hardware failure in two ways, Availability Sets and Availability Zones. AS is all about making sure that your app does not go down even if hardware failure happens within a Data center aka Zone itself. AZs are all about making sure your app does not go down even if the whole data center aka Zone is down. More details here.

Now to understand best practices around availability take a look at the best practices, specifically for VMs can be found here.

A Single VM instance is defined as follows, reference:

"Single Instance" is defined as any single Microsoft Azure Virtual Machine that either is not deployed in an Availability Set or has only one instance deployed in an Availability Set.

So one VM in or not in an availability set does not make any difference, for this you need at least two VMs and which are in an AS using FDs and UDs so Azure will take care of this by making sure that both VMs are running on separate Hardware to avoid your app going down.

Hassan Raza
  • 412
  • 2
  • 6
  • But again this does not answer the question. It tells me I need two vm's in the availablity set to make use of the availability set. But from an application perspective, does my apication need to be aware of the two servers, or I need a load balancer set up over the two servers to make sure my app will stay up if one server goes down, and ensure my code base is deployed on both servers, I.e, do I need to architect in such a way that my app can make use of multiple servers? – wilson_smyth Sep 13 '20 at 15:59
  • 1
    if you have two VMs in an AS then they are on separate hardware nodes which means if a hardware node failure happens then you can rest assured both your VMs are not down and one is running on a separate hardware node. Yes to use both you will need to use a Load Balancer to distribute the traffic and use health probes. – Hassan Raza Sep 14 '20 at 05:37
0

One VM in an Availability set is nearly as good as a VM with no Availability set. If you are placing two or more VMs in an AS and those are identical then you can add a load balancer to distribute traffic. You can also use AS without a Load balancer if you are not interested in traffic distribution. One scenario can be where you want to switch to a secondary VM only when primary is unavailable. Also, do understand it is not required to have identical VMs in an AS.

Virtual machine scale set is a good option if you are looking for a high availability solution with VMs.

gkulshrestha
  • 855
  • 1
  • 6
  • 11
  • thanks for the reply. You mention load balancers are not required if not interested in traffic distribution. Without a load balancer, if one VM goes down, is there another method to automatically redirect the load to the second server in the set, or is it a case of manually changing settings in the app to point to the second server? – wilson_smyth Sep 20 '20 at 14:52
  • Not sure, but AFAIK no automatic mechanism exists to achieve server switchover in AS. There are automatic switchover solutions (like ASR) for regional failures but none to my knowledge for ASs. But practically speaking, a load balancer is always used with AS to avoid any manual hassles. – gkulshrestha Sep 20 '20 at 17:18