Part 1: http://myitforum.com/cs2/blogs/mclanem/archive/2011/04/25/scom-virtualization-candidates-report-with-hp-servers-part-1.asp
The problem re-explained:
A few months ago, I found that no matter what parameters I used I received no results when trying to run the Virtualization Candidates report in SCOM. After digging deeper into the issue I found that the "Virtual Machine" property on all of my HP servers was NULL. The problem was that the discovery used the Win32_BaseBoard class which doesn't exist on HP servers so when the discovery ran, it returned an instead of returning true or false. I used a custom management pack to change the discovery to that it would look in Win32_ComputerSystem instead, fixing this issue. Unfortunately, I found that correcting the issues with the Virtual Machine property didn't fix the Virtualization Candidates report.
The investigation continues
At this point I took the problem to Microsoft. Working with one of their support engineers we found that the Virtualization report doesn't really rely on this property. The Microsoft System Center Virtual Machine Manager 2008 R2 management pack creates a new object. When I navigate to Discovered Inventory and change the target type to Virtualization Candidate computer I again get no results. The reason for this is the same as the IsVirtualMachine property. The script used to create this object looks in Win32_BaseBoard for the manufacturer property. Since HP servers don't have this class, the script errors out and the object doesn't get created.
Unfortunately this is a sealed MP. I asked the support engineer if we could get the team who originally wrote the MP to change it from Win32_BaseBoard to Win32_ComputerSystem but was told that they didn't see it as broken because it only effects a specific set of servers. I guess they are OK with their MP not working for an entire hardware vendor.
Instead we set out to edit the MP ourselves.
This approach failed.. multiple times. The reason it failed has to do with the way Microsoft made this MP available. It isn't available thought the normal MP catalog. Instead you have to run an installer from the VMM installation media. If you try to import the customized MP SCOM complains that there is already a version installed and it fails to import. I did try uninstalling the MP (which was a pain because there were a number of dependencies) and I was finally able to install the customized MP, but then when I ran the installer on the VMM installation media (to get the dependencies reinstalled) if failed saying it was already installed. At this point I got really frustrated because this was really the only approach the Microsoft support engineer wanted to take. Here is what I did on my own to fix the problem.
Create a Custom MOF
I created a custom MOF which would fill in the Win32_Baseboard field and thus make everything work as it is suppose to.
- Save this file HP_BaseBoard.txt
- Rename it HP_BaseBoard.mof
- Run the following command from an elevated CMD prompt mofcomp.exe [path]\HP_BaseBoard.mof
How simple. Why didn't I think of this before. I guess its because I haven't ever really changed WMI before so it really isn't in my toolbox of tricks. Sure we edited the mof for SCCM, but for some reason that was different.
OK. I actually I went a few steps further to get this deployed in my environment. I wrote a vbscript that will compare the Win32_ComputerSystem Manufacturer key with that of the Win32_BaseBoard key on HP systems. If they are not equal the script will run the mofcomp command and log the results in the Event log otherwise it will exit. This script will then set via group policy on our server OU. This way any future servers will get the required key even if they are not built using our automated solution.
Feel free to have a look the SetBaseBoard.vbs script here: SetBaseBoard.txt You need to also have the HP_BaseBoard.mof file linked above.
To verify that things are working do the following:
- Within the SCOM Console Navigate to the Monitoring Pane
- Select the Discovered Inventory node under Monitoring
- Click Change Target Type under Actions
- Enter Candidate under looking for and select the Virtualization Candidate Computer from the System Center Virtual Machine Manager 2008 R2 MP. (There is probably more then one)
- You should see any computers that may be virtualization candidates listed.
Give it a little time for SCOM to catch up, but the Virtualization Candidates report will now start to have results.