none
Hyper-V R2 VM CPU Limits

    Question

  • I have a Windows Server 2008 R2 box with the Hyper-V role. The machine has dual quad core Xeon X5500 chips. Since the X5500 series has hyper threading, this shows up as 16 cores.

    Most of the time, I want the various VMs on the machine to share the server resources. Sometimes, however, I use this machine for performance testing CPU heavy applications. In those scenarios, I want to grant 90%+ of the machine's resource to a single VM.

    As far as I can tell, that's not possible. Since Hyper-V only supports granting VM access to a max of 4 logical processors, the most I can ever give an individual VM is 25% of the total server resources. That's because the server thinks it has 16 cores, an 4/16 = 25%.

    It seems to me that this is a huge limitation of Hyper-V. Is there a work around? Is there no way to use the full horsepower of the machine from inside a VM?
    Friday, March 12, 2010 7:16 PM

Answers

  • Hiya,

    That is true, all tho HyperV is still a fairly new product, people tend to forget that - looking at ESX server, which has had quite some time out there is running 8 cores per virtual machine as max. (a number that might be real or they could be holding back as MS still "only" have 4)


    The calculation is always based on what workload your applications doing - If your application requires more than 4 cores you dont virtualize with HyperV - if your workload require more than 8 cores, you dont virtualize with VMware. (Obviously that is somewhat black/white stated, it doesnt change the fact that the virtualization road should always be considered and not blindly followed)


    And yes it is indeed very limiting and it is a fact that most people overlook when virtualizing. Its all about expectations, expectations and expectations :)
    Monday, March 15, 2010 3:45 PM

