VMware Communities
giadokiekei
Contributor
Contributor
Jump to solution

Multicore processors and VMWare

Hello. Supposed we have a quadcore processor and 2 or 3 virtual machines running, can we asign each core to each guest and how?

Thank you.

0 Kudos
1 Solution

Accepted Solutions
wila
Immortal
Immortal
Jump to solution

To clarify:

>Number of processors 1 and number of cores 4?

No, assign just ONE core, not 4 cores to your guest.

Only if your guest makes proper use of the cores and multiple threads such as a database server it makes sense to assign more cores.

Certainly don't assign 4 cores, if you want to use multiple cores in your guest, then I'd suggest not to go over 2 cores on a 4 core system.



--
Wil
_____________________________________________________
VI-Toolkit & scripts wiki at http://www.vi-toolkit.com

Contributing author at blog www.planetvm.net

Twitter: @wilva

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva

View solution in original post

0 Kudos
7 Replies
wila
Immortal
Immortal
Jump to solution

Hello,

Yes you can, it's called affinity and is an option under your virtual machine configuration.

But I would advice against using it, using affinity means that you are trying to be smarter as the CPU scheduler and your virtual machines are more likely to be negatively adversed by it as profit from it.

Let me explain. The CPU scheduler in Workstation is pretty smart and will use any available core for your virtual machine automatically. If a core is available your virtual machine will use it and continue to run its applications. If you tag a core to specific virtual machine then it can only use that particular core and your virtual machine will have to wait even if there's another core available. Remember even if you assign a unique core to each VM, your host OS might still decide to use the core you "reserved" for your virtual machine. So your VM will have to wait in such a case until the assigned core is available again.

Hope this helps,



--
Wil
_____________________________________________________
VI-Toolkit & scripts wiki at http://www.vi-toolkit.com

Contributing author at blog www.planetvm.net

Twitter: @wilva

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
giadokiekei
Contributor
Contributor
Jump to solution

Hello, thanks for your reply.

Not sure i am following you. I have a quadcore processor. What is the setting which i will have to apply in vm/settings/processors? Number of processors 1 and number of cores 4? Where do i find this affinity setting and if i enable it in more simple words how would this affect my system (host and guest)?

Many thanks.

0 Kudos
wila
Immortal
Immortal
Jump to solution

Hello,

Oh OK, let's step back then and say it in layman terms. You don't have to select a core for your virtual machine, just select a single CPU for your virtual machine and VMware Workstation will assign a core to it automatically. In a virtual machine VMware workstation refers to a core as a virtual CPU, so you are not assigning the complete CPU, but just a core. If you fire up 3 virtual machines then VMware Workstation will make proper use of all the cores you have available.

If you don't believe that VMware Workstation does that job well enough (for whatever reason) then you can pin a VM to a specific core via settings.. Oops.. looks like that configuration option isn't available in VMware Workstation, but only in the ESX product.

Hmm... you can still do this from within windows task manager by selecting the process (vmware-vmx), right click set affinity.

Most likely this is also possible by editing the vmx file by hand with the correct parameter, for more information on that see Ulli's excellent vmx guide.

http://www.sanbarrow.com/vmx/vmx-advanced.html#sched

But again I advice against doing that as it is clearly unsupported and it will more likely negatively impact your performance as anything else. Unless you have a very very specific usage scenario and know very well what you are doing.



--
Wil
_____________________________________________________
VI-Toolkit & scripts wiki at http://www.vi-toolkit.com

Contributing author at blog www.planetvm.net

Twitter: @wilva

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
wila
Immortal
Immortal
Jump to solution

To clarify:

>Number of processors 1 and number of cores 4?

No, assign just ONE core, not 4 cores to your guest.

Only if your guest makes proper use of the cores and multiple threads such as a database server it makes sense to assign more cores.

Certainly don't assign 4 cores, if you want to use multiple cores in your guest, then I'd suggest not to go over 2 cores on a 4 core system.



--
Wil
_____________________________________________________
VI-Toolkit & scripts wiki at http://www.vi-toolkit.com

Contributing author at blog www.planetvm.net

Twitter: @wilva

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
giadokiekei
Contributor
Contributor
Jump to solution

Thanks for your guidance wila.

0 Kudos
popej
Contributor
Contributor
Jump to solution

Certainly don't assign 4 cores, if you want to use multiple cores in your guest, then I'd suggest not to go over 2 cores on a 4 core system.

That suggest, that SMP implementation in Workstation is inaccurate or inefficient. I don't think so. I havent seen any adverse effects of using multiple 4 core guest on 4 core host. This is desktop solution anyway, virtual machines are mostly doing nothing. But when I need I can get full processing power on any of them.

0 Kudos
wila
Immortal
Immortal
Jump to solution

Hi,

Thanks for your reply.

Certainly don't assign 4 cores, if you want to use multiple cores in your guest, then I'd suggest not to go over 2 cores on a 4 core system.

That suggest, that SMP implementation in Workstation is inaccurate or inefficient. I don't think so. I havent seen any adverse effects of using multiple 4 core guest on 4 core host. This is desktop solution anyway, virtual machines are mostly doing nothing. But when I need I can get full processing power on any of them.

Hmm... I should have been more verbose with my answer I suppose. It depends also on things like if the host CPU has hyperthreading capabilities and HT enabled or not and what type of guests you are running.

Without HT enabled I think that firing up 3 guests with 4 cores assigned is a bad thing to do. With HT enabled it might work as it has then 8 cores to select from.

I am aware that Workstation is ahead of the curve with things like the process scheduler and that the current process scheduler uses relaxed co-scheduling and that it does a remarkable job on scheduling the cores.

There's a lot of unknown factors here. I don't know his workstation version (sounds like 7 though), don't know his host OS, don't know the bitness of his host OS, don't know his guest OS's, don't know what type of load he's going to run, don't know the CPU he's using... sometimes it is better to be safe as sorry.

Then there's more advantages of adding the first extra core to the guest as adding all 4 cores. So I had a reason for advising to not go over assiging more as 2 cores.



--
Wil
_____________________________________________________
VI-Toolkit & scripts wiki at http://www.vi-toolkit.com

Contributing author at blog www.planetvm.net

Twitter: @wilva

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva