vmms memory leak and remove-vm issue
Hello. I work with multiple windows servers, that are used as hyper-v hosts.
Hosts are quite powerful, 192-384 GB Ram, 16-28 CPU, hosted up to 40 virtual machines.
Every month I remove and re-create virtual machines (updates installation and so on). Before removing, I apply one of the basic checkpoints.
All works fine, but sometime (about 1-2 times per month) some memory leaks occur on host vmms service (usually it utilizes 300-800 MB, but in such situations 1-2 GB).
If I try to apply checkpoint, I receive HyperVException "'ApplySnapshot' failed with error 'InvalidState'!"
If I try run Remove-VM "VMname" -Force, it succeeded, but Get-VM returning an error
get-vm : Hyper-V encountered an error trying to access an object on computer 'SrvName' because the object was not found. The object might have been deleted, or you might not have permission to perform the task. Verify that the Virtual Machine Management service on the computer is running. If the service is running, try to perform the task again by using Run as Administrator.
and
Get-WmiObject -Class Msvm_ComputerSystem -Namespace "root\virtualization\v2"
still show me that virtual machine as existing.
If I restart vmms service, memory leak disappears, Get-VM not showing error, but still showing this "deleted" vm.
If I Run Remove-VM "VMName" -Force, everything fine, Get-VM not showing errors.
This situation occurs regularly and was on win2016, win2019 server too.