Wednesday, May 14, 2008 7:18 PM
by
mattmcspirit
Applying a 'Hyper-V Enabled' Image to a Physical Machine...
How do you deploy Windows Server? With Windows Server 2008, I typically install from the DVD, then, once complete, I connect to Windows Update, get the latest patches, then, I'll typically enable the Hyper-V role in Server Manager, reboot the machine, and then, and only then, I'm good to go with my 'Hyper-V Enabled' Windows Server 2008 machine.
OK, so that process, typically, would have taken about 30-45 minutes. What I could then do, before creating any Virtual Machines, is Sysprep the Operating System, then use a technology such as ImageX, or Ghost, to capture an image of my 'Hyper-V Enabled' Windows Server 2008 OS. This image could then be deployed onto another piece of hardware, and in theory, after applying that image, when I boot up Windows Server 2008, I should just be able to start creating Virtual Machines, as Hyper-V was already enabled in the image, right?
Wrong.
Doesn't quite work like that. Think about it, when you first install Windows Server 2008 (onto the hardware), the boot configuration datastore is created and updated etc, and then the OS boots for the first time. When you enable Hyper-V, you are placing a hypervisor between the OS and the hardware, so the boot configuration datastore is updated accordingly, so that when you boot this OS subsequently, the hypervisor starts automatically, and you can happily create virtual machines.
If you are applying a 'Hyper-V Enabled' image, you are laying down the OS, and the hypervisor layer in one go, so you have to execute a short script from the command line (or include it in your unattend file as a post installation script) to update the boot configuration datastore. The script is:
Bcdedit /set hypervisorlaunchtype auto
That's it! So, when you subsequently boot that OS, the hypervisor is correctly set up to run (providing the hardware you have applied the image to has Intel-VT or AMD-V, and DEP/Disable Execute Bit enabled).
I'm sure this will be listed in the final documentation, but at least now you know! It caused much head scratching with myself and a customer a few days back!