By Crystal / Last Updated April 1, 2022

Expand Hyper-V disk to avoid insufficient space error

When creating Hyper-V virtual machine, you need to choose the type of virtual hard disk such as Fixed size disk, Dynamically expanding disk and Differential disk. The virtual hard disk here is used to store all the workloads of virtual machine.

As time goes by, you may encounter problems with insufficient space of virtual disks which can be result from excessive data, too many applications, lack of regular disk management, oversized files, etc. Insufficient disk space can seriously affect the performance of the virtual machine, slow down the work process, or even lead to the system crash. So, resizing the disk size is necessary and do not ignore the imporance of VM backup.

In this article, I will introduce the convenient and efficient ways to expand Hyper-V virtual disk size and protect Hyper-V. Please refer to the following content.

Prerequisites of increasing Hyper-V disk space

Before you expand the Hyper-V virtual hard disk, you can use the built-in Disk Cleanup utility in Windows for all Windows clients and servers that is designed to create more space. After cleaning up the disk, if you still cannot get sufficient room, please check the following items first and go to configure the virtual disk size in Hyper-V.

1. A virtual machine with enabled Hyper-V feature and installed Windows Server 2012 R2 or later.

2. If the virtual machine has checkpoints, you cannot expand or shrink the virtual hard disk. When you create a new virtual hard disk, it is configured as a dynamically expanding virtual hard disk. After creating a checkpoint, the disk will be treated as a differential virtual hard disk. So, make sure you delete all checkpoints before editing the disk size.

How to expand virtual disk in Hyper-V

Facing with the insufficient storage space, you can use Hyper-V Manager or cmdlet to increase the size of Hyper-V virtual disk. If you want to shrink the VHD, the procedure is much similar.

Method 1. Expand Hyper-V disk size via Hyper-V Manager

1. Navigate to Hyper-V Manager and select a virtual machine you want to expand its virtual disk. Select Edit Disk to open the Edit Virtual Hard Disk wizard.

Tips: You can also access VM >> Settings >> SCSI Controller >>  Hard Drive >> Edit.

2. Click Next to Locate Disk page, click Browse to locate the path of virtual hard disk, then select the file and click Open >> Next.

3. On Choose Action page, there are 3 options for you to choose Compact, Expand, Shrink. Select Expand and click Next.

expand disk size

4. Then go to resize the Hyper-V virtual hard disk, configure a larger size for VHD and click Next.

configure disks size

5. Review the information and click Finish.

Once you have expanded the Hyper-V virtual disk, then please go to open Disk Management to extend the volume connected to the virtual machine.

6. Select VM and Connect. Enter DiskMgmt.msc to open the Disk Management Console. You can notice the unallocated space on the disk. Then right-click the volume and select Extend Volume and follow the steps to select proper space. Click Next >> Finish.

extend volume

Method 2. Use PowerShell to expand VHD size

If you are familiar with using PowerShell, you can also quickly resize the virtual hard disk by writing a script. The cmdlet to use is Resize-VHD.

First you need to access to the full path of the virtual hard disk, then resize the virtual disk, if the size is smaller than the original disk, it will fail to expand the virtual disk.

Get-VM -VMName wins01 | Select-Object VMId | Get-VHD

Resize-VHD -Path 'F:\VM\wins01\VHD\wins01.vhdx' -SizeBytes 60Gb

After increasing disk size, you still need to keep track of your Hyper-V storage and avoid the issue of running low on space. You can never predict how much disk space will be taken up on your next operation, so to avoid system crashes or data loss, it's also a good idea to back up Hyper-V virtual machines.

How to protect Hyper-V virtual machine

Hyper-V virtual hard disk contains a file system, disk partitions, sector and folders. It stores numerous data of virtual machines. So, in order to avoid disk-damaged, you should back up Hyper-V data to secure the VM security.

AOMEI Cyber Backup offers comprehensive backup for Hyper-V virtual machines before you make big changes. ACB offers automated backup and instant disaster recovery of VM, which minimize operational disruptions and protect data from security threats. Next, I will use ACB to show the backup procedures in Hyper-V.

Protect Hyper-V virtual machine easier with ACB

1. Install AOMEI Cyber Backup and add Hyper-V device.

Download Free TrialHyper-V host 2012 and above
Secure Download

2. Create Backup Task: click Backup Task >> Create Backup Task.

❖In the opened window, you need to name the task >> select the virtual machines >> specify a destination to store VM. It allows you to back up unlimited VMs at once through the central console and simplify the VM management.

select virtual machine

❖Schedule the task: flexible backup strategies to offer resilient change tracking, and set up time to run the task automatically.

schedule VM backup

❖Backup Cleanup: specify the retention policy to delete the unwanted files automatically.

backup cleanup

3. Restore: select restore content and click Restore to original or new location. It can achieve fast disaster recovery to another host easily without reinstallation or configuration of VM.

restore virtual machine

With AOMEI Cyber Backup, it’s easy to perform Hyper-V backup and recovery based on the intuitive interface and click operation. You can quickly back up numerous virtual machines and provide VM protection with an affordable cost.

Summary

This article provides you with 2 methods to expand Hyper-V virtual hard disk. To prevent VM data-loss, you can backup your virtual machines before you perform risky operation.