none
Hyper-v and physical cpu processor affinity

    Question

  •  

    Is there any options to set physical cpu processor affinity for virtual machine like in ESX?

    If that can be done, Microsoft did a very good job.

     

    Thank you! 

    Monday, February 18, 2008 7:11 PM

Answers

  • I am not sure you will need anything if we did our job right J.  It seems like your concern is that each VM get’s equal CPU time.  Hyper-V’s scheduler is designed to accomplish just this, each VM should be given equal CPU time when required i.e. if all 6 of your VM’s are under load than each VM should get 16.666% CPU time on the host, but if 1 VM is completely idle than each VM should get 20% until that VM gets load…

     

    If you want guarantees you can use reserves, caps and weight’s.  This will allow you to set guarantee CPU time for each VM, or set VM priorities, or set maximum CPU time for each VM.  So given your scenario you could set each VM to have a 16% reserve which would allow a highly used VM to “borrow” time from an idle VM.  Or you could set a cap (limit) of 16% which would not allow any VM to use more than 16%.  Or you could use weight’s to allow a more critical VM to get more CPU time than a less critical VM…

     

    Tuesday, February 19, 2008 5:17 PM

All replies

  • No.  We allow you to specify a reserve, cap and relative weight for each virtual machine.  Do you have a specific scenario that cannot be addressed with these options?

     

    Cheers,

    Ben

    Monday, February 18, 2008 8:37 PM
    Owner
  • Hm...I don't know...

    We are considering to build a new Exchange architecture with Exchange 2007 CCR cluster spread between two geographic locations...there are going to be two clusters, one for each AD site, and in each AD site there are going to be two HUB/CAS roles....and host hardware is HP DL585, 4 dual core processors AMD, 64GB of RAM and fiber channel storage 4TB Clarion. Every exchange role, including cluster nodes is going to be virtualized with server 2008 hyper-V, in each host about 6 machines. In each clustered mailbox role about 800 users. So, I would feel better If I could set processor affinity for eac VM.

    You think it's going to work?

    Tuesday, February 19, 2008 7:15 AM
  • I am not sure you will need anything if we did our job right J.  It seems like your concern is that each VM get’s equal CPU time.  Hyper-V’s scheduler is designed to accomplish just this, each VM should be given equal CPU time when required i.e. if all 6 of your VM’s are under load than each VM should get 16.666% CPU time on the host, but if 1 VM is completely idle than each VM should get 20% until that VM gets load…

     

    If you want guarantees you can use reserves, caps and weight’s.  This will allow you to set guarantee CPU time for each VM, or set VM priorities, or set maximum CPU time for each VM.  So given your scenario you could set each VM to have a 16% reserve which would allow a highly used VM to “borrow” time from an idle VM.  Or you could set a cap (limit) of 16% which would not allow any VM to use more than 16%.  Or you could use weight’s to allow a more critical VM to get more CPU time than a less critical VM…

     

    Tuesday, February 19, 2008 5:17 PM
  • I'm running Virtual Server 2005 R2 on a machine with 8 logical processors (dual quad core).  Also running Terminal Services inside a virtual machine.  When a user opens a large excel file, it spikes one of the 8 logical processors and does not carry over to any of the 7 relatively unused processors.  I have relative weight options set for everything having a value of 100, except the terminal server has a value of 200.  Not sure what else I can do.  How do I get it to use more of the logical processors?

     

    Dan McGlade

    Tuesday, April 15, 2008 6:10 PM
  • You should see the exact same behavior on hardware as the Application that is causing the issue is not multi threaded.

     

    The hitch is that you will see the spiking happen with fewer users on the TS server when it is virtualized.

     

    These processor settings cannot change the behavior of the applications running within the virtual machines, it just makes sure that each VM gets its share of the overall available resources.

     

    In your case the most that you could expect is to shorten the duration of the processor spiking by altering these settings, not prevent it.

     

     

    Tuesday, April 15, 2008 6:51 PM
    Moderator
  • Actually your spiking CPU problem has more to do with Virtual Server 2005, which only allocates a single processor to each VM.  Therefore all threads from the VM come to the host as a single thread.  Hyper-V allows each VM to have multiple virtual CPUs, depending upon the OS in the virtual machine.  Hyper-V should work much better to help eliviate the CPU spike bottlenecks you are referring to.

    Shane Cribbs
    www.georgiatechnologies.com
    Monday, August 25, 2008 2:35 PM
  • I agree that cpu affinity should not be assigned as a permanent configuration. however vmware use it as a "what-if" scenario. eg: as I am setting up my virtual environment I want to verify that under heavy load my critical servers can accommodate the performance hit, so I assign Shares, limits and reservations. Now I want to verify my settings so I assign cpu affinity to my cpu intensive machines and "hammer" the processor for the vms to verify that my configuration will the accommodate the critical vms performance while not constricting the other vms. After that change it back to no affinity.

    Friday, May 29, 2009 12:02 AM