Sometimes when a Hyper-V Host crashes, stale snapshots will be created. If you cannot remove the snapshot's via the GUI, you can try the two methods found in this article.
A stale Snapshot or Checkpoint will prevent you from being able to resize the disk in the future. Actually it's really bad in case of another system outage because you might lose all data created after the snapshot was created.
Warning: Be very cautious when removing Snapshots or Checkpoints. Make sure you understand the consequences by making mistakes when following these procedures...
Using PowerShell Only:
1. IMPORTANT: Make a backup of the VM
2. Open PowerShell
2. Try the following command with VM On or Off (replace <VM> with actual name)
Get-VMSnapshot -VMName "<VM>" | Remove-VMSnapshot
If that did not work, you will need to have some manual intervention:
Second Method:
1. Turn the VM completely off
2. Log on to the Hyper-V node that the VM lives on
3. Open Hyper-V Manager
4. Select “Edit Disk…” located under Actions (on the right hand side)
5. Browse and select the VM’s .avhdx checkpoint file
6. Select “Merge”
7. Select “To the parent virtual hard disk” to merge the .avhdx file with its original .vhdx
8. Select “Finish” and allow time for the merge to complete
9. Repeat this steps for ALL VOLUMES attached to the VM that have .avhdx files
10. Once all of the .avhdx files have been merged, open PowerShell with Admin rights
11. Enter the following command (replace <VM> with actual name)
Get-VMSnapshot -VMName "<VM>" | Remove-VMSnapshot
Comments