If the disk on your Hyper-V host keeps filling up and you cannot work out why, checkpoints are one of the first things to look at. Each checkpoint keeps a record of the virtual machine’s disk at a point in time, and every change made after it is written to a separate file that grows and grows. Left alone for months, those files can fill the volume, and when that happens your virtual machines can pause without warning. Here is how to find them and clear them safely.
How checkpoints use disk space
When you take a checkpoint, Hyper-V stops writing to the virtual machine’s main disk file (the .vhdx) and starts writing changes to a new differencing disk with the extension .avhdx. Take another checkpoint and a second .avhdx is added on top, forming a chain. The longer a checkpoint exists and the busier the virtual machine, the larger these files grow. A database or file server can add a lot of data to an .avhdx in a few weeks.
There are two kinds of checkpoint. Production checkpoints, the default on recent versions of Windows Server, use backup technology inside the virtual machine to capture a consistent state of the disks. Standard checkpoints also save the contents of memory, so they take more space. Both create .avhdx files.
Signs checkpoints are the problem
- The volume holding your virtual machines is filling up although nothing new has been added.
- A virtual machine shows the status Paused-Critical, which Hyper-V uses when it has run out of space to write to.
- Your backup software is warning about checkpoints it could not remove.
- The virtual machine’s folder contains .avhdx files much larger than you would expect.
Find every checkpoint
In Hyper-V Manager, select each virtual machine and look at the Checkpoints pane. To see them all at once, open PowerShell as administrator on the host and run:
Get-VM | Get-VMSnapshot | Select-Object VMName, Name, SnapshotType, CreationTime
Checkpoints with the type Recovery are usually created by backup software while a backup runs. They should disappear when the backup finishes. If old ones are still there, the backup job may be failing to clean up after itself, and that needs looking at too.
It is also worth checking which disk file each virtual machine is actually using:
Get-VM | Get-VMHardDiskDrive | Select-Object VMName, Path
If a path ends in .avhdx but no checkpoint appears in the list, the virtual machine is running on a differencing disk that Hyper-V is no longer tracking as a checkpoint. Do not try to fix this by deleting or renaming files. Take a backup and get advice, because the safe fix depends on the state of the chain.
The one rule: never delete .avhdx files by hand
It is tempting to free space by deleting the large .avhdx files in the virtual machine’s folder. Do not. Those files hold every change made since the checkpoint was taken. Deleting one breaks the chain, and the virtual machine either will not start or starts with weeks or months of data missing. If someone has already done this, stop, change nothing else and get help, as the deleted file may still be recoverable from the volume if nothing more is written to it.
Removing checkpoints the safe way
Deleting a checkpoint in Hyper-V does not throw away your changes. Hyper-V merges the .avhdx back into its parent disk so the virtual machine keeps its current state. On current versions of Windows Server this happens while the virtual machine keeps running.
- Make sure you have a working backup of the virtual machine first. A merge is normally safe, but you want a way back if the host loses power or the storage has a fault during it.
- Check the free space. A merge needs working room on the volume. If the disk is completely full, free some space elsewhere on the volume first, for example old ISO files or exported copies you no longer need.
- Delete the checkpoint in Hyper-V Manager (right-click, Delete Checkpoint, or Delete Checkpoint Subtree to remove a checkpoint and everything below it), or in PowerShell with
Get-VMSnapshot -VMName "ServerName" | Remove-VMSnapshot. - Wait for the merge to finish. The status column shows progress. Large files can take a long time, and the host will be busier than usual. Do not restart the host or the virtual machine while it is merging.
- Confirm the result. Run the disk path command again and check that the virtual machine now points at its .vhdx file and the .avhdx files have gone.
If a virtual machine is already paused
A virtual machine in Paused-Critical has stopped because there is no space left to write. Free space on that volume first, then resume it. If the virtual machine will not resume, or shows errors about its disks, stop there. Repeated attempts to start a virtual machine with a damaged disk chain can make recovery harder.
Checkpoints are not backups
A checkpoint lives on the same storage as the virtual machine. If the disk, RAID array or host fails, the checkpoint is lost with it. Use checkpoints for short-term safety, such as before an update, and delete them once you know the change worked. Keep proper backups on separate storage, with at least one copy away from the office.
Need help with your Hyper-V server?
If your host is out of space, a virtual machine will not start, or a checkpoint chain has been broken, call us on 020 7237 4908 or get in touch online. Our server repair engineers work from our Central London repair centre, and we offer courier collection UK-wide. You get a free evaluation and a fixed quote before any work, with no fix, no fee. If data is missing, our data recovery service can help.