2

Primarily I have two questions relating to VMware/virtual machine's CPU usage:

  • How is it calculated?
  • Which numbers under which tabs of vCenter (vSphere client) window are referenced?

Please also clarify if my understanding summarized below is correct or not.

Q1

Please clarify if following understanding of mine is correct or not:

  1. a physical CPU is namely corresponding to 1 core (embedded in a CPU socket)
  2. a VM machine (or a guest OS) recognizes/handles its CPUs always at a virtual CPU level (a virtual CPU is noted as vCPU below).
  3. a vCPU is also called a logical CPU (or processor), a synonym to each other.
  4. When HT is NOT enabled, 1 vCPU = 1 physical CPU (or 1 core)
  5. When HT is enabled, 1 core spawns 2 threads, and 1 thread just looks like/acts as a vCPU seeing from a VM machine, in a word, 1 core provides 2 vCPUs in this case.

Q2

Calculation of CPU usage for either a VM machine, a host, or a host cluster is simple by simply working out A/B, where A - used amount, B - total capacity.

Question is: in the case of a VM machine, where to find out info of A and B? which tabs, which metrics / counters on vCenter window?

Data

Listed below are possibly relevant items (data from a real VM system), please show me which is A, which B:

Under Summary tab of a VM machine ("V-mch"):

  ** General section **
       Guest OS:     MS Windows Servers 2008
       CPUs:         2 vCPU
       Memory:       4096 MB
         .......
       Host:         "hst"

  ** Resource section **
       Consumed host CPU:      43 MHz
       Consumed host memory:   4149.00 MB
       Active guest memory:    327.00 MB

Under Summary tab of the host "hst" ("V-mch" is attached to):

  ** General section **
       Maker:              Dell Inc.
       Model:              PowerEdge M620
       CPU core:           20 CPUs x 2.199 GHz
       Processor type:     Intel(R) Xeon(R) CPU E5-2660 v2 @ 2.20 GHz

       Processor socket:   2
       Cores per socket:   10
       Logical processors: 40
       Hyper threading:    valid (enabled)

  ** Resource section **
       CPU used amount:  9016 MHz
       Capacity:         20 x 2.199 GHz

Is my following guess correct, for where information A and B is derived from?

A  -  Consumed host CPU: "43MHz"
B  -  CPUs: "2vCPU"  +  Capacity: .. "2.199GHz"

Thanks for reading through lengthy text and advising.

  • Please don’t ask multiple questions at the same time. This isn’t suitable for the Stack Exchange QA format. – Daniel B Dec 1 '16 at 11:33
0

Since Seth already answered Question 1, i'll provide an answer for #2. If you click the host or cluster in the vSphere web console you can determine the total capacity (metric B in your question) from the Summary tab. On my system it is 43.98Ghz. And If you select the virtual machine you can determine how many cycles per second of CPU it is using (metric A) from the Summary tab. On my Cisco vWLC VM it is 43 Mhz. In addition if you select the VM, click the Monitor tab, and then the CPU Usage (Mhz) graph you can see the historical CPU usage in Mhz over time. You should also be able to determine this information from querying the SQL database.

enter image description here enter image description here enter image description here

  • Thanks Fugen for replying, your answer confirmed my guess on "A" in original questions is correct: A=43MHz, while B is a biggest confusing point: you actually suggested B is the total CPU capacity of "host", which is different from what I thought it to be - I thought B should be a total amount "allocated" (to VM), and was calculated out something like: "number of vCPUs (specified at VM creation, as shown under a VM's Summary tab) x number of MHz's". – zeroflag Dec 5 '16 at 8:33
0

This question seems to be a mess and the original was copy pasted from a different format. So maybe try to improve the formatting further and try to get a clear understanding of what you're actually asking.

Question 1

  1. No. A physical CPU is a CPU with all its cores.
  2. Yes while technologies like VT could be used to give it a more direct hardware access to it.
  3. A logical CPU is a more generic term.
  4. Yes but HT is a separate technology. You can have multi CPUs per VM and multiple Cores per Socket per VM. This would be independent from the Host as far as I know.
  5. See 4.

Question 2

You'd have to decide in which relation you want to view the CPU usage. To you want the percentage of usage for the host or guest? Depending on it your B would change.

You're correct that A and B would be the numbers you need. But you could either view the CPU consumption as a total of the available power for the host or VM. B would be the number of cores times the max frequency of a core. Depending on whenever you want the information in relation to the cluster as whole or for an individual VM you would either use the number of cores of the VM or of the host. The latter might be interesting to find the VMs that cause the biggest current load on the host.

For individual VMs there is a chart available under Monitor => Performance which uses the number of cores per VM. A documentation is available for every default graph and some of the data that is being used.

For a host you can view that information on the same tab but you need to select a individual host instead of a VM. For a whole cluster it doesn't look like there is a default percentage graph but instead just a usage vs. total graph in absolute numbers (again available through the same tabs).

  • Regarding the rule of "asking one question one time", I can do next time. Even if formatting is not as good as expected, is the description of the questions not clearly? I doubt. As with your answer to Q2, please note the title on top, where I clearly stated it is CPU usage of a "VM machine" (meaning not host!). – zeroflag Dec 2 '16 at 1:12
  • The CPU usage of the VM machine is 43 MHz. You want to view this in relation to a total and that relation might either be the total CPU power of your VM or your Host. – Seth Dec 2 '16 at 6:45
  • As for your questions and their clarity: You start off with two questions, followup with a question which asks for verification of 5 sub points and after that have another question which includes two points and finally have a data chapter which again contains another question. Some of them have the same answer and some don't. Your question in the Data part would be part of your second question, probably. In addition the usage of ** show that you didn't have a look at the formatting options available. – Seth Dec 2 '16 at 6:49
  • Thanks Seth for update, but it is still not clear enough - apparently the usage I meant is a quantity as a percentage (%), that's why I stated as A/B. Now it is clear A=43MHz, but what about B? Right, B is a total amount, you added that "might either be the total CPU power of your VM or your Host", which one on earth? From Fugen's answer, this total seems to be that of "host", rather than that of "VM". – zeroflag Dec 5 '16 at 7:47
  • 1
    ==Update 2== My final goal is as Fugen mentioned, to obtain information by querying to database, and get the data exported to Excel. For that I had wanted to get a clear understanding on counters, relations, and how it is calculated etc. – zeroflag Dec 8 '16 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.