VMs missing in HyperV manager

Benjamin Nierman 46 Reputation points
2022-05-16T01:45:29.233+00:00

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

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,464 questions
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,545 questions
{count} vote

5 answers

Sort by: Most helpful
  1. Benjamin Nierman 46 Reputation points
    2022-05-16T16:59:01.753+00:00

    Ok I figured it out. I did the following:

    1) I did a get-vm from powershell
    2) Got the error as expected
    3) went to HyperV VMMS log and checked the error. It Identified the problem being a VM that no longer existed. (The one I mentioned earler).
    4) Shut down VMMS
    5) Went to the %systemdrive%\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines directory and deleted that link file. (actualy moved it out of that directory)
    6) Restarted VMMS

    Everything came back in hyperv manager and powershell get-VM no longer throws errors.

    8 people found this answer helpful.

  2. Dave Patrick 426.1K Reputation points MVP
    2022-05-16T01:55:58.243+00:00

    I think I do the same thing for rest that are missing. Create new VMs then when you get to step Connect Virtual Hard Disk choose Use an existing and point to the existing VHD

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    1 person found this answer helpful.

  3. Dave Patrick 426.1K Reputation points MVP
    2022-05-16T02:01:03.823+00:00

    If it were me I'd probably export or move the VHDs off the host to removable. Rebuild the host from scratch, patch fully, add hyper-v role, and import or create new VMs using the exported VHDs

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    1 person found this answer helpful.

  4. Jeff Poste 1 Reputation point
    2022-08-23T05:12:00.357+00:00

    Much appreciated that you posted this problem and solution. I had exactly the same problem after the WIndows Server 2019 May 2022 Update and your solution worked for me too. Thanks!

    0 comments No comments

  5. Fred Zhang 0 Reputation points
    2023-12-30T02:31:39.32+00:00

    I was getting the same error from Get-VM:

    Hyper-V encountered an error trying to access an object on computer '<my machine name>'
     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.
    

    I tried stopping/starting vmms and reinstalling Hyper-V but still got the same error.

    Hyper-V manager showed my VM name but the status was "cannot connect to virtual machine configuration storage".

    The Hyper-V Admin event log showed the error "'<my VM name>' cannot access the data folder of the virtual machine. (Virtual machine ID <GUID>)". I stopped vmms and deleted the corresponding contents of "%ProgramData%\Microsoft\Windows\Hyper-V\Virtual Machines Cache" and it finally worked.

    0 comments No comments