VMware vSphere

 View Only
  • 1.  Isolating a processor core

    Posted Jan 12, 2011 02:20 AM

    Is it possible to dedicate an entire processor core to a virtual machine?  With processor affinity, I dedicate a virtual machine to a processor core.  That VM can only run on the core that it has affinity with.  However, other vms can still run on that core.  How can I isolate an entire processor core to be used by one and only one virtual machine?  The other processor cores should be free to run any of a large number of virtual machines - so using processor affinity for all vms so that one vm can have its own core is not an option.  I just need to dedicate one core to one vm and keep every other vm from accessing it.

    (Note - this is all terrible design and not best practice which I realize - it is beyond my control to say how done but need to know if it is theoretically possible)

    Thanks for input



  • 2.  RE: Isolating a processor core

    Posted Jan 12, 2011 04:35 AM

    You can, by using CPU-affinity.

    But don't do it, cause it will likely offer performance decrease than increase if thats your main goal.

    Read this article and you know which elements to configure.

    http://frankdenneman.nl/2011/01/beating-a-dead-horse-using-cpu-affinity/

    Frank Denneman

    co author of: vSphere 4.1 HA and DRS Technical Deepdive - out now on Amazon



  • 3.  RE: Isolating a processor core

    Posted Jan 12, 2011 05:32 AM

    Great article - and from what I see the only way to isolate a core to one and only one virtual machine is to set CPU affinity on EVERY OTHER vm on that host - even everything that can be done with reservations and shares will not necessarily create that result.



  • 4.  RE: Isolating a processor core
    Best Answer

    Posted Jan 12, 2011 09:26 AM

    You are correct. But do not forget every vCPU will be scheduled according to the rules of the CPU scheduler.

    That means:

    • 1 vCPU per pCPU
    • Timeslicing for fairness principle, even if you isolate a pCPU. so a vCPU will be descheduled if it reaches the end of its timeslice, because no other vCPU run on the pCPU it will be scheduled imediately.
    • Other worlds, BHs and interrupts need to be scheduled too, so assign a second pCPU to eliminate vCPU and worlds competing for time.
    • The VMkernel uses all available pCPUs for scheduling its processes, it does not take a VM with CPU-affinity into account.

    Tip:

    • If you are running on a NUMA node, set memory affinity to avoid remote memory.
    • "De-assign" the second pCPU on all other virtual machines as well, because the CPU-scheduler can (most unlike, but there is no guarantee) migrate the vCPU thread to the other processor for load-balancing purposes.

    Frank Denneman

    co author of: vSphere 4.1 HA and DRS Technical Deepdive - out now on Amazon



  • 5.  RE: Isolating a processor core

    Posted Jan 30, 2011 02:33 AM

    OK thanks again