Here is a scenario for you: some lowly admin thinks he will free up space by moving a VHD file, or perhaps you add more storage to your home test lab, and move your VHD files to the new drive. If you tried this operation while the VM is running, the file copy will fail.
If you try this on saved or shut down VMs, you can definitely move the virtual hard drive (.vhdx file) which will cause the VM associated with it to rather predictably fail when powered on, as seen below.
Lets verify by going to the path specified.
Now, lets determine where the VHD file went off to. Lets use Powershell to track down the VM’s ID.
Using this excellent blog post by Ben Armstrong I determined that the VM configuration files are stored in the Virtual Machines folder on the path specified in the Powershell output (you can also check this using the Hyper-V console)
Earlier, we saw that the VM ID was 6D68E…, lets open the configuration file associated with it.
Search for the VHD path we gathered from the earlier error message. You should find this under the <controller#> <drive#> tags in the XML. Replace the incorrect path with the correct path. Be sure to omit any single or double quotes.
Now save the file, and try to restart the VM again with Hyper-V or Powershell.
I hope this helps you!