Sunday, December 14, 2014

Installing an HP OEM Windows 2012 R2 Essential server as KVM Guest


I have an HP Proliant DL385p Gen8 box together with a HP/OEM installation disk of Windows Server 2012 R2 Essential.
On the iron I've installed Ubuntu Server 12.04.5 64bit plus xfce 4.1 (horrible: avoid it!) and KVM latest version available in ubuntu repository at the time of this writing (Dec2014).
The windows server is going to run as a guest over KVM. I have plenty of configurations like this perfectly working where, however, the Windows software is not OEM..
Here, a little while after the windows server installation CD boots up in the guest, it stops with the following message:"This system is not a supported platform": the hardware platform must be an HP and the actual one is not. No way.

HP supports this scenario (http://h20564.www2.hp.com/hpsc/doc/public/display?docId=emr_na-c00970200) suggesting ways for the hypervisor to pass BIOS and System information from host hardware to guests. Unfortunately KVM is not included...
Reading the redhat documentation (https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/sect-smbios-sys-info.html) helped in finding a solution:
First you need to dump the HP BIOS information by running the “dmidecode“ command, to retrieve the information you need:
# dmidecode 2.11
 SMBIOS 2.6 present.
 35 structures occupying 1145 bytes.
 Table at 0x000FB330.
Handle 0x0000, DMI type 0, 24 bytes
 BIOS Information
 Vendor: HP
 Version: A28
 Release Date: 07/12/2014
 ....
 Handle 0x0001, DMI type 1, 27 bytes
 System Information
 Manufacturer: HP
 Product Name: Proliant DL385p Gen8
 Version:
 Serial Number: 099999AB
 UUID: 1A3FD5918-FA32-56B3-8000-3A5C8B66F003
 Wake-up Type: Power Switch
 SKU Number: 947382-432
 Family:
 ...
Now just open your Guest XML file (in /etc/libvirt/qemu/) and, as per redhat instructions, into <os> tag add:
<smbios mode="sysinfo">
and then, somewhere into <domain> tag add this, with values from dmidecode output:

<sysinfo type='smbios'>
 <bios>
  <entry name='vendor'>HP</entry>
 </bios>
 <system>
  <entry name='manufacturer'>HP</entry>
  <entry name='product'>Proliant DL385p Gen8</entry>
  <entry name='serial'>099999AB</entry>
  <entry name='sku'>947382-432</entry>
  <entry name='UUID'>1A3FD5918-FA32-56B3-8000-3A5C8B66F003</entry>
 </system>
</sysinfo>
And that’s all, folks! Now just start your Guest and the Windows Server  installation should pass the HP hardware check. Please note that Windows 2008 didn't need the UUID field.