Reinstall Standalone Hyper V Server

One of my standalone Hyper-V host machines had a disk crash, and unfortunately, there was no RAID configured for the system drive. A failed OS disk was not a big deal when I had all my VMs on a different drive. I got the failed disk replaced and loaded it with a new OS; everything looked good. However, it was not so easy to import the VMs. Let's see what made it difficult.

The first task was to find out the virtual machine configuration files from the data drive, and PowerShell made that very easy for me. When I tried to import the VM’s using PowerShell the below error was given. 




As per the Powershell, output suggested I tried using Compare-VM to figure out the issue and the result was pointing to missing Virtual Hard disk file , please see the below screenshot.







So the problem is the Virtual Disk files are in different locations and our new Host server is unable to locate them to import the VM and here is the solution. (https://blogs.msdn.microsoft.com/virtual_pc_guy/2014/04/14/importing-a-vm-with-vhds-in-different-paths/)
So I've performed the below steps to correct this issue and then import the VM's using Import command. 
1. Look at .Source.Path on each incompatibility to determine which virtual hard disk is missing




2. Use Set-VMHardDiskDrive to correct the location for the first virtual hard disk:


3. Finally, we need to import the VM with the corrected virtual machine compatibility report.







x




 









No comments:

Post a Comment