Windows Cluster server in Azure with Shared disk

This blog post will cover how to create a windows cluster server in Azure with a Shared disk. Azure share disk is a new feature in the managed disk, enabling us to attach the same disk (Managed disk) with multiple Azure virtual machines simultaneously.

Limitations and Sizes:

The shared disk is available in all Azure regions that managed disk is available. However, there are some limitations as its available in Premium and ultra-disks only.  Different disk sizes may have a different maxShares limit, which you cannot exceed when setting the maxShares value. For each disk, you can define a maxShares value representing the maximum number of nodes that can simultaneously share the disk. For example, if you plan to set up a 2-node failover cluster, you will set maxShares=2.

The maxShares value can only be set or edited when the disk is detached from all nodes.

To know more about the limitations: Please read below link

https://docs.microsoft.com/en-us/azure/virtual-machines/disks-shared-enable?tabs=azure-resource-manager#limitations

Demo LAB:

To get started with deployment, we need two Azure virtual machines, which support premium disk and a virtual network. 

For my lab, I have created terraform files for creating required resources. Azure shared disk is not supported in terraform while writing this article. So, I have an ARM Template, and it’s executed by terraform. You can find the files at my GitHub (https://github.com/santhosha021/azure-shareddisk)

Attach Share disk

Once we have the required resources, we need to attach a shared disk with both virtual machines. Select the first virtual machine and add select disk from settings.  Click on Attach existing disk and select the shared disk created for this deployment by terraform with JSON file.  

Finally, click Save.

Repeat the same step for attaching the shared disk to the second virtual machine. While adding, we can see the disk is already shared with another server.

The disk is added to both virtual machines, and it can be verified by logging into a server and select disk management. The disk will be seen as a RAW disk and not formatted.

To create a windows failover cluster, add the servers into the domain. Install the failover cluster features on both servers. Below methods can install failover cluster features this:

  • Server manager for GUI.
  • Powershell commands:  Install-WindowsFeature -Name Failover-Clustering –IncludeManagementTools 

After installing failover tools, restart the server.

Create an Azure internal load balancer within the same virtual network where the virtual machines are running.  Add these two servers into the load balancer as backend pools:

Log into one server and launch cluster wizard for validating nodes for cluster creation. Once it verified, launch PowerShell and run: New-Cluster -Name azcluster01 -Node auedemo-vm01,auedemo-vm02  -StaticAddress 10.10.0.10

The static IP address is from the existing virtual network.

Initialize the shared disk attached to the server. Open the Failover cluster manager wizard and click on disks under storage. Click Add disk, and it will present the shared disk.  

Click ADD and disk will be added to cluster disk.

That’s the end of the Windows cluster server with the shared disk in the  Azure cloud environment.