SCVMM: Install VM components Failed

SCVMM: Install VM components Failed

2013-05-31
/ / /

I’m attempting to deploy a virtual machine from a template but I get this error: Install VM components: Failed.

 

 

TL;DR
SO…  Long story short; if you are encountering this error, I would suggest booting your VHD file in a VM and re-sysprep /generalize it.  If you’ve maxed out on sysprep’s I have a post earlier in my blog on how to get around the 3-times limit and rerun sysprep.  Alternatively, you can try what I did, but I can’t gaurantee your success and replace the BCD file in your Library VHD with a BCD you *know* has been sysprepp’ed and try redeploying it.
=————————————————————————————————=

I’ve ensured that HTTP and HTTPS is not blocked (firewall is disabled) and the agent on my SCVMM machine is installed and running.  So this error message is somewhat useless.

So I took my two boxes, 2012-SCVMM (the SCVMM server) and S5000VXN-SERVER (the Hyper-V host) and procmon’ed them while it was attempting to “Install VM Components” to try and understand what it’s trying to do.

After reinitating the task, we can see that the vmmAgent.exe on the Hyper-V host accesses the file about 2 seconds after I submit the command to retry the job.

A few seconds after this, it appears to “CreateFile” in the WindowsTemp directory; but this is not actually correct.

What it is really doing is *mounting* the VHD into a folder in the WindowsTemp directory.  You can actually watch this in action if you view Disk Management on the Hyper-V host while you execute the task.

So now that we know it’s mounting the file as a volume this helps us narrow down on what Hyper-V is attempting to do…  And I suspect what it is attempting to do is “offline servicing” of the attached vdisk/vhd.

After attaching the vdisk the next thing it does it query the BCD file on the system.  Maybe it needs to be in a certain mode to operate?  I’m not sure…

Continuing on we can see that events are written to the Microsoft-Windows-FileShareShadowCopyProvider Operational.evtx, System.evtx, and Microsoft-Windows-Bits-CompactServer Operational.evtx event logs.  Examining each log at the time stamp showed the FileShareShadowCopyProvider and System log were just noticed of volume shadow copy starting, but the BITS event log was interesting.

 

 

It showed that it was doing something with the BCD file.  The Hyper-V host was *serving* it out.  I suspect it was serving it to the SCVMM.
Looking back at the SCVMM server we see that was executing some WinRM commands.  Sadly, we do not know what commands it was trying to send.

If I mount the vhd file and check out the BCD file I can see that it appears to be corrupted in that it doesn’t know what the proper boot device should be.

 

It’s not actually corrupted though; the reason why the devices are unknown is because bcdedit isn’t finding the disk signature of the volume I mounted.  But it has the disk signature because I can boot with it without issue.

Continuing on…

In order to try and find out what commands WSMAN was sending I enabled debugview on the SCVMM server:
http://support.microsoft.com/kb/970066?wa=wsignin1.0

I then reproduced the error by rerunning the Create Virtual Machine job.

DebugView gave me more information to narrow down what was happening.  It appears that the process is failing with:


Doing some googling on this took me to a Korean Microsoft page where the following was stated:
http://social.technet.microsoft.com/Forums/ko-KR/momsmsmofko/thread/fedbc514-1fc0-4b55-979b-7d07babb074b/

http://blogs.technet.com/b/hectorl/archive/2008/08/21/digging-deeper-into-error-13206-virtual-machine-manager-cannot-locate-the-boot-or-system-volume-on-virtual-machine.aspx

Thinking about it, I do not think my VHD was SysPrep’ed.  I find it interesting that sysprep appears to do something to the BCD file.  To find out what sysprep does to the BCD file I booted up my 2012 VHD into Windows and ran sysprep, generalize and shutdown.

And……….?  Lets go to DebugView:


 



Voila!  It appears much better than before.  It found the drive correctly and checked the BCD file and found it is the “Generalize” state.  The *actual* image I originally made was NOT sysprep’ed and all I did was replace the BCD file, but it allowed it to continue beyond and the machine actually completed the imaging process properly.  It joined the domain and whatever else the answer file was I gave it in SCVMM.

It appears I was correct in my earlier assumption about what SCVMM is doing.  It goes and grabs the BCD file and transfers it from the target machine to itself, “fixes it up” (not sure what it’s doing at this stage precisely), then sends it back for injection.  Certainly a bit of a complicated process with a fair bit that can go wrong, but shame on Microsoft for having such a poor error message.  I suspect it wouldn’t have required much effort to push out a real message; something to the effect of, “The BCD of this vDisk does not appear to have been through the sysprep /generalize process.  Please rerun sysprep against the image and try again”.

SO…  Long story short; if you are encountering this error, I would suggest booting your VHD file in a VM and re-sysprep /generalize it.  If you’ve maxed out on sysprep’s I have a post earlier in my blog on how to get around the 3-times limit and rerun sysprep.  Alternatively, you can try what I did, but I can’t gaurantee your success and replace the BCD file in your Library VHD with a BCD you *know* has been sysprepp’ed and try redeploying it.

One Comment

  1. Anonymous 2015-04-17 5:45 am

    I´m having the exact same error but not for the OS disk. The error only occurs when I try to add an empty VHDX-file as a secondary data disk in the hardware profile. Tried different data disks here.

    Any thoughts on this?

    Reply

Post a Comment

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.