Expand virtual hard disks attached to a Windows VM in an Azure - Azure Virtual Machines (2024)

  • Article

Applies to: ✔️ Windows VMs ✔️ Flexible scale sets

When you create a new virtual machine (VM) in a resource group by deploying an image from Azure Marketplace, the default operating system (OS) disk is usually 127 GiB (some images have smaller OS disk sizes by default). You can add data disks to your VM (the amount depends on the VM SKU you selected) and we recommend installing applications and CPU-intensive workloads on data disks. You may need to expand the OS disk if you're supporting a legacy application that installs components on the OS disk or if you're migrating a physical PC or VM from on-premises that has a larger OS disk. This article covers expanding either OS disks or data disks.

An OS disk has a maximum capacity of 4,095 GiB. However, many operating systems are partitioned with master boot record (MBR) by default. MBR limits the usable size to 2 TiB. If you need more than 2 TiB, create and attach data disks and use them for data storage. If you need to store data on the OS disk and require the additional space, convert it to GUID Partition Table (GPT). To learn about the differences between MBR and GPT on Windows deployments, see Windows and GPT FAQ.

Important

Unless you use Expand without downtime, expanding a data disk requires the VM to be deallocated.

Shrinking an existing disk isn’t supported and may result in data loss.

After expanding the disks, you need to Expand the volume in the operating system to take advantage of the larger disk.

You can't expand the size of striped volumes.

Expand without downtime

You can expand data disks without deallocating your VM. The host cache setting of your disk doesn't change whether or not you can expand a data disk without deallocating your VM.

This feature has the following limitations:

  • Only supported for data disks.
  • If a Standard HDD, Standard SSD, or Premium SSD disk is 4 TiB or less, deallocate your VM and detach the disk before expanding it beyond 4 TiB. If one of those disk types is already greater than 4 TiB, you can expand it without deallocating the VM and detaching the disk. This doesn't apply to Premium SSD v2 or Ultra Disks.
  • Not supported for shared disks.
  • Install and use either:
    • The latest Azure CLI
    • The latest Azure PowerShell module
    • The Azure portal
    • Or an Azure Resource Manager template with an API version that's 2021-04-01 or newer.
  • Not available on some classic VMs. Use this script to get a list of classic VM SKUs that support expanding without downtime.

Preview for Ultra Disk and Premium SSD v2

Important

Expanding without downtime for Ultra Disks and Premium SSD v2 disks is currently in PREVIEW.See the Supplemental Terms of Use for Microsoft Azure Previewsfor legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.

Currently, you can sign up for a public preview for expanding Ultra Disks and Premium SSD v2 disks without downtimes here.

The preview has the following additional limitations:

  • You can't expand a disk while a background copy of data is also occurring on that disk, like when a disk is being hydrated from snapshots.
  • You can't expand a VM that's using NVMe controllers for Ultra Disks or Premium SSD v2 disks without downtime.

Regional availability

Resizing Ultra Disks and Premium SSD v2 disks is currently available as a preview in the following regions:

  • Australia East
  • Brazil South
  • Canada Central
  • Central India
  • Central US
  • East US 2
  • France Central
  • Japan East
  • Korea Central
  • North Europe
  • Southeast Asia

Resize a managed disk in the Azure portal

Important

