I have encountered below scenarios few months back and issue addressed by following below approach
- VM appearing in Failover console and disappeared in Hyper-v Manager after unexpected reboot of Host server, it failed over and unregistered. -> Unable to find VM on any host in Hyper-v Manager
- After applying pass-through disk in failover console, it given access denied error but I started the VM to check -> VM tried to start in all nodes(16) and failed ->Post that, unable to start VM & open VM settings ->Unable to find VM on any Host in Hyper-v Manager
- Restarted VMM service – No luck – Had a thought of reregistering with import option as event id said failed to unregister.
- Imported With registration option From Hyper-v Manager – VM registered successfully
And for the 2nd case -> Registered VM with Mklink command
- Hyper-V operates using a list of symbolic links in a specific directory: C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines
- Each of these are links to the actual VM configuration files in their own respective subdirectories – whether stored locally or on shared storage, the link doesn’t change in its nature.
- First you need to identify the GUID of the specific VM.
- As an example will use the LitwareSpeech VM, located at D:\VMs\LitwareSpeech. In the “D:\VMs\LitwareSpeech\Virtual Machines” path is the configuration file for this VM, named “D546B942-76AF-4C3B-97C6-9EE74828BC91.XML”
Using the VM GUID that you determined above in Step 1, run the following command:
Syntax: mklink <GUID>.XML <VMConfigPath.XML> or in our example
mklink D546B942-76AF-4C3B-97C6-9EE74828BC91.xml “D:\VMs\LitwareSpeech\Virtual Machines\D546B942-76AF-4C3B-97C6-9EE74828BC91.xml”
Above command restores the reference to your VM in Hyper-V Manager.
Ideally, when you create a VM Hyper-V creates a security entry (ACE) on this symbolic link for the SID of the worker process for the VM. Unfortunately, this ACE isn’t re-created when you recreate the symbolic link using mklink as detailed above.
If you try to start your re-registered VM at this point, you may receive permission issue
To address this issue, follow these steps:
Using this GUID, run the following command to provide permissions
Syntax: icacls “C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines\<GUID>.xml” /grant “NT VIRTUAL MACHINE\<GUID>“:(F) /L
icacls “C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines\D546B942-76AF-4C3B-97C6-9EE74828BC91.xml” /grant “NT VIRTUAL MACHINE\D546B942-76AF-4C3B-97C6-9EE74828BC91”:(F) /L
Above command regenerates the necessary ACE on the symbolic link using the Service SID of the VM, rather than on the configuration file itself, replicating the initial state of the symbolic link.
Once this command has been run successfully, you should be able to start your VM without further issues.
If above command steps does not work, you can try by stopping Hyper-v Virtual Machine Management Service
- In few scenarios, we may need to unregister
- Delete the file symbolic link, will just deletes link and unregister from Hyper-v Manager. The VM and its configuration will be kept in your HDD
- You can follow the above steps to register VM