If you worked with an application that is based on Windows Server Failover Cluster (WSFC), you may already know that sometimes we have to share virtual disks between servers. Scale-Out File Servers (SoFS), SAP, Remote Desktop Server User Profile Disk, Failover cluster instance (FCI) with SQL Server are some of the examples. If virtual machines are running on VMware, we can do this by enabling Multi-Writer Mode on virtual disks. If it is a Hyper-V environment, we can do the same using Shared disk or VHD Sets features.
Azure managed disks also can share between multiple virtual machines. This help organization to move or deploy applications depending on cluster services and shared disks to Azure. In this demo, I am going to demonstrate how we can share a disk between two Azure VM.
• Certain limitations apply to Azure shared disks.
• Share disk feature only available for ultra disks and premium SSDs
• Can only be enabled in data disks, not operating system disks
• Can’t use with Azure Backup or Azure Site Recovery (yet)
• If you are using proximity placement groups, all virtual machines and shared disks must use the same PPG.
• maxShares value of the disk defines how many VMs can share the disk simultaneously. For ultra disks, maxShares value is 5.
• For Premium SSDs, the maximum value for maxShares is depending on the disk size. It can be varying from 2-10.
Let’s go ahead and see how we can configure Azure shared disk.
For the configuration process, I will be using PowerShell. Therefore, please make sure you have an Azure PowerShell module installed. More info about it can find under https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-3.8.0
Create a Resource Group
As the first part of the configuration, I am going to create a new resource group. To do that,
Launch PowerShell console and connect to Azure using Connect-AzAccount
Then create a new resource group using,
New-AzResourceGroup -Name EUSRG1 -Location “East US”
In the above, EUSRG1 is the resource group name, and its created-in East US Azure region.
Create Azure VNet
The next step is to create a new virtual network under EUSRG1 resource group. We can create it using,
$vmsubnet = New-AzVirtualNetworkSubnetConfig -Name vmsubnet -AddressPrefix “10.0.2.0/24”
New-AzVirtualNetwork -Name REBELVN1 -ResourceGroupName EUSRG1 -Location “East US” -AddressPrefix “10.0.0.0/16” -Subnet $vmsubnet
In the above, REBELVN1 is the new virtual network name. It has 10.0.0.0/16 address space. It also has a new subnet 10.0.2.0/24 (vmsubnet) for virtual machines. [Read more…] about How to Share disk between Azure Virtual Machines? (PowerShell Guide)