+ Reply to Thread
Results 1 to 12 of 12
  1. Senior Member paintb4707's Avatar
    Join Date
    Sep 2007
    Location
    Long Island, New York
    Posts
    421

    Certifications
    A+, Network+
    #1

    Default Choosing a CPU in ESXi?

    Hey guys,

    I have a dual Quad Core Xenon box and just loaded ESXi on it. I'm having a bit of an issue though. I can't seem to figure out how to allocate a specific physical CPU to a virtual machine. I can choose the number of CPUs and the affinity but how do you know which physical processor the virtual machine is running off of?

    Thanks in advance
    Last edited by paintb4707; 07-16-2009 at 03:29 PM.
    Reply With Quote Quote  


  2. Login/register to remove this advertisement.
  3. Certification Invigilator Forum Admin JDMurray's Avatar
    Join Date
    Jul 2003
    Location
    Surf City USA
    Posts
    10,256
    Blog Entries
    50

    Certifications
    GSEC, EnCE, CISSP, SSCP, CEH (ANSI), CASP, CCNA, CCENT, CWSP, CWNA, CWTS, Security+, Server+, Network+, A+, DHTI+, PDI+, MSIT InfoSec
    #2
    I don't think you can pin a VM to a specific core in ESXi. The point of a multi-core CPU is to allow the OS can run multiple threads from the same process in parallel on different cores. Pinning a VM to only a single core would hurt the OS' ability to optimize performance for all running VMs. And I'm assuming that ESXi has been written to take advantage of multi-core CPUs in this way. It may very well be that ESXi is only capable of assigning one VM to a single core core, but the specific core can't be choosen or determined from the ESXi console or API.
    Moderator of the InfoSec, CWNP, IT Jobs, Virtualization, Java, and Microsoft Developers forums at www.techexams.net
    --
    Blog: www.techexams.net/blogs/jdmurray
    LinkedIn: www.linkedin.com/in/jamesdmurray
    Twitter: www.twitter.com/jdmurray
    Reply With Quote Quote  

  4. Senior Member
    Join Date
    Nov 2005
    Location
    Birmingham, AL
    Posts
    1,088
    #3
    On ESXi you can set the processor affinity in the Advanced CPU section of the Resources tab (Edit Settings of VM > Resources > Advanced CPU). Look in the Scheduling Affinity section and you can indicate which processor(s) you want the VM to run.

    I don't recommend doing this unless you have a very specific reason to do so. This can cause contention problems with resource scheduling if done incorrectly. In fact, don't ever assign more than one processor to a VM unless it has an application that can take advantage of multiple processors.
    Reply With Quote Quote  

  5. Senior Member paintb4707's Avatar
    Join Date
    Sep 2007
    Location
    Long Island, New York
    Posts
    421

    Certifications
    A+, Network+
    #4
    Quote Originally Posted by JDMurray View Post
    I don't think you can pin a VM to a specific core in ESXi. The point of a multi-core CPU is to allow the OS can run multiple threads from the same process in parallel on different cores. Pinning a VM to only a single core would hurt the OS' ability to optimize performance for all running VMs. And I'm assuming that ESXi has been written to take advantage of multi-core CPUs in this way. It may very well be that ESXi is only capable of assigning one VM to a single core core, but the specific core can't be choosen or determined from the ESXi console or API.
    The thing is I'm not trying to choose a specific core. I would like to pick a specific physical processor from my dual CPU host so that it will use all 4 cores from CPU A and another VM will use all 4 cores from CPU B.

    Or does ESX not work that way and just sees both processors as 1? Because I do notice it says I have 8 cores.
    Last edited by paintb4707; 07-16-2009 at 03:41 PM.
    Reply With Quote Quote  

  6. Senior Member
    Join Date
    Nov 2005
    Location
    Birmingham, AL
    Posts
    1,088
    #5
    It treats the cores as physical processors.

    1-4 = cpu 0
    5-8 = cpu 1
    Reply With Quote Quote  

  7. Senior Member paintb4707's Avatar
    Join Date
    Sep 2007
    Location
    Long Island, New York
    Posts
    421

    Certifications
    A+, Network+
    #6
    Quote Originally Posted by RTmarc View Post
    It treats the cores as physical processors.

    1-4 = cpu 0
    5-8 = cpu 1
    I thought that was the way it works. However when you create the VM and choose 2 vCPUs for example then go into the Affinity selection you could still choose 4 cores or as many as you like so it confused me.
    Reply With Quote Quote  

  8. Senior Member
    Join Date
    Nov 2005
    Location
    Birmingham, AL
    Posts
    1,088
    #7
    What is your hyperthreading status displaying?
    Reply With Quote Quote  

  9. Senior Member paintb4707's Avatar
    Join Date
    Sep 2007
    Location
    Long Island, New York
    Posts
    421

    Certifications
    A+, Network+
    #8
    Quote Originally Posted by RTmarc View Post
    What is your hyperthreading status displaying?
    Inactive
    Reply With Quote Quote  

  10. Senior Member
    Join Date
    Jan 2008
    Posts
    1,946

    Certifications
    MCITP: EA, EMA; MCSE 2000/2003: M; MCSE 2000: S; MCSA 2000/2003: S; MCTS: ISA 2006; VCP3/4
    #9
    Quote Originally Posted by RTmarc View Post
    I don't recommend doing this unless you have a very specific reason to do so. This can cause contention problems with resource scheduling if done incorrectly. In fact, don't ever assign more than one processor to a VM unless it has an application that can take advantage of multiple processors.
    And when assigning affinity like this, which is 95% of the time a bad idea, never assign it the first proc/core. That is the proc VMware will use for itself, so that proc is less available than any other.
    Reply With Quote Quote  

  11. Senior Member paintb4707's Avatar
    Join Date
    Sep 2007
    Location
    Long Island, New York
    Posts
    421

    Certifications
    A+, Network+
    #10
    Okay, I suppose I'll leave the affinity alone then.

    Thanks for the help guys
    Reply With Quote Quote  

  12. Self-Described Huguenot blargoe's Avatar
    Join Date
    Nov 2005
    Location
    NC
    Posts
    3,818

    Certifications
    VCAP5-DCA; VCP3/4/5; EMCSA:CLARiiON; MCSE:M 2000/2003; MCSE:S 2000/2003; MCTS:Exch2007; Security+; A+; CCNA (expired)
    #11
    I believe that it will always attempt to assign the vcpu's to cores on the same physical processor first. It's probably already doing what you want... you could run a CPU load tester on one of the VM's and see which CPU's spike up I guess.

    Generally, it's not a good idea to even use that many vcpu's in production unless you're really, really, really sure the VM needs that many.
    IT guy since 12/00

    12/3/12 - Passed VCAP5-DCA
    Next: MCITP:SA/MCSA 2008 upgrade or RHCSA
    Future: NetApp NCDA, PMP, ITIL, CCNA
    Reply With Quote Quote  

  13. Drops by now and again astorrs's Avatar
    Join Date
    May 2008
    Location
    Vancouver, Canada
    Posts
    3,142

    Certifications
    I have numerous certs from VMware, Citrix, Microsoft, EMC, Nimble Storage, Palo Alto Networks and more...
    #12
    Quote Originally Posted by paintb4707 View Post
    I thought that was the way it works. However when you create the VM and choose 2 vCPUs for example then go into the Affinity selection you could still choose 4 cores or as many as you like so it confused me.
    You are telling it that it is allowed to schedule the vCPUs on any of those pCPUs (and only those) you set the affinity too.

    Like others said though, just leave affinity alone unless you have a specific requirement and also start with 1 vCPU and only add more if necessary (don't believe taskmanager either, instead rely on the VI Client performance counters for diagnosing CPU issues).
    Reply With Quote Quote  

+ Reply to Thread

Social Networking & Bookmarks