VMware Cloud Community
geob
Enthusiast
Enthusiast
Jump to solution

How to assign a VM to only use a specific Processor?

I have a strange situation. I have some ESX 2.5.3 4-way hosts that we are now managing with VC 2.0.1.

Now, what I need to do, is configure my VMs so they can only run on a specific processor. I need to do this to perform some performance testing on an app. The problem is that with VC 2.0.1, the option to select a specific Proc seems to be gone, I guess because of the way the VC manages the resources on a 3.0 hosts.

Does anyone know how I could manually make the assignment by editing the vmx file? What would I need to add?

Reply
0 Kudos
1 Solution

Accepted Solutions
mattpound
Hot Shot
Hot Shot
Jump to solution

You could also do it through the web MUI on the ESX server.

View solution in original post

Reply
0 Kudos
7 Replies
oreeh
Immortal
Immortal
Jump to solution

add the following to the VMX file

sched.cpu.affinity = "1"

make sure to select the appropriate CPU number

also unregister the VM before making the chage and reregister it after the change

Reply
0 Kudos
geob
Enthusiast
Enthusiast
Jump to solution

I assume the "1" is the processor number?

Reply
0 Kudos
oreeh
Immortal
Immortal
Jump to solution

yes

Message was edited by:

oreeh

counting starts from zero !

Reply
0 Kudos
geob
Enthusiast
Enthusiast
Jump to solution

Thanks, I really appreciate the help. But I have one more thing you maybe able to help me with. If I wanted a VM to run on any processor but "2" would I do this?

sched.cpu.affinity = "0, 1, 3"

Reply
0 Kudos
mattpound
Hot Shot
Hot Shot
Jump to solution

You could also do it through the web MUI on the ESX server.

Reply
0 Kudos
oreeh
Immortal
Immortal
Jump to solution

yes - VC writes it the opposite order (3,1,0)

Reply
0 Kudos
geob
Enthusiast
Enthusiast
Jump to solution

Ah yes, the MUI, why didn't I think of that. It actually works great without having to unregister, and register the VM. And I am not sure adding the sched.cpu.affinty setting in vmx file actually worked. I looked in he MUI after adding the line to the vmx, and registering the VM, and it was still set to run on all CPUs.

THanks for the help.

Reply
0 Kudos