If your disk meets the requirements in Expand without downtime, you can skip step 1.

  1. In the Azure portal, go to the virtual machine in which you want to expand the disk. Select Stop to deallocate the VM.

  2. In the left menu under Settings, select Disks.

    Expand virtual hard disks attached to a Windows VM in an Azure - Azure Virtual Machines (1)

  3. Under Disk name, select the disk you want to expand.

    Expand virtual hard disks attached to a Windows VM in an Azure - Azure Virtual Machines (2)

  4. In the left menu under Settings, select Size + performance.

    Expand virtual hard disks attached to a Windows VM in an Azure - Azure Virtual Machines (3)

  5. In Size + performance, select the disk size you want.

    Warning

    The new size should be greater than the existing disk size. The maximum allowed is 4,095 GB for OS disks. (It's possible to expand the VHD blob beyond that size, but the OS works only with the first 4,095 GB of space.)

    Expand virtual hard disks attached to a Windows VM in an Azure - Azure Virtual Machines (4)

  6. Select Resize at the bottom of the page.

    Expand virtual hard disks attached to a Windows VM in an Azure - Azure Virtual Machines (5)

Resize a managed disk by using PowerShell

Open your PowerShell ISE or PowerShell window in administrative mode and follow the steps below:

Sign in to your Microsoft Azure account in resource management mode and select your subscription:

Connect-AzAccountSelect-AzSubscription –SubscriptionName 'my-subscription-name'

Set your resource group name and VM name:

$rgName = 'my-resource-group-name'$vmName = 'my-vm-name'$diskName = 'my-disk-name'

Obtain a reference to your VM:

$vm = Get-AzVM -ResourceGroupName $rgName -Name $vmName

Important

If your disk meets the requirements in expand without downtime, you can skip step 4 and 6.

Stop the VM before resizing the disk:

Stop-AzVM -ResourceGroupName $rgName -Name $vmName

Obtain a reference to the managed OS disk. Set the size of the managed OS disk to the desired value and update the Disk:

$disk= Get-AzDisk -ResourceGroupName $rgName -DiskName $diskName$disk.DiskSizeGB = 1023Update-AzDisk -ResourceGroupName $rgName -Disk $disk -DiskName $disk.Name

Warning

The new size should be greater than the existing disk size. The maximum allowed is 4,095 GB for OS disks. (It is possible to expand the VHD blob beyond that size, but the OS works only with the first 4,095 GB of space.)

Updating the VM might take a few seconds. When the command finishes executing, restart the VM:

Start-AzVM -ResourceGroupName $rgName -Name $vmName

Remote into the VM, open Computer Management (or Disk Management) and expand the drive using the newly allocated space.

Expand the volume in the operating system

When you've expanded the disk for the VM, you need to go into the OS and expand the volume to encompass the new space. There are several methods for expanding a partition. This section covers connecting the VM using an RDP connection to expand the partition using Using Diskpart or Using Disk Manager.

Using DiskPart

When you've expanded the disk for the VM, you need to go into the OS and expand the volume to encompass the new space. There are several methods for expanding a partition. This section covers connecting the VM using an RDP connection to expand the partition using DiskPart.

  1. Open an RDP connection to your VM.

  2. Open a command prompt and type diskpart.

  3. At the DISKPART prompt, type list volume. Make note of the volume you want to extend.

  4. At the DISKPART prompt, type select volume <volumenumber>. This selects the volume volumenumber that you want to extend into contiguous, empty space on the same disk.

  5. At the DISKPART prompt, type extend [size=<size>]. This extends the selected volume by size in megabytes (MB).

Using Disk Manager

  1. Start a remote desktop session with the VM.

  2. Open Disk Management.

    Expand virtual hard disks attached to a Windows VM in an Azure - Azure Virtual Machines (6)

  3. Right-click on existing C: drive partition -> Extend Volume.

    Expand virtual hard disks attached to a Windows VM in an Azure - Azure Virtual Machines (7)

  4. Follow the steps you should be able to see the disk with updated capacity:

    Expand virtual hard disks attached to a Windows VM in an Azure - Azure Virtual Machines (8)

Expanding without downtime classic VM SKU support

If you're using a classic VM SKU, it might not support expanding disks without downtime.

Use the following PowerShell script to determine which VM SKUs it's available with:

Connect-AzAccount$subscriptionId="yourSubID"$location="desiredRegion"Set-AzContext -Subscription $subscriptionId$vmSizes=Get-AzComputeResourceSku -Location $location | where{$_.ResourceType -eq 'virtualMachines'}foreach($vmSize in $vmSizes){ foreach($capability in $vmSize.Capabilities) { if(($capability.Name -eq "EphemeralOSDiskSupported" -and $capability.Value -eq "True") -or ($capability.Name -eq "PremiumIO" -and $capability.Value -eq "True") -or ($capability.Name -eq "HyperVGenerations" -and $capability.Value -match "V2")) { $vmSize.Name } }}

Next steps

You can also attach disks using the Azure portal.

Expand virtual hard disks attached to a Windows VM in an Azure - Azure Virtual Machines (2024)

FAQs

Expand virtual hard disks attached to a Windows VM in an Azure - Azure Virtual Machines? ›

In the Azure portal, navigate to the "Disks" section under "Settings" and select the disk you want to expand. Then, select "Size + performance" and choose the new disk size.

How to extend the disk space in Azure VM? ›

In the Azure portal, navigate to the "Disks" section under "Settings" and select the disk you want to expand. Then, select "Size + performance" and choose the new disk size.

How do I expand the disk size of a virtual machine? ›

Click Edit Virtual Machine Settings. Click Hard Disk. Click Utilities > Expand, enter the new size, then click Expand. Complete the steps in Increasing the size of a disk partition (1004071), so that the guest operating system is aware of the change in disk size.

What is the maximum size of a data disk attached to an Azure VM? ›

What are the largest disk sizes supported by Azure Backup and Azure Site Recovery service? The largest disk size supported by Azure Backup is 32 TiB (4 TiB for encrypted disks). The largest disk size supported by Azure Site Recovery is 8 TiB.

How to increase disk space? ›

By moving rarely used files to an external hard drive, then deleting them from your system, you'll free up valuable storage space. Disk Cleanup removes temporary files, clears the cache, empties your Recycle Bin, and removes a variety of other files and items you no longer need.

What is the maximum disk size for Azure VM backup? ›

Individual disk size can be up to 32 TB and a maximum of 256 TB combined for all disks in a VM.

How do I add storage to my Azure virtual machine? ›

Add a data disk
  1. Sign in to the Azure portal.
  2. Search for and select Virtual machines.
  3. Select a virtual machine from the list.
  4. On the Virtual machine pane, select Disks.
  5. On the Disks pane, select Create and attach a new disk.
  6. In the drop-downs for the new disk, make the selections you want, and name the disk.

What is dynamically expanding a virtual hard disk? ›

Dynamic VHDs

A dynamic VHD has a maximum size but is initially very small. The guest operating system believes that it just a regular hard disk of the size indicated by the maximum. As it adds data to that disk, the underlying VHD file grows.

How do I increase disk size in Virtual Media Manager? ›

Resize the Virtual Hard Disk File. We open the VirtualBox Media Manager by clicking the Tools menu on the left sidebar menu. Then we just need to: (1) select the hard disk file, (2) set the new Size value that we want, and (3) click Apply.

Can we increase disk size in Azure VM? ›

You can add data disks to provide for more storage space, and you can also expand an existing data disk. The default virtual hard disk size for the operating system (OS) is typically 30 GB on a Linux VM in Azure. This article covers expanding either OS disks or data disks. You can't expand the size of striped volumes.

What is the maximum number of disks attached in Azure? ›

For example, a Standard_DS14_v2 VM can attach up to 64 disks, while a Standard_DS1_v2 VM can attach up to 4 disks. The maximum size of a single disk is 32 TB, and the maximum total size of all disks attached to a VM is 256 TB. Regarding the multipath concept, Azure Shared Disks support multipathing.

What is the maximum disk size for a VM? ›

The maximum value for large capacity hard disks is 62 TB.

How do I increase the size of my virtual box disk? ›

Use the Virtual Media Manager in VirtualBox

To access it, click File > Virtual Media Manager in the main VirtualBox window. Select a virtual hard disk in the list and use the "Size" slider at the bottom of the window to change its size. Click "Apply" when you're done.

How do I increase hard drive space in Hyper V virtual machine? ›

This operation is performed in the following way:
  1. Right-click the VM and select Connect. ...
  2. Enter DISKMGMT. ...
  3. Right-click the C: drive and select Extend Volume. ...
  4. Select the available amount of space by which you want to extend the volume. ...
  5. Check that you have selected the correct settings.
Jun 1, 2023

How to check disk size in Azure? ›

Additional information:Go to the Azure portal and navigate to the virtual machine scale set that you want to check. Click on the "Instances" tab to view the list of instances in the scale set. Select an instance from the list and click on the "Disks" tab to view the list of disks attached to the instance.

How to increase CPU cores in Azure VM? ›

You can follow these steps to request a core limit increase: In the Azure portal, navigate to your lab plan or lab account, and then select Request core limit increase. On the New support request page, enter the following information, and then select Next. Select the subscription to which the request applies.

Top Articles
Stock Exchanges Around the World
Best CoinTracker Alternatives - 2024 | Product Hunt
Craigslist Home Health Care Jobs
My E Chart Elliot
Workday Latech Edu
Driving Directions To Fedex
Professor Qwertyson
Acts 16 Nkjv
Free VIN Decoder Online | Decode any VIN
Publix 147 Coral Way
House Share: What we learned living with strangers
Culver's Flavor Of The Day Monroe
Housing Intranet Unt
Jet Ski Rental Conneaut Lake Pa
Oscar Nominated Brings Winning Profile to the Kentucky Turf Cup
General Info for Parents
Things To Do In Atlanta Tomorrow Night
Explore Top Free Tattoo Fonts: Style Your Ink Perfectly! 🖌️
Babyrainbow Private
Spartanburg County Detention Facility - Annex I
I Wanna Dance with Somebody : séances à Paris et en Île-de-France - L'Officiel des spectacles
Enterprise Car Sales Jacksonville Used Cars
London Ups Store
Wal-Mart 140 Supercenter Products
Everything We Know About Gladiator 2
Free Online Games on CrazyGames | Play Now!
Ceramic tiles vs vitrified tiles: Which one should you choose? - Building And Interiors
Construction Management Jumpstart 3Rd Edition Pdf Free Download
Craigslist Pasco Kennewick Richland Washington
Best Town Hall 11
Phoenixdabarbie
Craigslist Efficiency For Rent Hialeah
What is Software Defined Networking (SDN)? - GeeksforGeeks
Sam's Club Gas Price Hilliard
3473372961
Advance Auto Parts Stock Price | AAP Stock Quote, News, and History | Markets Insider
Elanco Rebates.com 2022
Sedano's Supermarkets Expands to Orlando - Sedano's Supermarkets
CVS Near Me | Somersworth, NH
SF bay area cars & trucks "chevrolet 50" - craigslist
How to Draw a Sailboat: 7 Steps (with Pictures) - wikiHow
Keir Starmer looks to Italy on how to stop migrant boats
Oppenheimer Showtimes Near B&B Theatres Liberty Cinema 12
22 Golden Rules for Fitness Beginners – Barnes Corner Fitness
A rough Sunday for some of the NFL's best teams in 2023 led to the three biggest upsets: Analysis
Bf273-11K-Cl
Craigslist Sparta Nj
Germany’s intensely private and immensely wealthy Reimann family
Slug Menace Rs3
Craigslist Cars For Sale By Owner Memphis Tn
Craigslist Cars And Trucks For Sale By Owner Indianapolis
Free Carnival-themed Google Slides & PowerPoint templates
Latest Posts
Article information

Author: Trent Wehner

Last Updated:

Views: 6267

Rating: 4.6 / 5 (76 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Trent Wehner

Birthday: 1993-03-14

Address: 872 Kevin Squares, New Codyville, AK 01785-0416

Phone: +18698800304764

Job: Senior Farming Developer

Hobby: Paintball, Calligraphy, Hunting, Flying disc, Lapidary, Rafting, Inline skating

Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.