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.
Applies to: ✔️ Windows VMs ✔️ Linux VMs
Summary
This article helps you diagnose and resolve common failures when you resize managed disks on Microsoft Azure virtual machines (VMs).
Symptoms
You experience one of the following issues when you try to resize a managed disk:
- The Save or Resize buttons are unavailable (dimmed) on the Size + performance blade.
- You receive an error message after you select Save or Resize.
- The Azure portal shows the new disk size, but the operating system (OS) still reports the old size.
Identify the error code
To find the specific error code:
- In the Azure portal, select the bell icon (Notifications).
- Find the failed resize operation, and select it to see the full error details.
Alternatively, check the Activity Log:
- Go to the disk resource, and select Activity log.
- Filter for Failed operations in the last 24 hours.
- Select the failed operation. The JSON tab shows the error code and message.
Error code reference
Use the following table to find the resolution for your specific error.
| Error code | Cause | Resolution |
|---|---|---|
ChangeDiskSizeWhileActiveSasNotAllowed |
A Shared Access Signature (SAS) Uniform Resource Identifier (URI) holds a lease on the disk. A backup job or disk export might be in progress. | Revoke the SAS token |
ChangeDiskSizeWhileAttachedForSkuNotAllowed |
The disk SKU doesn't support online resize for this attach configuration. | Deallocate the VM before resizing |
InvalidResizeForLargeDisks |
A Standard HDD, Standard SSD, or Premium SSD disk that is 4 TiB or smaller can't be expanded beyond four (4) tebibytes (TiB) while attached. | Detach the disk before resizing past 4 TiB |
LiveResizeSharedDiskNotAllowed |
A shared disk (max-shares greater than one (1)) can't be resized while attached to any VM. |
Detach a shared disk from all VMs before resizing |
InvalidParameter / InvalidResizeWithName |
The target size is outside the valid range for the disk SKU, or you're trying to shrink the disk. | Verify that the target size is valid |
Revoke an active SAS token
An active SAS URI creates a read lease on the disk's backing page blob. While a lease is active, the disk resource provider refuses all modifications.
How to check
- In the Azure portal, go to the disk resource.
- On the menu, select Disk Export.
- If you see a download URL that has an expiry timestamp, an active SAS is holding the lease.
- If you don't see an export URL, check Azure Backup: Go to Recovery Services vault > Backup Jobs, and look for a running job on this VM.
Solution
- If there's an export URL, select Revoke access.
- If Azure Backup is running, wait for the job to finish, or cancel it in the vault's Backup Jobs pane.
- Retry the disk resize after you revoke the SAS or after the backup job finishes.
Note
For a detailed troubleshooting flow for SAS-blocked disk resize, see Troubleshoot disk resize blocked by SAS URI.
Deallocate the VM before resizing
The VM host's SCSI stack doesn't support in-place geometry changes for certain disk SKU and attach combinations.
Online resize (without deallocation) isn't supported for the following disk types:
- OS disks
- Shared disks (
max-sharesgreater than 1) - Standard HDD, Standard SSD, or Premium SSD data disks that are 4 TiB or smaller when you expand the disk beyond 4 TiB
Online resize is supported for the following disk types:
- Premium SSD v2 or Ultra Disk data disks (any size)
- Standard or Premium data disks that are already larger than 4 TiB
Steps
To deallocate the VM and resize the disk, follow these steps:
- In the Azure portal, go to your VM, and select Stop.
- Wait until the status shows Stopped (deallocated).
- Go to the disk resource, select Size + performance, enter the new size, and then select Save.
- Go back to the VM, and select Start.
Important
Stopped and Stopped (deallocated) are different states. Shutting down from inside Windows leaves the VM in the Stopped state (still billed, still holds leases). To fully deallocate, you must select Stop in the Azure portal.
For the full list of online resize restrictions, see Expand without downtime.
Detach the disk before resizing past 4 TiB
Managed disks use different storage back ends for sizes that are less than and greater than 4 TiB (single versus striped page blobs). To cross this boundary requires a back-end migration that can't occur while the disk is attached.
Check whether this limitation applies
To check whether this limitation applies, follow these steps:
- Go to the disk resource, and select Overview.
- Check the Size value. If it's 4,095 GiB or smaller, and your target size is larger, this limitation applies.
- Check the SKU. This limitation applies only to Standard HDD, Standard SSD, and Premium SSD. Premium SSD v2 and Ultra Disk are exempt.
Data disks larger than 4 TiB
To resize a data disk that's larger than 4 TiB, follow these steps:
- Go to the VM, select Disks, and detach the data disk.
- Go to the detached disk, select Size + performance, set the new size, and then select Save.
- Reattach the disk to the VM.
For OS disks
You can't detach an OS disk. Instead, stop (deallocate) the VM, resize the disk, and then start the VM.
Detach a shared disk from all VMs before resizing
Shared disks use SCSI-3 Persistent Reservations across multiple VM hosts. Resizing invalidates the reservation state.
Check whether the disk is shared
To check whether the disk is shared, follow these steps:
- Go to the disk resource, and select Overview.
- Check Max shares. If the value is greater than 1, the disk is shared.
Solution
To resize a shared disk, follow these steps:
- Detach the shared disk from all VMs.
- Resize the disk.
- Reattach the disk to all VMs.
Warning
For clustered workloads (Windows Server Failover Clustering, Storage Spaces Direct), coordinate with your cluster administrator before you detach the disk. Detaching causes a storage failover.
For more information about shared disks, see Azure shared disks.
Verify that the target size is valid
The disk resource provider validates the target size against the SKU's minimum, maximum, and increment rules. Shrinking a disk isn't supported.
Check whether this limitation applies
To check whether this limitation applies, follow these steps:
- Go to the disk resource, select Overview, and note the current Size and SKU.
- Compare your target size against the disk type comparison table.
- Verify that the target size is larger than the current size. Azure doesn't support reducing the disk size.
If you need a smaller disk, see Decrease the size of an Azure data disk without losing data.
Volume doesn't reflect the new size in the OS
If the Azure portal shows the correct new disk size, but the OS still reports the old size, see the following articles:
- Expand the volume in the operating system — rescan disks and extend the volume.
- Cannot extend volume - recovery partition blocks extend — a recovery partition is between the OS volume and unallocated space.
- Convert MBR to GPT on an Azure VM — the disk uses MBR partition style, limiting usable size to 2 TiB.
- Cannot extend an encrypted OS volume — Azure Disk Encryption placed a System Reserved partition that blocks the extend.
- Can't extend the volume on a SQL Server VM — SQL Marketplace VMs use Storage Spaces pools.