Edit

Share via


Use premium SSD v2 with VMs in availability set

Introduction

Premium SSD v2 managed disks are supported with Azure Virtual Machines in availability sets to enhance the high availability of your applications. When VMs using Premium SSD v2 are part of an availability set, the platform ensures that their disks are automatically distributed across multiple storage fault domains. This distribution minimizes the risk of a single point of failure.

Diagram showing availability set with managed disk fault ___domain alignment setup.

Availability sets have fault isolation for many possible failures, to minimize single points of failure and to offer high availability. If there's a failure in one storage fault ___domain, only the virtual machine (VM) instances with Premium SSD v2 disks on that specific fault ___domain are affected. Other VM instances, whose disks are placed on separate fault domains, remain unaffected and continue to operate normally. Availability sets are susceptible to certain shared infrastructure failures, like datacenter network failures, physical hardware failures or power interruptions which can affect multiple fault domains.

When a Premium SSD v2 disk located in one fault ___domain is attached to a VM in another fault ___domain, the system triggers a background copy. This process moves the disk to match the VM’s fault ___domain, helping ensure consistent alignment between compute and storage for better reliability and availability.

Diagram Showing Availability Set with Managed Disk Fault Domain alignment Disk Move.

As the previous diagram illustrates, if a disk located in fault ___domain 1 is attached to a VM in fault ___domain 1 and is later detached and attached to a VM in fault ___domain 2, the system automatically triggers a background copy of the disk to move it from fault ___domain 1 to fault ___domain 2 for compute and storage fault ___domain alignment. This background move process can take up to 24 hours to complete.

Regional availability

Premium SSD v2 support for VMs in an availability set is currently limited to the following regions that lack availability zone support:

  • Australia Southeast
  • Canada East
  • North Central US
  • UK West
  • West Central US
  • West US

Limitations

  • Premium SSD v2 is supported for VMs in availability set in select regions without availability zones.
  • You must register your subscription to use this feature. Follow the steps in Register Premium SSD v2 with VMs in availability sets in regions without availability zones.
  • Only one background data copy can run per disk at a time. When attaching a disk to a VM in an availability set, the system might start a background copy to align with the fault ___domain. If you try to detach and reattach the disk while this move is in progress, the operation fails with an error. To prevent operation failure, wait until the move finishes, or set the OptimizedForFrequentAttach property on the disk. This setting skips fault ___domain-alignment background copies for future attachments. For more information on OptimizedForFrequentAttach, follow the instructions Optimize background data copy of the disk.
  • You can’t attach a disk created from a snapshot to VMs in an availability set while it’s still copying data in the background. Wait until the copy process finishes before attaching the disk. To check the status of background data copy from a snapshot, follow the instructions here.
  • Disk size increase and changing customer-managed key (CMK) are not supported while a background data copy for Fault Domain alignment is in progress.
  • Premium SSD v2 managed disks have their own separate set of limitations, as well.

Register Premium SSD v2 with VMs in availability sets in supported regions without availability zones

The feature is only available in regions that do not support Availability Zones. If you're targeting a supported region without availability zones, ensure your subscription is registered for the required feature.

To proceed, register the feature manually:

  • Use the following command to register the feature with your subscription:
    az feature registration create --namespace Microsoft.Compute --name PV2WithAVSetRegionWithoutZone 
    
  • Use the command below to verify if the feature is registered :
    az feature registration show --provider Microsoft.Compute --name PV2WithAVSetRegionWithoutZone 
    

Deploy a VM and a Premium SSD v2 disk within an availability set

  • Create a resource group:
az group create --name myResourceGroup --___location myLocation 
  • The number of storage fault domains varies by region. The following command retrieves a list of maximum suported fault domains per region:
az vm list-skus --resource-type availabilitySets --query '[?name==`Aligned`].{Location:locationInfo[0].___location,  MaximumFaultDomainCount:capabilities[0].value}' -o Table 
  • Create an availability set:
az vm availability-set create -n myAvSet -g myResourceGroup --platform-fault-___domain-count myFDCount --platform-update-___domain-count myUDCount

## The value for platform-fault-___domain-count should be determined based on the number of maximum supported fault domains in a given region. See previous step to check the available fault domains per region.
  • Create a VM:
az vm create -n myVMname -g myResourceGroupName --availability-set myAvSetName --image Win2016Datacenter --count MyCount 
  • Attach a new Premium SSD v2 disk to existing VMs in an availability set
az vm disk attach -g MyResourceGroupName --vm-name MyVMname --name MyDiskName --new --sku PremiumV2_LRS --size-gb MySize
  • Attach existing Premium SSD v2 disk to existing VMs in an Availability Set:
az vm disk attach -g MyResourceGroupName --vm-name MyVMname --disks MyDiskName

Optimize background data copy of the disk

Change optimized-for-frequent-attach disk property

If your workload often moves disks between VMs in the same or different availability sets, turn on the optimized-for-frequent-attach property. Setting this property to true prevents the system from triggering a background copy of the disk for fault ___domain alignment during reattachments. optimized-for-frequent-attach can be set when creating a new unattached disk or update it later for an existing disk. If the disk is currently attached to a VM, first detach the disk. Update the optimized-for-frequent-attach disk property and then reattach the disk to the VM.

To set the property while creating a new unattached disk:

az disk create --name myDiskName --resource-group myResourceGroup --___location myLocation --sku PremiumV2_LRS --size-gb myGB --optimized-for-frequent-attach true 

To update the property on an existing unattached disk:

az disk update --name myDiskName --resource-group myResourceGroup --set optimizedForFrequentAttach=true

Next steps