Scott Drummonds has discovered a problem where the ESX Perfmon counters he added to vSphere 4.0 virtual machines were not disappearing in Windows virtual machines as of vSphere 4.0 U1.

It turns out this problem stems from an issue with mofcomp. The workaround is to manually uninstall and then reinstall VMware Tools. It also appears that the counters can be added by running vmStatsProvider, as described in Scott’s previous article: http://vpivot.com/2009/09/17/using-perfmon-for-accurate-esx-performance-counters/
mofcomp is a tool provided by Microsoft and integrated with Windows that is used to register WMI classes such as VMware’s Perfmon counters with Windows. mofcomp is failing during the tools upgrade on some systems for currently “unknown” reasons.
A reinstall/upgrade/repair of VMware Tools will force a rerun of mofcomp and register the classes. But the tools installer is not configured to do this today as a mofcomp failure was not anticipated by the developers that wrote the VMware Tools installer.
The key to the fix is to force mofcomp to run a second time. This can be done in two ways:
* Uninstall VMware Tools and then reinstall them. Unlike a reinstall (also called a “repair” or “upgrade”) this will force mofcomp to be run during the second install. It should work the second time.
* Install the counters using the vmStatsProvider executable
Article content sourced from vpivot.com

