Rediģēt

Kopīgot, izmantojot


Convert a disk from LRS to ZRS

This article explains how to convert an existing disk from locally redundant storage (LRS) to zone-redundant storage (ZRS).

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. Force detach only supports data disks.

Regional availability

ZRS disks are currently available in the following regions:

  • South Africa North
  • East Asia
  • Southeast Asia
  • Australia East
  • US Gov Virginia
  • Brazil South
  • Canada Central
  • China North 3
  • North Europe
  • West Europe
  • France Central
  • Germany West Central
  • Central India
  • Israel Central
  • Italy North
  • Japan East
  • Korea Central
  • Norway East
  • Poland Central
  • Qatar Central
  • Sweden Central
  • Switzerland North
  • UAE North
  • UK South
  • Central US
  • East US
  • East US 2
  • South Central US
  • West US 2
  • West US 3

Determine infrastructure redundancy

Before you convert a disk from LRS to ZRS, you must first identify whether the disk is zonal or regional. How you migrate your disk changes based on whether it's zonal or regional.

  1. Sign in to the Azure portal
  2. Navigate to your disk and look under Availability zone on the Overview tab.
    1. If the value is No infrastructure redundancy required you have a regional disk. Use Regional migration to migrate your disk.
    2. If the value is anything else, you have a zonal disk. Use Zonal migration to migrate your disk.

Regional migration

You can directly change the disk type of regional disks with the following options.

Follow these steps:

  1. Sign in to the Azure portal.
  2. Select the VM from the list of Virtual machines.
  3. If the VM isn't stopped, select Stop at the top of the VM Overview pane, and wait for the VM to stop.
  4. In the pane for the VM, select Disks from the menu.
  5. Select the disk that you want to convert.
  6. Select Size + performance from the menu.
  7. Change the Account type from the original disk type to the desired disk type.
  8. Select Save, and close the disk pane.

The disk type conversion is instantaneous. You can start your VM after the conversion.

Zonal migration

In this section, you migrate the data from your current managed disks to ZRS managed disks.

If you have a zonal disk, you can't directly change its type. You must take a snapshot and use that snapshot to create a new ZRS disk.

Step 1: Create your snapshot

The easiest and cleanest way to create a snapshot is to take one while the VM is offline. See Snapshots. If you choose this approach, some downtime should be expected. To create a snapshot of your VM using the Azure portal, PowerShell, or Azure CLI, see Create a snapshot of a virtual hard disk

If you're taking a snapshot of a disk that's attached to a running VM, read the guidance in Snapshots before continuing.

Note

The source managed disks remain intact with their current configurations and you'll continue to be billed for them. To avoid this, you must manually delete the disks once you've finished your migration and confirmed the new disks are working. For more information, see Find and delete unattached Azure managed and unmanaged disks.

Step 2: Migrate the data on your managed disks

Now that you have snapshots of your original disks, you can use them to create ZRS managed disks.

Migrate your data to ZRS managed disks
  1. Create a ZRS managed disk from the source disk snapshot by using the following Azure CLI snippet:

    # Create a new ZRS Managed Disks using the snapshot Id and the SKU supported   
    storageType=Premium_ZRS 
    location=westus2 
    
    az disk create --resource-group $resourceGroupName --name $diskName --sku $storageType --size-gb $diskSize --source $snapshotId 
    
    

Step 3: Create a new VM with your new disks

Now that you have migrated your data to ZRS managed disks or zonal managed disks, create a new VM with these new disks set as the OS and data disks:


    az vm create -g MyResourceGroup -n MyVm --attach-os-disk newZonalOSDiskCopy --attach-data-disks newZonalDataDiskCopy --os-type linux