VMware Cloud Community
Albatross1
Contributor
Contributor
Jump to solution

CPU Usage per VM

Is it possible to select a datacenter in the Admin UI, and get CPU Usage in MHz per VM in that datacenter?

I can get the total MHz used on the entire datacenter, but how do I see the average CPU usage (MHz) per VM in that datacenter?  Does this require the Custom UI?

0 Kudos
1 Solution

Accepted Solutions
mark_j
Virtuoso
Virtuoso
Jump to solution

The SM you created is grabbing the avg of ALL VMs in your datacenter. So, every VM that is powered on is getting sumed, then divided by the power-on vm count... in other words the avg.

So if you had:

VM1: 500mhz

VM2:1000mhz

VM3:1500mhz

.... the SM would calc an avg of 1000mhz.

How about you visual the supermetric and send us a screenshot of the supermetric editor showing the graph on the bottom over the past few days?

If you find this or any other answer useful please mark the answer as correct or helpful.

View solution in original post

0 Kudos
7 Replies
mark_j
Virtuoso
Virtuoso
Jump to solution

You can get avg provisioned CPU capacity (mhz)per running vm at the Cluster level, but it sounds like you're more interested in consumption that provisioned capacity. You can also view the avg vm profiles (small, medium, large) using the vCOps cap planning views.

I would just create a supermetric to get the avgN of the CPU Demand Mhz from the VMs under a datacenter. This is accomplished using the Custom UI.

If you find this or any other answer useful please mark the answer as correct or helpful.
Albatross1
Contributor
Contributor
Jump to solution

Can you confirm this is correct?

The datacenter I want to report on is called

“Datacenter1”

I want to get Average CPU Demand (MHz) per VM across all VMs in the datacenter for the last 30 days.

Meaning this:

the VM called vCenter .125” averaged 2Ghz of CPU Demand

the VM called “VCSA .126” averaged 4GHz of CPU Demand

the vCOps vApp averaged 6GHz of CPU Demand

Then my average for all VMs in the datacenter would be 4GHz per VM.

Here is what my inventory looks like.

vCenter.jpg

I go to create my supermetric:

SuperMetricCreation.jpg

  1. Do I select CPU Demand from the “Metrics” column on the left or from the “Attribute Kinds” column on the right?
  2. Given the inventory screenshot from vCenter Server above, given the "datacenter" is the resource I'm reporting on,  what is the value I should put after the comma in the formula - should it be 3?  This is the formula I have:

     avgN($R40:M609,3)

  R40 is the resource ID for my datacenter called "datacenter1"

  M609 is the metric ID for the Demand (MHz)

     

   3. Should I then associate this supermetric now with an attribute package?

   4.  When Demand Mhz is calculated, is it calculating the demand of virtual machines as opposed to ESXi hosts?

0 Kudos
mark_j
Virtuoso
Virtuoso
Jump to solution

Q1: Do I select CPU Demand from the “Metrics” column on the left or from the “Attribute Kinds” column on the right?

A1: Use ResourceKinds and Attributes, which will appear as $RK## and A##### in the formula bar.

Q2: Given the inventory screenshot from vCenter Server above, given the "datacenter" is the resource I'm reporting on,  what is the value I should put after the comma in the formula - should it be 3?  This is the formula I have:

     avgN($R40:M609,3)

  R40 is the resource ID for my datacenter called "datacenter1"

  M609 is the metric ID for the Demand (MHz)

A2: vCenter > Datacenter > Cluster > Host > VM > Datastore. So, avgN( $RK##:A###  ,3)

     

Q3: Should I then associate this supermetric now with an attribute package?

A3: Add the supermetric to a supermetric package. Then assign that supermetric package to the resources (datacenters, specifically).

 

Q4: When Demand Mhz is calculated, is it calculating the demand of virtual machines as opposed to ESXi hosts?

A4: It's calculating the CPU Demand (Mhz) of the VM.

If you find this or any other answer useful please mark the answer as correct or helpful.
Albatross1
Contributor
Contributor
Jump to solution

OK thanks.  What is happening is this:

Created the formula:

avgN(rk##:a####,3)

Added it to a package

Applied package to the datacenter resource

Viewed the supermetric package in a "Metric Graph" widget.

Result:

Each of the 4 test VMs shows an average of less than 400 Mhz of CPU usage in vSphere Client

in vCOPs, my supermetric package is reporting an average of around 1200MHz.

Meaning this:

vCOPs is not giving me my average per VM, it is giving me the average of the entire set of VMS in the datacenter over the selected time period.

How can I fix this?


0 Kudos
achvn
Enthusiast
Enthusiast
Jump to solution

Hi,

I'm OO0, with no access to my emails and will be back on thursday the 24th of October.

Thank you,

Best Regards,

Alexis

0 Kudos
mark_j
Virtuoso
Virtuoso
Jump to solution

The SM you created is grabbing the avg of ALL VMs in your datacenter. So, every VM that is powered on is getting sumed, then divided by the power-on vm count... in other words the avg.

So if you had:

VM1: 500mhz

VM2:1000mhz

VM3:1500mhz

.... the SM would calc an avg of 1000mhz.

How about you visual the supermetric and send us a screenshot of the supermetric editor showing the graph on the bottom over the past few days?

If you find this or any other answer useful please mark the answer as correct or helpful.
0 Kudos
Albatross1
Contributor
Contributor
Jump to solution

Actually it was being summed, but was not being divided by the powered-on count.  So I modified it to divide by the powered on count.

(avgN($R40:A2055,3)  / avg($R40:A2030))

This seems to give me the correct numbers.

However,it seems I shouldn't have to create a manual division to get the right numbers.

I'll give a "correct" though and close this out and Open up a new discussion on this point.

https://communities.vmware.com/thread/460733

0 Kudos