Fix it now
The management service tried to reach a path and could not, so machines drop out of the console and storage operations fail part-way. The machines themselves are almost always intact on disk; what has broken is the registration that tells the host where they live.
Get-VMHost | Select-Object VirtualMachinePath, VirtualHardDiskPath
Get-VM | Select-Object Name, State, Path
Get-Volume
- Read the path out of the event and compare it with the host defaults and with what
Get-VMstill believes. A path that no longer resolves is the answer. - Confirm the storage is present. For clustered storage, check the volume is online in Failover Cluster Manager rather than in Disk Management.
- For a machine that has vanished from the console but whose files exist, check it first with
Compare-VM -Path '<path to the .vmcx>'and read the incompatibilities it reports. - Register it in place with
Import-VM -Path '<path to the .vmcx>' -Register, which keeps the files and the identifier where they are.
Register in place. Importing as a copy creates a new identifier, which quietly breaks the per-machine disk permissions and any cluster configuration that refers to the old one.
If every machine appears with a path that resolves, stop here. If several vanished at once, the next section explains why that is one fault rather than several.
Why it happens
A virtual machine is a set of files: a configuration file, its runtime state and its virtual disks. The management service keeps a registration pointing at that configuration file, and the console shows you registrations rather than files. When a pointer cannot be followed, the machine drops out of the console and every operation against it fails, even though nothing has been deleted and the files are exactly where you left them.
Storage changes are the usual trigger. A drive letter that moved, a LUN that came back offline, a cluster volume that is paused, a file share that is unreachable, or a folder moved with a copy tool rather than through Hyper-V all break the pointer in the same way. Hyper-V’s own storage move updates the registration as it goes, which is the entire difference between Move-VMStorage and dragging a folder in Explorer.
Neither the events nor the code that comes with them is published by Microsoft, and none of them is specific enough to diagnose from anyway. Treat them as markers and work from the path named in the entry beside them. That path tells you whether you are looking at a volume, a share, a cluster volume or a folder somebody moved, and each of those has a different fix.
The storage path changed or the volume is not mounted
You have this one if The path in the entry does not resolve, and the machines that disappeared all lived on the same volume.
- Compare
Get-VolumeandGet-Partitionagainst the paths the host expects, and restore the original drive letter or mount point where you can. - If the letter cannot be restored, move the machines properly with
Move-VMStorageso the registration is rewritten as the files move. - Fix the path before re-importing, not after: a machine registered against a wrong path is a second problem.
- Confirm with
Get-VM | Select-Object Name, Paththat every machine now points somewhere real.
The files are present and no longer registered
You have this one if You can browse to the configuration file and the machine does not appear in Hyper-V Manager at all.
- Run
Compare-VM -Path '<path to the .vmcx>'first and read the report. It lists anything that would block the import, such as a virtual switch that does not exist on this host. - Fix what it reports, usually by connecting the network adapter to a switch this host actually has.
- Register in place with
Import-VM -Path '<path>' -Register, which leaves the files where they are and keeps the identifier. - Use the copy option, which generates a new identifier, only when you deliberately want a second and separate machine.
The identifier is what the disk permissions and any cluster configuration refer to. Registering in place keeps it; importing as a copy replaces it and breaks both without saying so.
The machines live on a file share the host cannot reach
You have this one if Local machines are fine and every machine on the share fails, or the share is reachable from your workstation and not from the host.
- Test from the host itself:
Test-Path '\\fileserver\vms'. - Grant the host computer accounts full control on both the share permissions and the NTFS permissions.
- Retry the operation from the host console first, to separate a rights problem from a delegation one.
- If it works at the console and not from your workstation, configure constrained delegation so the host can reach the share on your behalf.
Clustered storage is offline, paused or owned elsewhere
You have this one if The host is a cluster node and the affected volume shows as paused, in redirected access, or owned by another node.
- In Failover Cluster Manager, check the state of the cluster shared volume and of the disk resource behind it.
- Bring the volume back online through the cluster. Never force a clustered disk online in Disk Management: two nodes writing to one volume corrupts it.
- Check the path from the node with
Get-ClusterSharedVolumeand confirm the mount point under the cluster storage folder is present. - Once the volume is healthy the registrations resolve again without re-importing anything.
Full reference
Working out what the host cannot reach
| What you find | Where the fault sits |
|---|---|
| The path in the entry does not exist | A drive letter, mount point or folder changed |
| The path exists and the machine is still missing | The registration was lost; import the configuration in place |
| The volume shows offline or reserved | Storage or cluster ownership, not Hyper-V |
| The path is a file share | Share and NTFS rights for the host computer accounts, or delegation |
| Several machines vanished at once | One volume or one share, not several unrelated faults |
Import, compare and move, and what each one changes
| Cmdlet | What it does | What it leaves alone |
|---|---|---|
Compare-VM -Path |
Reports what would block an import, without importing anything | Everything |
Import-VM -Path -Register |
Registers the machine where its files already are, keeping the identifier | The files and the identifier |
Import-VM -Path -Copy -GenerateNewId |
Creates a separate machine with a new identifier | The original, which stays registered elsewhere |
Move-VMStorage |
Moves the files and rewrites the registration as it goes | The identifier |
Run Compare-VM before every import you are not certain about. It costs nothing, changes nothing, and it turns a failed import into a list of things to fix first. The usual entry on that list is a virtual switch the machine expects and this host does not have.
Machines on a file share
- Test the path from the host console, not from your workstation. The two use different credentials and often get different answers.
- Grant the host computer accounts full control on the share and on the folder. The worker processes run as the host, so the host’s computer account is what reaches the file server.
- If the console works and remote management does not, configure constrained delegation for the file server so your credentials can be passed on.
- Re-test from both places afterwards, because fixing one does not fix the other and you want to know which you fixed.
What not to do
- Do not repair this by editing the host’s data root by hand or recreating the links it keeps there. Use import and storage move so the service writes its own registrations.
- Do not force a clustered disk online outside the cluster. Two nodes writing to the same volume corrupts it, and the corruption is not always immediate or obvious.
- Do not import as a copy to make a missing machine reappear. It works, and it gives the machine a new identifier that its disk permissions and any cluster configuration do not know about.
- Do not move virtual machine folders with a file copy tool. Use
Move-VMStorage, which rewrites the registration as part of the move rather than leaving you to notice later.
After a move done the wrong way
If the files have already been copied by hand, the recovery is straightforward as long as you do it in order. Put the files where they are going to live permanently. Run Compare-VM and fix what it reports. Register in place. Then re-apply the per-machine permissions on the disks, because a file copy does not carry them and the machine will fail to start with a storage error that looks like a completely different problem. Only then start the machine.
None of this costs anything. It is a storage path and registration problem on infrastructure you already own and licence, and re-importing a machine you already have consumes nothing.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
Event ID 16010 |
Not published by Microsoft. It appears where a storage operation could not be completed; the path in the accompanying entry is the useful part | not published by the vendor |
Event ID 20148 |
Not published by Microsoft. It appears where a machine at the configured path could not be reached or registered | not published by the vendor |
0xA0040200 |
Not published by Microsoft. A general management service operation failure; read the path in the accompanying entry to place it | not published by the vendor |
Confirm the fix worked
- Every machine appears in
Get-VMwith a path that resolves. - One recovered machine starts and boots.
- A storage operation that previously failed now completes.
- For clustered storage,
Get-ClusterSharedVolumeshows the volume online and the mount point present on the node. - Machines recovered by file copy have their per-machine disk permissions back.
Questions people ask about this
Have I lost the virtual machines?
Almost certainly not. Registration and files are separate things, and a missing machine in the console usually means a pointer that cannot be followed. Check the files exist before you reach for a backup.
Does this cost anything to fix?
No. It is a storage path and registration problem on infrastructure you already own and licence. Re-importing a machine you already have consumes nothing.
Can I just copy the folder to new storage and import it?
You can, and register it in place at the new path. Expect to re-apply the per-machine permissions on the disks afterwards, because a file copy does not carry them.
Why did several machines disappear at once?
Because they shared one volume or one share. Treat it as a single storage fault rather than investigating each machine separately.
What is the difference between registering in place and importing a copy?
Registering in place keeps the machine’s identifier, which its disk permissions and any cluster configuration refer to. Importing a copy generates a new identifier and silently breaks both.
