VMware Cloud Community
Pisapatis
Contributor
Contributor

Wokload distribution on VI3.5 - Can I allocate physical CPUs/cores to a specific VM

I am trying to conduct some benchmarks/capacity planning tests for a product. Obviously, I would like to reduce hardware by using ESX VI3.5 that would closely emulate physical windows servers, especially for the application stack (not database, file service etc). I am wondering how one Virtual CPU (vCPU) power equals to one core of the host system, Besides, is there a way to allocate the physical cores to a specific VM?

Any help is very much appreciated.

Thanks,

SP

0 Kudos
8 Replies
fejf
Expert
Expert

You can use "CPU Pinning" to restrict the virtual CPUs to one or multiple physical CPUs (see the settings of the VM) but don't forget to remove the pinning afterwards because the virtual machines will no longer be able to be vmotioned (and so no drs etc).

--

There are 10 types of people. Those who understand binary and the rest. And those who understand gray-code.

-- There are 10 types of people. Those who understand binary and the rest. And those who understand gray-code.
0 Kudos
weinstein5
Immortal
Immortal

yes it is called processor affinity and if done in the settings of you vm this will fix the vCPU to run on a specific core or cores - also couple of things to remember: there is a bug in ESX 3.5 you have to power cycle the VM for the affinity to take affect once you have set process affinity vmotion will no longer work and by extension DRS will also stop working for this VM, and if you must set affinity (I do not recommend it) do not set affinity to CPU0 because this is the cpu the service console and vmkernel are bound to

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
esiebert7625
Immortal
Immortal

As others have mentioned using affinity is generally not recommended. The ESX Scheduler does a very good job of managing CPU scheduling on it's own and affinity reduces it's effectiveness. Here's some good things to read on this...

ESX Server 3 Ready Time Observations - http://www.vmware.com/pdf/esx3_ready_time.pdf

A Performance Comparison of Hypervisors - http://www.vmware.com/pdf/hypervisor_performance.pdf

ESX Server CPU Scheduling - http://www.vmware-tsx.com/download.php?asset_id=39

ESX Server CPU Scheduling (VMworld 2007) - http://vmworld.com/vmworld/mylearn?classID=11026

How to be a Good Guest - AMD - (VMworld 2007) - http://vmworld.com/vmworld/mylearn?classID=11698

Evaluation of ESX Server under CPU Intensive Workloads - http://www.windley.com/docs/2006/OIT%20Report%20Sept06.pdf

ESX vSMP Scheduling - http://www.vmware.com/community/thread.jspa?threadID=97165

Eric Siebert

VMware Communities User Moderator

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Check out my website: VMware-land

Read my virtualization blog: SSV Blog

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

0 Kudos
Pisapatis
Contributor
Contributor

Thanks for quick response. BTW, this is to benchmark/capacity-test a software product and the main intention is to reduce number of boxes. I am not going to use Vmotion nor DRS here. My goal is to make the VM as close as a physical machine spec.

I think processor affinity is within a VM and I am not sure whether it serves my purpise. I think pinning CPU should work for me. Please correct me if I am wrong.

0 Kudos
esiebert7625
Immortal
Immortal

Sounds like it should work for you then. Just remember the Service Console runs exclusively on CPU0 so you may want to avoid pinning a VM to that CPU/core.

Eric Siebert

VMware Communities User Moderator

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Check out my website: VMware-land

Read my virtualization blog: SSV Blog

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

0 Kudos
weinstein5
Immortal
Immortal

pinning and affinity are the same thing - affiity will pin the vCPU to a specific pCPU - and as I stated in a previous post make sure you do not set affinity to CPU0

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
fejf
Expert
Expert

Generally speaking I wouldn't say that affinity is the same thing as pinning. You can say that CPU affinity is the same thing BUT there's also DRS-affinity and DRS-anti-affinity rules - and that's a complete different thing. That's why i try to use the word "pinning" with VM <-> CPU affinity rules and "affinity" with VM <-> VM affinity rules.

--

There are 10 types of people. Those who understand binary and the rest. And those who understand gray-code.

-- There are 10 types of people. Those who understand binary and the rest. And those who understand gray-code.
0 Kudos
weinstein5
Immortal
Immortal

true - vmware has a tendency to do that reuse terms or not use the correct one - pinning is better way of describing but in the VI Client it is called CPU affinity -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos