In Microsoft Azure there are many features available to improve the resilience of your Azure resources. In this article, I am going to focus on the resilience of an Azure VM Disk.
Let me paint a scenario where a Azure VM was created with a disk as LRS (locally redundant storage). The risk with the LRS is the disks are only protected against physical failures within a single datacenter such as server rack or drive failure. However, to increase the resilience of the VM disk against datacenter failures, I recommend that it is configure as ZRS (zone-redundant storage).
To convert a disk from LRS to ZRS, the correct procedure must be followed based on whether the disk is zonal or regional. To check this state, run the following command:
Azure CLI:
az disk show –name [DiskName] –resource-group [RGName]
If the zone parameter is empty, it is an indication that it is regional otherwise it is zonal.
The disk locality will be determine which method is applied to convert the disk from LRS to ZRS. Once verified as regional continue to the next steps to start the process.
For regional disk, it is necessary to only deallocate(shutdown) the Azure VM and then convert the disk using the commands:
Firstly, gather the Azure VM and disk information and create variables to store these values:
$RGName='ResourceGroupName'
$vmDiskName='VMDiskName'
$vmSize='Standard_DS_v2'
$diskSKU='Premium_ZRS'
Get the Parent VM Id (required for sizing of the VM if disk type is changed from Premium to Standard)
$vmId= $(az disk show \
–name$vmDiskName \
–resource-group $RGName \
–query manageBy \
–output tsv)
Stop the Azure VM in preparation for disk conversion
az vm deallocate --ids $vmId
Upgrade the Azure VM size (this step is critical that VM size can support the disk SKU or the disk conversion may fail)
az vm resize –ids $vmId –size $vmSize
Convert the disk from LRS to ZRS:
az disk update –name $vmDiskName –sku $diskSKU –resource-group $RGName
Start up the VM:
az vm start –ids $vmId
If the disk is zonal:
- a snapshot of the original disk will need to be created.
- Then a new disk will be created from the snapshot.
- when the disk is created, a new VM will be provisioned with this new disk atached.
I hope this article assist with the steps to convert a disk from LRS to ZRS.
Reference:




















