Source:How to Remove Hyper-V Backup Checkpoint

From SEPsesam

About Hyper-V checkpoints (snapshots)

Hyper-V checkpoints, formerly known as Hyper-V snapshots (the correct term only for older systems, such as Windows Server 2008 and 2012, but no longer used for Windows Server 2012 R2 or later), are a point-in-time copy of a VM. As of Windows 10 Hyper-V, there are two different checkpoint types: Standard and Production. The latter are the default checkpoint type for all newer OS versions (Windows Server 2016 and Windows 10). For details, check Microsoft article Using checkpoints to revert virtual machines to a previous state.

SEP sesam uses production checkpoints when performing Hyper-V FULL or INCR backups to create a data-consistent backup of the VM. For this purpose, Windows Volume Shadow Copy Service (VSS) or Linux file system freeze are used. When a checkpoint is created, the following files are created in the VM's checkpoint folder: a VM configuration file, VM saved state files, and checkpoint differencing disks (automatic virtual hard disk files – .AVHD or .AVHDX).

At the end of the backup, the checkpoint and associated .AVHDX files should be merged and removed; backup should only keep the newer .AVHDX file at the end of each backup job. However, sometimes checkpoints get broken, e.g., Windows Server leaves a virtual machine in a locked or backup state even after backup is complete, or the removal of a checkpoint is blocked for some other reason. This may create problems if you try to release space on your Hyper-V host or when you try to modify the VM (e.g., to edit the VM settings in order to expand the file server’s storage), as no modification is allowed as long as there is a checkpoint associated with the VM.

In such case, you have to remove the lingering recovery checkpoints manually by using Powershell. You can find more details on working with checkpoints in the TechGenix article Managing Hyper-V From the Command Line.

Removing checkpoints manually

Deleting checkpoints can help create space on your Hyper-V host, but they have to be properly removed by using PowerShell Remove-VMSnapshot (not GUI). For more details and examples on used commands, check Microsoft PowerShell documentation Remove-VMSnapshot.

  1. On your Hyper-V host, open PowerShell as an Administrator and run the following command:
  2.  Get-VMSnapshot -ComputerName "My_Hyper-V_Host" -VMName "VM_with_backup_checkpoint"

    where "VM_with_backup_checkpoint" represents the actual name of your VMs as seen in the Hyper-V Manager on the host and "My_Hyper-V_Host" represents the name of your Hyper-V host.

    The checkpoint information will be shown.

  3. Use Remove-VMSnapshot command to remove a checkpoint and merge all data:
  4.  Get-VMSnapshot -ComputerName "My_Hyper-V_Host" -VMName "VM_with_backup_checkpoint" | Remove-VMSnapshot

    However, sometimes you don't want to remove all the checkpoints as there may be some that need to be retained. Is such case, you can only remove the backup checkpoints by using the following command:

     Get-VMSnapshot -ComputerName "My_Hyper-V_Host" -VMName "VM_with_backup_checkpoint" -SnapshotType Recovery | Remove-VMSnapshot

You can check the merging process in the GUI; once finished, the .AVHDX files are deleted and should no longer be in the storage location.

Copyright © SEP AG 1999-2024. All rights reserved.
Any form of reproduction of the contents or parts of this manual is allowed only with the express written permission from SEP AG. When compiling and designing user documentation SEP AG uses great diligence and attempts to deliver accurate and correct information. However, SEP AG cannot issue a guarantee for the contents of this manual.