Azure shared disks is a feature that allows you to attach a managed disk to multiple virtual machines simultaneously. It can be very interesting if you want to migrate your clustered applications from on-premise to your Azure subscription. There are some limitations that you can read on the Microsoft documentation : https://learn.microsoft.com/en-us/azure/virtual-machines/disks-shared

In this article, I explain how to create a shared disk, attach it to two virtual machines and then use it for a failover cluster.

Getting started

First, create a shared disk. From the portal, go to “Disks” section, and create a new one.

Then in the “advanced” tab, select the max shares which depend on how many virtual machines the disk will be attached to. In my case, I want to attach the disk to two virtual machines for my cluster. Select the disk size and validate the wizard.

Create a managed disk

For my cluster, I use a proximity placement group to organize my resources.

Create Proximity Placement Group

When creating the virtual machine, select the proximity placement group previously created.

Select the proximity placement group previously created

I also use availability set, so the proximity group is automatically selected

Proximity group is automatically selected

Now, open a PowerShell console or use the Cloud Shell console form the portal.

We want to attach the shared disk to both virtual machines. Gather configuration data for virtual machines and shared disk :

 

PowerShell

Now, we attach the shared disk :

 

PowerShell

Before committing the changes to virtual machines, you must check if virtual machines are down, then update the virtual machines :

 

PowerShell

To finish, start the virtual machines :

 

PowerShell

You can confirm if the shared disk is attached to the virtual machines under “properties” tab

Properties

RDP in to the virtual machines, then open the “diskmgmt.msc” console to initialize and format the disk:

Disk management

Once the shared disk is attached and formatted, you can use your shared disk depending on your needs :

  • SQL Server Failover Cluster Instances
  • Scale-out File Server
  • emote Desktop Server User Profile Disk (UPD)
  • etc.

In my case, I can use the shared disk for my failover cluster:

Failover Cluster Manager

Then add the disk to cluster shared volumes :

Disks

StarWind Backup Appliance (BA) is an industry-first all-NVMe backup appliance that provides unprecedented levels of backup and recovery speed. It comes as a tiny, pre-configured, ready-to-backup solution that eliminates the backup server storage bottleneck and fits even the strictest RTPO. Consisting of the best commodity hardware, your chosen hypervisor, and a StarWind SDS engine backed by 24/7/365 ProActive Support, StarWind BA ushers in a new age of a future-proof, eco-friendly, transparent, and reasonably priced backup infrastructure. Explore Backup Appliance from StarWind StarWind Backup Appliance Datasheet
Back to blog