Mark Minasi's Tech Forum
Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Pieter

Avatar / Picture

Senior Member
Registered:
Posts: 161
Reply with quote  #1 

Are these statements about Hyper-V and virtual CPU's correct ?

1. It is possible to overcommit vCPU's.
2. If the host has 16 cores and the VM is allocated 4 vCPU's that does not mean the VM gets 4 physical cores.
3. If there are only 2 VM's and they both are allocated 3 vCPU's, that means they both will be served equally the same amount of time by the physical CPU('s) : 50-50 % ratio.
4. If there are only 2 VM's and one is assigned 3 vCPU's and the other 6 vCPU's, that means the first one will get half as much physical CPU time as the second one : 1/3 - 2/3 ratio.
5. On a host with 16 cores and two VM's, if the two VM's are both allocated 20 vCPU's, that means they both will be served equally the same amount time by the physical CPU : 50-50 % ratio.

Conclusion: vCPU assigned is relative to all the other VM's on the host.


__________________
Pieter Demeulemeester
0
cj_berlin

Avatar / Picture

Senior Member
Registered:
Posts: 244
Reply with quote  #2 
Quote:
Originally Posted by Pieter

Are these statements about Hyper-V and virtual CPU's correct ?

1. It is possible to overcommit vCPU's.


Yes. But not in the sense you formulated in your Question #5 [wink]

Quote:
Originally Posted by Pieter

2. If the host has 16 cores and the VM is allocated 4 vCPU's that does not mean the VM gets 4 physical cores.

Depends on your definition of "get". Every time the VM is given CPU at all, it can exclusively utilize 4 physical cores. Those cores are not assigned to the VM all of the time, unless you make a 100% reservation. For exactly how long the cores are given to that particular VM, depends on the total number of vCPUs assigned to running VMs on the host.


Quote:
Originally Posted by Pieter

3. If there are only 2 VM's and they both are allocated 3 vCPU's, that means they both will be served equally the same amount of time by the physical CPU('s) : 50-50 % ratio.

If you allocate 2x3vCPUs on a host with 16 cores and there aren't any other VMs running on that host, you can safely assume that each VM will have access to 3 cores all of the time.

If the host is CPU constrained due to other VMs running on it, then yes, VMs with equal vCPU counts are going to get equal time shares.

Quote:
Originally Posted by Pieter

4. If there are only 2 VM's and one is assigned 3 vCPU's and the other 6 vCPU's, that means the first one will get half as much physical CPU time as the second one : 1/3 - 2/3 ratio.

Again, if the host is not CPU constrained, both VMs can use their respective CPU cores 100% of the time. If it is, however, you cannot assume that a VM with more vCPUs will get a higher time share. Every VM will remain in waiting state until the required number of cores can be assigned to it at the same time. Then the scheduler will let it use those cores for <however long> and then reassign them.

Quote:
Originally Posted by Pieter

5. On a host with 16 cores and two VM's, if the two VM's are both allocated 20 vCPU's, that means they both will be served equally the same amount time by the physical CPU : 50-50 % ratio.


No, none of those VMs will be able to start if it has more vCPUs than the host has cores. If by "both are allocated 20" you mean "each is allocated 10" then yes, 50-50 is correct. The game changes somewhat if you take NUMA topology into consideration but for the sake of this thread we can forget about that.

Quote:
Originally Posted by Pieter

Conclusion: vCPU assigned is relative to all the other VM's on the host.


It is "sort of correct" if the host is CPU constrained, i.e. if you indeed overcommit. If it is not, every VM can use its respective cores 100% of the time.

__________________
Evgenij Smirnov

My personal blog (German): http://www.it-pro-berlin.de/
My stuff on PSGallery: https://www.powershellgallery.com/profiles/it-pro-berlin.de/
0
Pieter

Avatar / Picture

Senior Member
Registered:
Posts: 161
Reply with quote  #3 

Thanks you very much Evgenij.
 
So, if I may resume :

6. It is possible to overcommit virtual CPU's, but per VM not more than the amount of physical cores.
On a host with 16 physical cores : 2 VM's with each 16 vCPU's is possible, but 1 VM with 17 vCPU's is not possible.

7. On a host with 16 physical cores and 2 VM's with each 5 vCPU's, both VM's gets 5 physical cores. The remaining 6 cores are not used by the VM's.

8. As long as the sum of all vCPU's of all the VM's together are not more than the amount of physical cores, each VM gets as much physical cores as defined by the vCPU.

9. If the sum of all vCPU's of all VM's together is more than the amount of physical cores, than CPU load is devided proportionally.

10. Evgenij, you rocks !



__________________
Pieter Demeulemeester
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.