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 importance 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 on 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 Hyper-V disk
Facing with the insufficient storage space, you can use Hyper-V Manager or cmdlet to increase Hyper-V disk size. 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 that 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.
4. Then go to resize the Hyper-V virtual hard disk, configure a larger size for VHD and click Next.
5. Review the information and click Finish.
Once you have expanded 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.
Method 2. Use PowerShell to increase Hyper-V disk size
If you are familiar with using PowerShell, you can also quickly expand VHD in Hyper-V 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 Hyper-V virtual disk.
Get-VM -VMName wins01 | Select-Object VMId | Get-VHD
Resize-VHD -Path 'F:\VM\wins01\VHD\wins01.vhdx' -SizeBytes 60Gb
After increasing Hyper-V 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 for free
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 your virtual machines.
AOMEI Cyber Backup is a free Hyper-V backup software that offers comprehensive backup for Hyper-V virtual machines before you make big changes. It automates VM backup and enables instant disaster recovery of VM, which minimize operational disruptions and protect data from security threats. Next, I will use this professional software to show the backup procedures in Hyper-V.
Perpetual Free: no time limit for AOMEI Cyber Backup Free Edition.
Easy-to-use: backup and restore multiple virtual machines via central console without complicated configuration and reinstallation.
Secure VM Backup: schedule VMware or Hyper-V virtual machine backups and perform hot backup to protect crucial data continuously without human errors.
Instant Disaster Recovery: instantly restore the whole virtual machine to the previous state from any selected history version.
Role-Assignment: allow one administrator to create sub-accounts with limited privilege, effectively reduce administration cost and manual errors.
Protect Hyper-V virtual machine with free backup solution
1. Install AOMEI Cyber Backup and add Hyper-V device.
*You can choose to install this VM backup software on either Windows or Linux system.
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 multiple VMs at once through the central console.
❖ Schedule: use flexible backup strategies to offer resilient change tracking, and set up time to run the task automatically.
❖ Click Start Backup.
3. Restore: select restore content and click Restore to original location. It can achieve disaster recovery easily.
✍ While the Free Edition covers most of the VM backup needs, you can also upgrade to Premium Edition to enjoy:
✦ Batch VM Backup: Batch backup large numbers of VMs managed by hosts.
✦ Backup Cleanup: Configure retention policy to auto delete the old backup files and save storage space.
✦ Restore to new location: Easily make a clone of a virtual machine in the same or another datastore/host, without reinstalling or configuring a new VM.
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.
In this article, I have described 2 methods on how to expand Hyper-V disk. To prevent VM data-loss, you can back up your virtual machines before you perform risky operation.
Besides, if you want to convert fixed size VHD to dynamic, you should monitor the virtual disk size constantly.