Recently I was onsite running some NCC checks and there was a lot of stale snapshots hanging around where the VM had just been deleted and the snaps where left behind consuming space and giving lots of errors in NCC.
After checking the KB3752 – I was able to run the following command :
ncc health_checks hyper visor_checks orphan_vm_snapshot_checks
Which gave me a list of all the orphan checks.
We need to get the GUID of the VM using the following command :
acli snapshot.get “GUID” of the snapshot so you can get the GUID of the VM
We can then check each of the GUID’s to be sure that the VM has been deleted and it’s safe to delete the snapshot.
Using the following command :
acli vm.get “GUID of VM”
You can see the VM is not found sp you have proven the VM has been deleted.
Now the snap can be deleted using
acli snapshot.delete “GUID of Snap”
Then repeat the process to delete all remaining orphan snaps.