Quantcast
Channel: Hyper-V forum
Viewing all articles
Browse latest Browse all 8743

Reinitialize Virtual Hard Disk

$
0
0

I have a virtual hard disk (VHD) stored on an external USB drive. The external drive does not have a letter assigned; this is to protect its contents from viral attack. In Hyper-V Manager, I added the VHD to a VM by using the DeviceID of the external drive. The virtual hard disk successfully appears in disk management of the VM. However, at some point the VHD becomes detached (perhaps due to a backup running on the Hyper-V host) and does not reattach unless I re-add it in the Hyper-V GUI or restart the VM.

Is there a Powershell method to reinitialize the detached VHD? I have tried using "Add-VMHardDiskDrive" but it will not accept the DeviceID in the Path argument. A Powershell command which reattaches the VHD seems better than restarting the VM every time the backups run.


Viewing all articles
Browse latest Browse all 8743

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>