NSX Edge CPU usage Super Metric for vRops

Recently we migrated 1000’s of servers to multiple 4 vCPU ESG’s… after cutting over gateways from legacy physical devices we started to get 100% CPU usage alerts (ahhh!!) when SSHing to the edge we would only see 2-3% CPU usage being reported in the console (ehh???) after lots of head scratching, talking to GSS they confirmed this is a known issue with ESG’s… Long story short using esxtop we can determine the actual usage see: KB2137685

So for those of you fortunate enough to have experienced this issue, freaked out and then come to the realisation that vCenter & vRops is miss reporting CPU usage for the edges this article is for you… I wanted to track the CPU usage over time & possibly alert on “real” high usage so I built a super metric for vRops and applied it only to our ESG’s.

A breakdown… after looking at the individual core mhz usage values in vRops and the values in esxtop… I determined that the values in vRops were accurate and I could calculate the average CPU usage % observed in esxtop for the VM on ESG’s up to 4vCPU’s. NOTE that on an X-Large Edge, the last two vCPUs are reserved for encryption, load balancing and management function, meaning their % used may be very low compared to the other 4 vCPUs so the 1st super metric example I provide for a X-Large ESG only considers the CPU load on vCPU 0-3 and the 2nd includes all 6 vCPU’s you pick or use them both…

Here is the ESG super metric for vRops, after creating it don’t forget to assign it to the “Virtual Machine” resource kind and then enable it in your ESG specific policy.