Okay so we know we need to plan for availability in Azure.
How do we go about doing that and the mechanism Microsoft uses for that.
Our availability sets before we can kind of decide how to use them.
Let's understand a potential for VM impact first.
First of all we have planned maintenance.
This is when Microsoft needs to patch all say do some firmware upgrades on the underlying hardware that
your VM is running on and they need to evacuate UVM in most cases.
This will happen using their live migration technology.
They'll simply move your virtual machine from one host to another.
But on other occasions they do need to shut down your virtual machine in order to do this maintenance
because like migration won't work for whatever reason and so you need to account for that.
The second one is unplanned hardware maintenance.
This is when Microsoft detects using say their monitoring systems that a failure may be about to occur
on the underlying host and again kind of like planned maintenance they need to move your virtual machine
or sometimes very quickly they have to shuttle the virtual machines down do the maintenance and then
bring that host back up and then finally we have unexpected downtime.
This is when there's a catastrophic failure to the underlying hardware and you're essentially forced
UVM is shut down immediately not gracefully.
And you know the VM will eventually be powered on another machine but your application will receive
an outage.
The way to solve this is using availability sets.
This allows us to group two or more machines into a set and they're basically separated out based on
two things fault domains and update domains.
If we think of fault domains first of all this is essentially when we have a rack that has its own power
its own networking connectivity and we can have up to three fault domains in an availability set.
So if we think about virtual machines if we have three virtual machines in a particular tier which will
get into more in a moment they can be spread out amongst those folk domains.
If we've used three fault domains if there's an outage to one the virtual machines on the other fault
domains will be unaffected and eventually the virtual machine that had the outage on the first full
domain would come back up once Microsoft resolves the underlying issue or just simply move your machine
to another host.
In addition we have update domains.
So think of these a little bit differently.
Microsoft has to patch a whole series of hosts but they will do them sequentially and they won't patch
the same update domains at the same time.
Now they allow you up to 20 update domains so your virtual machines will be spread out amongst those
update domains in your availability set.
You don't control the specific order.
So for example if you've got 3 update domains you D 0 you d 1 new D2.
We know that they won't happen at the same time again.
This is the patching of the underlying hosts not your virtual machine patches themselves but we know
that you d 0 won't happen at the same time as you D2 but you D2 could happen before you D 0.
This isn't an order in system.
It's simply a separation.
If we think of planning for availability and a little bit more detail the other thing we need to think
about is what goes into an availability set.
Well it's very important that you put your tears into separate availability sets.
Think of it like this.
We would have an availability set for a web tier and availability set for an app tier and an availability
set for our data tier.
Now think of it just from a fault domain perspective we know now in our web tier that we had three fault
domains those three servers would be separated out between three underline fault domains.
The reason for this is if we combined everything let's say we put our data tier and app tier in a web
tier altogether we could be in a situation where all of our data VM is all on the same fault domain
because again we've only got three fold domains Microsoft's going to spread all of those machines out
amongst the fault domains and update domains as well obviously.
And you know if we've got too much in there group together they could just you know we could just have
all of our data machines on the same fault domain and that doesn't really help us from an availability
standpoint.
So use this model whenever you're trying to decide you know what availability sets to use.
And there's definitely a lot of questions at least when I did the exam on this.
They'll give you some scenarios on how so many Web servers so many observers so many data servers they'll
describe this scenario and you have to decide how you group the servers out.