All replies

  • You can only allocate a maximum of 4 virtual CPUs to a VM.  I am not aware of nor think there is any work around for adding addtional Virtual CPUs to a VM.
    Sunday, March 14, 2010 6:02 PM
  • I know I can only allocate 4 CPUs to a VM. I stated that in my question.

    My question was whether or not my conclusions about that fact are correct, and if they are, are there any work arounds that that VMs utilize more than 25% of the total CPU power of the host machine.
    Sunday, March 14, 2010 9:31 PM
  • Think the only way would be to turn off Hyper-Threading on the Host CPUs so you are only presenting 8 CPUs on the host and then the VM with 4 virtual CPUs would have 50% of the allocated CPU cycles.
    Monday, March 15, 2010 2:41 PM
  • Hiya,

    What is it exactly your asking?

    Yes 4 virtual CPUs is 25% of your maximum number, if running hyperthreading.

    It would be the same situation if you had more physical CPUs. HyperVs hard limit is currently 4 Virtual CPUs, even if your HyperV host would be the mother of all with zillion CPU's....

    Virtual CPUs a basically relating to cores and if your application benifts from running hyperthreading, then you leave it at that.


    So on a 128 core host, each child will not be able to utilize much in %%, however on a 2 core host its a bit more :)

    Monday, March 15, 2010 3:02 PM
  • I guess I'm just a bit shocked at the fact that this limitation exists. Even with hyper threading disabling, never being able to use more than 50% of a machine's resources, regardless of the load on the VM, seems very limiting.

    And this problem is just going to get a lot worse. We already have 6 core CPUs coming out, with 8 core on the horizon. Since most of the speed enhancements in today's CPUs come not from clock speed but from multiple cores on the same chip, Hyper-V will fall further and further behind.
    Monday, March 15, 2010 3:17 PM
  • Hiya,

    That is true, all tho HyperV is still a fairly new product, people tend to forget that - looking at ESX server, which has had quite some time out there is running 8 cores per virtual machine as max. (a number that might be real or they could be holding back as MS still "only" have 4)


    The calculation is always based on what workload your applications doing - If your application requires more than 4 cores you dont virtualize with HyperV - if your workload require more than 8 cores, you dont virtualize with VMware. (Obviously that is somewhat black/white stated, it doesnt change the fact that the virtualization road should always be considered and not blindly followed)


    And yes it is indeed very limiting and it is a fact that most people overlook when virtualizing. Its all about expectations, expectations and expectations :)
    Monday, March 15, 2010 3:45 PM
  • For what it worth Sun Virtual Box 3.0 will support 32 vitrual cpu per Vm
    Thursday, April 08, 2010 4:14 AM
  • Well, besides the fact that up tp 8 cores can be allocated per VM in VMWare ESX4, there is a provision to allocate CPU resource shares in %age . So like you may allocate a particular VM running on a host 80% CPU shares and may allocate 30% or more/less to others. This shares allocation will not actually affect the VM's performance, unless resources on the host are scarce and there is a competition for resources.

    In case there arises a compitition on the host resources, the VM's will get CPU shares as defined in the resource share allocation.

     


    Technology Evangelist
    Saturday, May 01, 2010 1:34 PM
  • See my blog posted on Hyper-V Limits for Physical and Virtual Machines:

    http://blogs.technet.com/ranjanajain/archive/2010/05/03/hyper-v-capabilities-limits-for-virtual-and-physical-machines.aspx 

     


    Technology Evangelist
    Monday, May 03, 2010 5:24 PM
  • Virtual Box from Oracle handles all 16..:)  thank them guys at SUN..

     

    http://www.virtualbox.org/

     

    I was hoping to replace sun with Hyper -v  guess that ain't happening.. to bad.. Microsoft let me down  AGAIN

    Wednesday, June 08, 2011 1:54 AM
  • In VM's config file section:

     

    <processors>
    <count type=”integer”>8</count><features>
    <limit type=”bool”>False</limit>
    </features>
    <limit type=”integer”>100000</limit>
    <limit_cpuid type=”bool”>False</limit_cpuid>
    <reservation type=”integer”>0</reservation>
    <weight type=”integer”>100</weight>
    </processors>


    Now you have 8 core CPU. 

    Friday, August 19, 2011 11:39 AM
  • Show Emin!! You are the guy!!!
    Monday, August 22, 2011 9:55 PM
  • Just to add to the conversation:

    You can as indicated edit your config file to add more CPUs - looking in the GUI in Hyper-V manager you will also see that 8 CPUs are now assigned to the guest. From the GUI you are now able to reduce the no. of CPUs (i.e. from 8 go to 7, 6, 5 etc.), but once reduced you can not add them back unless you edit the config file again.

    The main thing to remember here is, that editing the config file like that is NOT a supported scenario - if you need MS help you will have to reduce the no. of CPUs to a supported number (and reproduce the error) before they can help you.

    Another solution would be to await the next release of Windows server - it may improve on the max CPU count for guests (mind you: I have no knowledge of the next version of Windows apart from the Win8 GUI demonstrations available all over the internet, so this is purely guessing on my part)

     

    BR,

    Nordmann

    Thursday, August 25, 2011 9:06 AM
  • @N0rdmann.

    Try and write the number 200 and see what happends.. (PS: Dont do this on a production machine) :)

    Spoiler: It will display 200 Virtual Processors and you will be able to "count down" from 200....

    @Emin

    That is simply not correct. Changing the CPU limit in the config file, will change the display in the GUI, but will most likely make your virtual machine crash.


    Friday, August 26, 2011 6:55 AM
  • Funny, I tried that before I found this article.  It didn't work for me though, it changed the number in the VM settings back to 2 :(
    Tuesday, October 18, 2011 4:53 PM
  • In VM's config file section:

    <processors>
    <count type=”integer”>8</count><features>
    <limit type=”bool”>False</limit>
    </features>
    <limit type=”integer”>100000</limit>
    <limit_cpuid type=”bool”>False</limit_cpuid>
    <reservation type=”integer”>0</reservation>
    <weight type=”integer”>100</weight>
    </processors>


    Now you have 8 core CPU. 

    Thanks worked great!
    • Proposed as answer by ShahinKohan Friday, January 25, 2013 6:22 AM
    • Unproposed as answer by ShahinKohan Friday, January 25, 2013 6:23 AM
    Tuesday, February 14, 2012 4:02 PM
  • How do you edit the XML file?  It says its in use by another process even if you shut down both the machine and the hyper-v service.

    thanks


    • Edited by 312Tech Tuesday, February 21, 2012 12:13 AM
    Tuesday, February 21, 2012 12:12 AM
  • After you shutdown all the virtual machines, in the right of the hyperv console in the actions pane click "stop service". this will allow you to edit the config file.


    Dan Novak

    Thursday, February 23, 2012 2:02 PM
  • How many procs show up in Task Manager on the VM after you change it to 8?

    • Proposed as answer by David Wichert Thursday, February 25, 2016 1:14 PM
    Friday, February 24, 2012 7:02 PM
  • We've done this.  I haven't seen a downside yet.  8 cpu's show up in task manager in the guest cpu after doing this (sometimes the VM wants a reboot after the initial boot from 4-->8 cpus).  

    Being paranoid I tested using prime95 on all 8 cores within the VM.  It uses all 8 - so it appears.  Checked the prefmon on the hyper visor and it seems to think its using 100% of the cpu under Hyper-v Hypervisor Logical Processor.  

    This hypervisor has 8 cores  (2x quad - no hyper threading)

    Tested prime 95 with 4 cpus in the VM  =  50% usage on the hypervisor

    Tested prime 95 with 8 cpus in the VM  =  100% usage on the hypervisor

    As far as I can tell - this method allows use of all cpu's on the hypervisor...

    Wednesday, March 07, 2012 8:13 PM
  • Hi guys very interesting, I run a network of 15 servers for my company and have about 800 VPS/RDPs I would be very interested if you could tell me where to edit this XML file. I have been looking everywhere for it.

    Thanks

    Sunday, March 11, 2012 7:15 PM
  • Found it Nevermind.

    it's in programfiles/windows/microsoft/hyperV

    Monday, March 12, 2012 9:27 PM
  • Managed to edit the config file but the edited vm, you cannot access its properties using SCVMM 2008 R2, it crashes but everything else is ok. Tried it on an IBM blade, now my VM has 24cores.
    Tuesday, March 13, 2012 4:27 PM
  • that would be programdata, not program files, and you have to set your folder options to show hidden operating system files.  But other than that, I'll give it a try...

    Thursday, July 26, 2012 3:43 PM