Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article covers how to deploy a disk that uses zone-redundant storage (ZRS) as a redundancy option. ZRS replicates your Azure managed disk synchronously across three Azure availability zones in the selected region. Each availability zone is a separate physical location with independent power, cooling, and networking.
For conceptual information on ZRS, see Zone-redundant storage for managed disks
Limitations
ZRS for managed disks is only supported with Premium SSD and Standard SSD managed disks. ZRS for managed disks isn't supported with Premium SSD v2 managed disks or Ultra Disks. Force detach only supports data disks.
Regional availability
ZRS disks are currently available in China North 3.
Deploy ZRS managed disks
Create a virtual machine with a ZRS OS disk
Sign in to the Azure portal.
Navigate to Virtual machines and follow the normal VM creation process.
Proceed to the Disks pane.
Select your disk and select one of the ZRS disks in the drop-down.
Proceed through the rest of the VM deployment, making any choices that you desire.
You've now deployed a VM with a ZRS OS disk.
Create a ZRS disk
In the Azure portal, search for and select Disks.
Select + Add to create a new disk.
Select a supported region and Availability zone to None.
Select Change size.
Select one of the available ZRS disks and select OK.
Continue through the deployment process.
You have now created a managed disk that uses ZRS.
Create a virtual machine with ZRS disks
The following Azure CLI example uses az group create and az vm create to create an Ubuntu virtual machine (VM) with a Standard SSD ZRS OS disk and a 128-GiB Premium SSD ZRS data disk. Replace the variable values with the names, region, VM size, and image for your deployment.
rgName=yourRGName
vmName=yourVMName
location=chinanorth3
vmSize=Standard_DS2_v2
image=Ubuntu2204
osDiskSku=StandardSSD_ZRS
dataDiskSku=Premium_ZRS
az group create -n $rgName -l $location
az vm create -g $rgName \
-n $vmName \
-l $location \
--image $image \
--size $vmSize \
--generate-ssh-keys \
--data-disk-sizes-gb 128 \
--storage-sku os=$osDiskSku 0=$dataDiskSku
Create virtual machines with a shared ZRS disk in different zones
The following Azure CLI example uses az disk create to create a 1-TiB shared Premium SSD ZRS disk that supports two attachments. It then uses az vm create to create two Ubuntu VMs in availability zones 1 and 2 and attach the shared disk to both VMs. Replace the variable values with the names, region, VM size, and image for your deployment.
location=chinanorth3
rgName=yourRGName
vmNamePrefix=yourVMNamePrefix
vmSize=Standard_DS2_v2
image=Ubuntu2204
osDiskSku=StandardSSD_LRS
sharedDiskName=yourSharedDiskName
sharedDataDiskSku=Premium_ZRS
az group create -n $rgName -l $location
az disk create -g $rgName \
-n $sharedDiskName \
-l $location \
--size-gb 1024 \
--sku $sharedDataDiskSku \
--max-shares 2
sharedDiskId=$(az disk show -g $rgName -n $sharedDiskName --query 'id' -o tsv)
az vm create -g $rgName \
-n $vmNamePrefix"01" \
-l $location \
--image $image \
--size $vmSize \
--generate-ssh-keys \
--zone 1 \
--attach-data-disks $sharedDiskId \
--storage-sku os=$osDiskSku \
--vnet-name $vmNamePrefix"_vnet" \
--subnet $vmNamePrefix"_subnet"
az vm create -g $rgName \
-n $vmNamePrefix"02" \
-l $location \
--image $image \
--size $vmSize \
--generate-ssh-keys \
--zone 2 \
--attach-data-disks $sharedDiskId \
--storage-sku os=$osDiskSku \
--vnet-name $vmNamePrefix"_vnet" \
--subnet $vmNamePrefix"_subnet"
Create a virtual machine scale set with ZRS disks
The following Azure CLI example uses az vmss create to create an Ubuntu virtual machine scale set with Standard SSD ZRS OS disks and 128-GiB Premium SSD ZRS data disks. Replace the variable values with the resource group, region, scale set name, VM size, and image for your deployment.
location=chinanorth3
rgName=yourRGName
vmssName=yourVMSSName
vmSize=Standard_DS3_V2
image=Ubuntu2204
osDiskSku=StandardSSD_ZRS
dataDiskSku=Premium_ZRS
az group create -n $rgName -l $location
az vmss create -g $rgName \
-n $vmssName \
-l $location \
--encryption-at-host \
--image $image \
--upgrade-policy automatic \
--generate-ssh-keys \
--data-disk-sizes-gb 128 \
--storage-sku os=$osDiskSku 0=$dataDiskSku
Create a virtual machine with ZRS disks
The following Azure PowerShell example uses Connect-AzAccount, Set-AzContext, and New-AzVM to create a Windows VM with a Standard SSD ZRS OS disk and a 128-GiB Premium SSD ZRS data disk. Replace the variable values with the subscription, administrator credentials, region, existing resource group, VM name, and VM size for your deployment.
$subscriptionId="yourSubscriptionId"
$vmLocalAdminUser = "yourAdminUserName"
$vmLocalAdminSecurePassword = ConvertTo-SecureString "yourVMPassword" -AsPlainText -Force
$location = "chinanorth3"
$rgName = "yourResourceGroupName"
$vmName = "yourVMName"
$vmSize = "Standard_DS2_v2"
$osDiskSku = "StandardSSD_ZRS"
$dataDiskSku = "Premium_ZRS"
Connect-AzAccount -Environment AzureChinaCloud
Set-AzContext -Subscription $subscriptionId
$subnet = New-AzVirtualNetworkSubnetConfig -Name $($vmName+"_subnet") `
-AddressPrefix "10.0.0.0/24"
$vnet = New-AzVirtualNetwork -Name $($vmName+"_vnet") `
-ResourceGroupName $rgName `
-Location $location `
-AddressPrefix "10.0.0.0/16" `
-Subnet $subnet
$nic = New-AzNetworkInterface -Name $($vmName+"_nic") `
-ResourceGroupName $rgName `
-Location $location `
-SubnetId $vnet.Subnets[0].Id
$vm = New-AzVMConfig -VMName $vmName `
-VMSize $vmSize
$credential = New-Object System.Management.Automation.PSCredential ($vmLocalAdminUser, $vmLocalAdminSecurePassword);
$vm = Set-AzVMOperatingSystem -VM $vm `
-ComputerName $vmName `
-Windows `
-Credential $credential
$vm = Add-AzVMNetworkInterface -VM $vm -Id $NIC.Id
$vm = Set-AzVMSourceImage -VM $vm `
-PublisherName 'MicrosoftWindowsServer' `
-Offer 'WindowsServer' `
-Skus '2012-R2-Datacenter' `
-Version latest
$vm = Set-AzVMOSDisk -VM $vm `
-Name $($vmName +"_OSDisk") `
-CreateOption FromImage `
-StorageAccountType $osDiskSku
$vm = Add-AzVMDataDisk -VM $vm `
-Name $($vmName +"_DataDisk1") `
-DiskSizeInGB 128 `
-StorageAccountType $dataDiskSku `
-CreateOption Empty -Lun 0
New-AzVM -ResourceGroupName $rgName `
-Location $location `
-VM $vm -Verbose
Create virtual machines with a shared ZRS disk in different zones
The following Azure PowerShell example uses New-AzDisk to create a 1-TiB shared Premium SSD ZRS disk that supports two attachments. It uses New-AzVM to create two VMs in availability zones 1 and 2, Add-AzVMDataDisk to attach the shared disk to each VM, and Update-AzVM to apply each attachment. Replace the variable values with the region, existing resource group, VM names, VM size, shared disk name, and administrator credentials for your deployment.
$location = "chinanorth3"
$rgName = "yourResourceGroupName"
$vmNamePrefix = "yourVMPrefix"
$vmSize = "Standard_DS2_v2"
$sharedDiskName = "yourSharedDiskName"
$sharedDataDiskSku = "Premium_ZRS"
$vmLocalAdminUser = "yourVMAdminUserName"
$vmLocalAdminSecurePassword = ConvertTo-SecureString "yourPassword" -AsPlainText -Force
$datadiskconfig = New-AzDiskConfig -Location $location `
-DiskSizeGB 1024 `
-AccountType $sharedDataDiskSku `
-CreateOption Empty `
-MaxSharesCount 2 `
$sharedDisk=New-AzDisk -ResourceGroupName $rgName `
-DiskName $sharedDiskName `
-Disk $datadiskconfig
$credential = New-Object System.Management.Automation.PSCredential ($vmLocalAdminUser, $vmLocalAdminSecurePassword);
$vm1 = New-AzVM `
-ResourceGroupName $rgName `
-Name $($vmNamePrefix+"01") `
-Zone 1 `
-Location $location `
-Size $vmSize `
-VirtualNetworkName $($vmNamePrefix+"_vnet") `
-SubnetName $($vmNamePrefix+"_subnet") `
-SecurityGroupName $($vmNamePrefix+"01_sg") `
-PublicIpAddressName $($vmNamePrefix+"01_ip") `
-Credential $credential
$vm1 = Add-AzVMDataDisk -VM $vm1 -Name $sharedDiskName -CreateOption Attach -ManagedDiskId $sharedDisk.Id -Lun 0
Update-AzVM -VM $vm1 -ResourceGroupName $rgName
$vm2 = New-AzVM `
-ResourceGroupName $rgName `
-Name $($vmNamePrefix+"02") `
-Zone 2 `
-Location $location `
-Size $vmSize `
-VirtualNetworkName $($vmNamePrefix+"_vnet") `
-SubnetName ($vmNamePrefix+"_subnet") `
-SecurityGroupName $($vmNamePrefix+"02_sg") `
-PublicIpAddressName $($vmNamePrefix+"02_ip") `
-Credential $credential `
-OpenPorts 80,3389
$vm2 = Add-AzVMDataDisk -VM $vm2 -Name $sharedDiskName -CreateOption Attach -ManagedDiskId $sharedDisk.Id -Lun 0
Update-AzVM -VM $vm2 -ResourceGroupName $rgName
Create a virtual machine scale set with ZRS disks
The following Azure PowerShell example uses New-AzVmss to create a Windows virtual machine scale set in an existing resource group. The scale set uses Standard SSD ZRS OS disks and 128-GiB Premium SSD ZRS data disks. Replace the variable values with the region, existing resource group, scale set name, VM size, and administrator credentials for your deployment.
$vmLocalAdminUser = "yourLocalAdminUser"
$vmLocalAdminSecurePassword = ConvertTo-SecureString "yourVMPassword" -AsPlainText -Force
$location = "chinanorth3"
$rgName = "yourResourceGroupName"
$vmScaleSetName = "yourScaleSetName"
$vmSize = "Standard_DS3_v2"
$osDiskSku = "StandardSSD_ZRS"
$dataDiskSku = "Premium_ZRS"
$subnet = New-AzVirtualNetworkSubnetConfig -Name $($vmScaleSetName+"_subnet") `
-AddressPrefix "10.0.0.0/24"
$vnet = New-AzVirtualNetwork -Name $($vmScaleSetName+"_vnet") `
-ResourceGroupName $rgName `
-Location $location `
-AddressPrefix "10.0.0.0/16" `
-Subnet $subnet
$ipConfig = New-AzVmssIpConfig -Name "myIPConfig" `
-SubnetId $vnet.Subnets[0].Id
$vmss = New-AzVmssConfig -Location $location `
-SkuCapacity 2 `
-SkuName $vmSize `
-UpgradePolicyMode 'Automatic'
$vmss = Add-AzVmssNetworkInterfaceConfiguration -Name "myVMSSNetworkConfig" `
-VirtualMachineScaleSet $vmss `
-Primary $true `
-IpConfiguration $ipConfig
$vmss = Set-AzVmssStorageProfile $vmss -OsDiskCreateOption "FromImage" `
-ImageReferenceOffer 'WindowsServer' `
-ImageReferenceSku '2012-R2-Datacenter' `
-ImageReferenceVersion latest `
-ImageReferencePublisher 'MicrosoftWindowsServer' `
-ManagedDisk $osDiskSku
$vmss = Set-AzVmssOsProfile $vmss -ComputerNamePrefix $vmScaleSetName `
-AdminUsername $vmLocalAdminUser `
-AdminPassword $vmLocalAdminSecurePassword
$vmss = Add-AzVmssDataDisk -VirtualMachineScaleSet $vmss `
-CreateOption Empty `
-Lun 1 `
-DiskSizeGB 128 `
-StorageAccountType $dataDiskSku
New-AzVmss -VirtualMachineScaleSet $vmss `
-ResourceGroupName $rgName `
-VMScaleSetName $vmScaleSetName
The templates in this section use version 2020-12-01 of the Microsoft.Compute API to deploy ZRS managed disks.
Prerequisites
You must enable the SsdZrsManagedDisks feature for your subscription. Use Register-AzProviderFeature to register the feature, then use Get-AzProviderFeature to confirm its registration state.
Register the feature for your subscription.
Register-AzProviderFeature -FeatureName "SsdZrsManagedDisks" -ProviderNamespace "Microsoft.Compute"Confirm that the registration state is Registered before you deploy a template. Registration might take a few minutes.
Get-AzProviderFeature -FeatureName "SsdZrsManagedDisks" -ProviderNamespace "Microsoft.Compute"
Create a virtual machine with ZRS disks
The following Azure PowerShell example uses New-AzResourceGroup to create a resource group and New-AzResourceGroupDeployment to deploy a Resource Manager template that creates a VM with a Standard SSD ZRS OS disk and a Premium SSD ZRS data disk. Replace the variable values with the VM name, administrator credentials, region, and resource group for your deployment.
$vmName = "yourVMName"
$adminUsername = "yourAdminUsername"
$adminPassword = ConvertTo-SecureString "yourAdminPassword" -AsPlainText -Force
$osDiskType = "StandardSSD_ZRS"
$dataDiskType = "Premium_ZRS"
$region = "chinanorth2euap"
$resourceGroupName = "yourResourceGroupName"
New-AzResourceGroup -Name $resourceGroupName -Location $region
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName `
-TemplateUri "https://raw.githubusercontent.com/Azure-Samples/managed-disks-powershell-getting-started/master/ZRSDisks/CreateVMWithZRSDataDisks.json" `
-resourceName $vmName `
-adminUsername $adminUsername `
-adminPassword $adminPassword `
-region $region `
-osDiskType $osDiskType `
-dataDiskType $dataDiskType
Create virtual machines with a shared ZRS disk in different zones
The following Azure PowerShell example uses New-AzResourceGroupDeployment to deploy a Resource Manager template that creates two VMs in different availability zones and attaches the same shared Premium SSD ZRS disk to both VMs. Replace the variable values with the VM name prefix, administrator credentials, region, and existing resource group for your deployment.
$vmNamePrefix = "yourVMNamePrefix"
$adminUsername = "yourAdminUserName"
$adminPassword = ConvertTo-SecureString "yourAdminPassword" -AsPlainText -Force
$osDiskType = "StandardSSD_LRS"
$sharedDataDiskType = "Premium_ZRS"
$region = "chinanorth2euap"
$resourceGroupName = "zrstesting1"
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName `
-TemplateUri "https://raw.githubusercontent.com/Azure-Samples/managed-disks-powershell-getting-started/master/ZRSDisks/CreateVMsWithASharedDisk.json" `
-vmNamePrefix $vmNamePrefix `
-adminUsername $adminUsername `
-adminPassword $adminPassword `
-region $region `
-osDiskType $osDiskType `
-dataDiskType $sharedDataDiskType
Create a virtual machine scale set with ZRS disks
The following Azure PowerShell example uses New-AzResourceGroupDeployment to deploy a Resource Manager template that creates a virtual machine scale set with Standard SSD LRS OS disks and Premium SSD ZRS data disks. Replace the variable values with the scale set name, administrator credentials, region, and existing resource group for your deployment.
$vmssName="yourVMSSName"
$adminUsername="yourAdminName"
$adminPassword=ConvertTo-SecureString "yourAdminPassword" -AsPlainText -Force
$region="chinanorth2euap"
$resourceGroupName="yourResourceGroupName"
$osDiskType="StandardSSD_LRS"
$dataDiskType="Premium_ZRS"
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName `
-TemplateUri "https://raw.githubusercontent.com/Azure-Samples/managed-disks-powershell-getting-started/master/ZRSDisks/CreateVMSSWithZRSDisks.json" `
-vmssName $vmssName `
-adminUsername $adminUsername `
-adminPassword $adminPassword `
-region $region `
-osDiskType $osDiskType `
-dataDiskType $dataDiskType
Next steps
- Check out more Azure Resource Manager templates to create a VM with ZRS disks.
Additional resources
-
Last updated on
2026-09-30