I have a 2019 hyperv host with multiple VMs. After rebooting, the host hyperV manager only showed about half of the the vms in the list. The ones that were not listed were still running as I was able to ping and even rdp into it. Even replication is working.
I tried restaring vmms and even rebooted again. After looking through the internet I saw that its possible that one of the vm config file can be corrupt so I deleted the first VM missing in the list and created a new one attaching the original VHD file. I got the new up and it listed in the list but none of the other ones came back. I restarted VMMS again and the new one disaperated Although the session I had open before to it allowed me to reconnect.
I found an article that discussed rebuilding the MOF associated with it by running:
MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof
Select all
Open in new window
It didn't help.
A powershell vm-get command give me the following error:
get-vm : Hyper-V encountered an error trying to access an object on computer 'XXXXX' 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.
At line:1 char:1
- get-vm
- ~~~~~~
- CategoryInfo : ObjectNotFound: (:) [Get-VM], VirtualizationException
- FullyQualifiedErrorId : ObjectNotFound,Microsoft.HyperV.PowerShell.Commands.GetVM
but then it lists ALL of the VMS including the ones not showing in hyperv
How do I rebuild VM the list that shows the VMs