one of the limiting factors for setting up clusters in the cloud has been that
we cannot use shared resources between all the servers
in the cluster and that's where you put those
virtual machines or file services sql databases etc and we have not been able
to do this in the cloud until now today we're talking about
azure shared disk
i'm Dean Cefola & this is The Azure Academy if you want to master the azure
cloud you can start right now by clicking the subscribe
button and the notification bell so you don't miss anything clustering has been
something that is traditionally difficult to set up and requires lots of
resources as well as expertise to get up and running
the idea is to pass around the resources from one node in the cluster to another
so that they can be highly available so if you lose one
particular node you don't lose everything
so here's the plan for clusters we're going to first go over
some of the basics of running a cluster in azure then we're going to build the
azure resources for our scale-out file server third we're going to set up that
cluster finally we are going to automate
everything so here in the azure portal i've got a cluster that's already built
out and the things that make this unique from how clustering has been
attempted in the past you don't see a load balancer here at
all this is because of something in windows server 2019 where we can use
something called a distributed network name instead of a load
balancer's ip address to give the cluster a presence
on the network we also have a proximity placement group
and we have covered those before on the channel so i'll link that up here at the
top you can go check that out and basically what this
does is it puts the resources that are within
the proximity placement group as close to each other as possible
and this is to keep the latency between them low which is a requirement for
our shared disk then we have our two virtual machines and if i click on our
first vm and i just take a look at our disks now if i click on the data disk
under the configuration we see that this is just a one terabyte
premium ssd and there's really nothing more remarkable here
now going back for a second here you see the name of the disk
is sofas dash data disk 0. and if we go back to our resource group
and look at our other virtual machine under disks we have the same data disk
attached this is what a shared disk resource is
and there is a particular limit to how many vms can attach to a
single data disk that's covered in the azure
documentation which is linked in the video description below
and it shows you this table here for the ssds and based on the
particular size of the ssd is how many vms you can
attach like i have a one terabyte disk that's a
p30 so i could attach five vms to that disk so let's get this
party started with a clean resource group
and the first thing we're going to need is a proximity placement group
i'll type that in here and hit create i'll build this in the east us
and call my group dash ppg-1 click next for my tags adding my cost
code so i know who's paying for this the application being clusters in azure
and this is my lab environment so let's get that created
and there's our placement group so now we can build our vms into it
and i'll search for windows server 2019 in the marketplace and click on
windows server then i can select the particular sku that i'm interested in
and i'll scroll down near the bottom here for the small disk
server 2019 since the operating system disk does not need to be that large
i filled out the first page here and i do need to add an availability set
that way i'm sure that the bms end up on different hardware in the back end
and i'll call the av set class dash av set
and leave the fault and update domains alone i'll click next
for our disks and the operating system disk i'll just leave as a premium disk
but i will not add any data disks at this point
you'll see why in a minute hit next for network i'll provision this on
my network that's already connected to my domain controllers you will need to
join your vms to your domain for clustering to work and if we scroll down
a little bit here i have the option to enable accelerated networking with a
particular vm size that i chose which was the ds4v2
and accelerated networking is going to give our systems a little boost in
network performance we'll skip the management tab here and
go to advanced where we need to scroll down and select our
proximity placement group then we'll hit next and add our tags
and i'll add the same ones that i did for our ppg and hit review and create
and now to save some time i'll also click to download our template
copy all of that and then open a duplicate tab
the search bar at the top i'll type deploy and click to deploy a custom
template then click to build it in the editor and i'll highlight all the code
here and just delete it all and then paste in my template code and
we'll be provisioning three resources here the availability
set the vm and a network card go back to the
original tab and then click on the parameters section
copy everything and go back to my duplicate tab
click the edit parameters button highlight and delete everything
and then paste and hit save and that'll fill out the template for me
but i get all the same values now important here
is that the first vm needs to go as far as to create the availability set
first so we're going to kick that one off while we finish filling this guy out
we'll hit create there and as soon as we see that the
availability set has been built we can go and finish
building the other template we'll build it in the same resource group
change the value for our next card as well as
change the name for our virtual machine to clust01
and the rest of it should be good so let's hit review and create
now we're building both virtual machines at the same time
and you can see that the availability set was instantly marked as okay
because that resource already exists so our first vm looks like it's complete
and if we scroll down a little bit in the center of the blade we are in
proximity placement group plus ppg one which is exactly what we
want i've opened another tab here and this is
on my github repo and at the top we'll click on
repositories where i've added a brand new repository for clustering
and in here i've got a template to deploy shared disks
as well as a deploy to azure button which i'll click now
we'll select our resource group is the same one that we're already using our
name for our shared disk will be shared 0
and our size defaults here to 1 terabyte but depending on how many vms you're
provisioning you can do whatever size you like so for now i'll just change
this to 256 which means i'll be able to attach
two vms now before i click on create i want to click on edit template here
because there is something to take note of and if we
scroll down to our disk resource the important thing here is
this parameter max shares and that's what we saw from the
table in the documentation and max shares indicates
how many vms i'm connecting to this disk in this case
just two i'll click save for that and then hit review and create and then
create our disk so we're almost there but to finish setting up our cluster
we need to set up something called the quorum and this is
where we decide how we're going to manage the cluster we're going to build
a regular storage account so we'll scroll down
select our storage so i've filled out all the values here and this can just be
a standard storage account with locally
redundant storage this is only to hold our quorum we'll
skip ahead and add our tags and then we'll hit the review and create
so while we're waiting for that we'll go into our vms and go to our disks and
attach an existing disk we'll just click the drop down and there's our shared
disk that we had provisioned earlier click save and then we'll go back to our
other vm and we'll repeat the same process attach
an existing disk pick our shared disk and then hit
save now if you do this on a regular disk
that doesn't have that max share enabled you will not be able to complete this
but that little parameter makes all the magic happen and our
storage account is complete as well so we can now join our vms
to the domain and then proceed with the cluster setup and now that our servers
are joined to the domain in the server manager we'll go to manage
and add a new role or feature and we'll add it for the particular
server that we're on and on the roles screen we'll click next
then we'll add the failover clustering keep scrolling down
and then we'll add a remote server tool under features
for the clustering tools and just be sure that you have the management tool
and the powershell module we'll click next for that and then hit
install and you just want to be sure that you execute
those steps on both of your vms and after the role installation is complete
we need to reboot and once both of our nodes have rebooted
we want to go to tools in the server manager
put a failover cluster manager and over on the right we want to click to
validate our configuration and we'll click next to start the wizard
click browse and add our cluster nodes and we'll select both of them and hit ok
and by the nodes being added here successfully that means that the cluster
role has been installed on both of them we'll click next and then we'll run only
the selected tests so we'll click next through the
rest of the wizard and let's just let that run
now if i scroll all the way to the bottom before we continue there is a
warning here about our network traditional clustering
wants there to be at least two network interfaces on the
machine and that is because you again want to keep your clusters as
highly available as possible so no single points of failure and it's
recognizing that our vms have only one network card this is not a
problem in azure because the network that we're using
is a software defined network so we abstract
away all the physical hardware which is highly redundant underneath
all of this so we can just move on and not concern ourselves with this
particular issue so we'll check the box to
build the cluster from our validated nodes and hit finish and that'll open
the create cluster wizard we'll give our cluster a name
i'll just call it the az cluster and click next and then we'll hit
next and that has completed so we can hit finish we have a cluster now
and over in active directory we've got our two cluster nodes as well as
the cluster computer object as well now the next step
is we need to set up our quarums so this will be a cloud
witness so i'll right click on the cluster here
go down to more actions and then configure our quorum settings
and the wizard will start off with clicking next we'll click the middle
option here to select the quorum witness and click
next and we'll configure a cloud witness click
next and we need the name of our storage account back in the azure portal we'll
just click on our storage account and copy the name
we'll drop that here in the wizard and now we need the storage account
key and that's here in the blade on the left under access keys
and i'll just copy key number one and then we'll drop that in here as well
and then we'll hit next next again to complete the setup and then hit finish
and there is our cloud witness and if we go back to
disk management we want to initialize our disk
and then back in the cluster we'll go to add our disk and it's been detected
properly and we'll hit ok that is now part of our cluster and
now is the point where you have to decide what your cluster is going to do
so if we want to make this a scale out file cluster we're going to need to add
the file services from windows and similarly if
we want it to be a hyper-v cluster then we have to add those
features as well i'll go back to the server manager and we'll go to add a
role and under the file and storage services
we'll click to add our file server then we'll click next through the rest of the
wizard and then click to repeat all of those
steps on the other servers in the cluster as well
once that's complete back in the cluster we'll go to add our role again
this time click on file server then click next and here we can add a general
purpose file server or a scale out file server or application data
and that's the one i'll choose and click next and i'll call this the az
dash sofas and click next and next again and that's going to set up the role to
be highly available and once that's complete we'll click finish
and now we've got a scale up file server role and we do have a share
set up then we can right click on the disk and add
to cluster shared volumes and that'll change the path down here at the bottom
to be a volume followed by a guide and that's to show that the location of
this clustered shared volume is now on the c
drive under clustered storage volume one and pulling up the other node in the
cluster we go to the same location and there is the same volume
we'll just add a new folder directory and if we go back to where the cluster
manager was open there is the folder and we can also
delete it so this is a completely shared disk so just to finish out the
process we'll go to our roles and then right click to add a file share
because this is a scale-out file server we'll go for an smb
application share click next and you should have your cluster
shared volume in the middle which you'll click that hit next and then give it a
share name something just like data and we'll click
next and then you can set any of these settings as is appropriate for your
workload as well as setting any of the permissions and then
hit create congratulations you have set up a scale out file server
and if we go to the network share that we're hosting yes we can get access
create a new folder create a new document
we'll save that and from the other node we'll go under our shares
data new folder test and there everything is working
now this of course completes the whole process of how we can
set up and use a shared disk but i want to show you
a much faster way to get this done over in the azure docs we've got some quick
samples and this is also linked in the video description
and these samples cover everything from sql to file servers
sap services linux clusters with pacemaker
etc so today we're going to build from the scale out file server and this will
be basically a quick template version of
what i've already shown you and if we scroll down in this github
page to deploy to azure then all we need to do is fill out this
template now with that complete there's a couple points of interest here one is
that the name prefix needs to be all in lower case
because this is going to be used in setting up your storage account which
needs to have all lower case letters or numbers i've got my domain credentials
and then the other important thing is if you are using accelerated networking
you need to select a vm size that is compatible with accelerated
networking like the ds4 v2 and then we scroll down and
check the box or i agree to the terms and hit purchase and everything is valid
and so our deployment is underway our build's finished and
just like before we have an availability set
our two operating system disks one shared
data disk storage account vms and proximity placement group
inside active directory we've got computer objects for the cluster using
the distributed network name for our scale out file server
instead of our cluster ip load balancer that you used to have to do and taking a
look at our scale out file cluster we go to disks and there is our shared
volume and under the rules we can see that the
volumes are here and shared out and we've already got some data that is
present on those shares ready to be served up to
our customers so by leveraging a shared disk in azure
we're able to get some of those traditional clustering functions like we
used to have on premise and there's just a few things to get this up and running
if this video was a help to you or you learned something new go ahead and smash
that like button and let me know that you appreciated our content as well as
give me some comments down below on questions that you have or
things that you'd like us to make videos on
in the future we always want to make what the community is interested in so
remember to stay safe out there and you want to keep on
learning check out our latest video up on the top or you can check out the
one on the bottom that mr beast had recommended
thanks again for joining us this week and we will catch you soon happy
learning