By Alison / Last Updated April 12, 2022

How to delete Hyper-V AVHDX files without available checkpoints?

 

Case:

I have a Hyper-V virtual machine with no checkpoints available, however i can find a lot of AVHDX files on its virtual hard disk folder. And it is taking almost all the space. Is there any solution to delete these AVHDX files?

- Question from community.spiceworks.com

If you find that in a VM folder, there are some orphaned Hyper-V AVHDX files but no snapshot on that VM, it may because the deletion/merge of the Hyper-V snapshot didn’t complete properly. In this case, you can only manually delete the checkpoints and merge the AVHDX files to the original VM.

Hyper-V logo

In this article, I will introduce how to find the parent disk of the Hyper-V AVHDX filed, and 2 ways to manually delete or merge AVHDX files to the original VM.

Before you start, please make sure you have good backups of your VM data, and leave yourself enough downtime.

How to find the parent disk of Hyper-V AVHDX files

1. Launch Hyper-V Manager, power off the target VM and right-click on its name, select Settings.

Hyper-V VM Settings

2. Navigate to Hard Drive from the left inventory, Click Inspect and Inspect Parent… button in the pop-up window.

Inspect virtual hard disk

 Now you can see the parent disk of this AVHDX file.

Inspect parent disk of AVHDX file

Important: Backup your VMs to avoid unexpected data loss

Before you start, taking backups of your VM data is a reliable insurance to avoid unexpected data loss.

Here I recommend you AOMEI Cyber Backup for the following benefits.

Concise Steps: With 2 easy steps you can quickly create a complete backup task.
Multiple VMs Backup: You can cover multiple or even all VMs on the host in one backup task.
Offsite Storage: You can back up your VMs to network storages for better protection.
Offsite Restore: You can restore the backup to new VMs on nother host.
Supported Versions: Hyper-V in Windows 8/8.1/10/11, Windows Server/Microsoft Hyper-V Server 2012 R2 and later versions.

Next, I will show how to quickly create a Hyper-V VM backup task. You can click the following button to start a free trial.

Download Free TrialHyper-V & VMware ESXi
Secure Download

How to quickly create a backup task via AOMEI Cyber Backup

Note: The first time you use AOMEI Cyber Backup to back up VMs on a Hyper-V host, you will need to Bind Device for authentication.

Add Hyper-V host

1. Launch AOMEI Cyber Backup, navigate to Backup Task and click + Create New Task. Set the Task Name, Device, Target, Schedule, and Cleanup as needed.

Create a Hyper-V backup task

2. Now you can click Start Backup and select Add the schedule and start backup now, or Add the schedule only.

Start Backup

How to delete Hyper-V AVHDX files with no snapshot available

After you have backed up your VM data, you can follow the 2 ways I introduce below to manually delete/merge AVHDX file to the original VM.

How to manually merge AVHDX file in Hyper-V Manager

1. Launch Hyper-V Manager, select the target VM and click Edit Disk… button to open an Edit Virtual Hard Disk Wizard.

Hyper-V Manager Edit Disk

2. Click Next to skip the introduction page and go to the Locate Disk tab, click Browse… to select the AVHDX file you want to delete. Click Next to continue.

Specify AVHDX file

3. On Choose Action tab, select Merge and click Next.

Select Merge AVHDX file

4. On Configure Disk sub tab, select To the parent virtual hard disk option and click Next.

Merge the changes to parent virtual hard disk

5. Review the Summary and click Finish to start merging.

Summary

How to delete Hyper-V AVHDX file via PowerShell

Note: You need to install Hyper-V PowerShell module in advance to run cmdlets.

Power off the target Hyper-V VM, launch Windows PowerShell, and run the following command to merge the AVHDX file:

Merge-VHD -Path 'complete avhdx file path\avhdx name.avhdx'

For example:

Merge-VHD -Path ' C:\Users\Public\Documents\Hyper-V\Virtual hard disks\windemo_7A8CAE52-C2BC-48A0-844A-477FE3879B96.avhdx'

PowerShell Merge-VHD cmdlet

Summary

If you find that there are Hyper-V AVHDX files in the VM folder but no snapshot on that VM, you may need to delete them manually, but properly. In this article, I introduced 2 ways to delete/merge AVHDX file to the original VM.

Keep a good backup of the VM data is always a reliable insurance. Here I recommend you AOMEI Cyber Backup, a professional backup software that allows you to cover multiple VMs in one backup task. In addition, you can create sub-accounts with limited privileges to avoid mis-operations.