VMware Cloud Community
HCC
Enthusiast
Enthusiast
Jump to solution

esx3.5 how do you set cpu affinity?

Hi, running 3.5 in a HA DRS cluster. Can you set CPU affinity for a VM? If so, how ?

Thanks

0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

not so sure but if your using drs and the VM moves its loses it affinity setting, i will check but i think either enabling HA or DRS greays out the affinity option.. please confirm guys

View solution in original post

0 Kudos
8 Replies
admin
Immortal
Immortal
Jump to solution

not so sure but if your using drs and the VM moves its loses it affinity setting, i will check but i think either enabling HA or DRS greays out the affinity option.. please confirm guys

0 Kudos
lmonaco
Hot Shot
Hot Shot
Jump to solution

vm properties, resources, advanced cpu.

You'll lose it when migrating.

0 Kudos
penghaug
Enthusiast
Enthusiast
Jump to solution

hi,

Is this the answer you're looking for?

<cut from help>

The Scheduling Affinity group allows fine-grained control over how virtual machine CPUs are distributed across the host's physical cores (and hyperthreads if hyperthreading is enabled).

This option is not allowed when the virtual machine resides on a DRS cluster, and its values are cleared when a virtual machine is migrated to a new host, because the only value of the option is in tuning the performance of a precise set of virtual machines on the same host.

</cut from help>

Attached one pic with DRS enabled and one without DRS enabled.

-Pål-André

-Pål-André
0 Kudos
lmonaco
Hot Shot
Hot Shot
Jump to solution

let me rephrase that. you'll lose your vmotion capabilities for that vm.

0 Kudos
lmonaco
Hot Shot
Hot Shot
Jump to solution

penghaug is correct, i only had ha enabled in my test.

0 Kudos
RParker
Immortal
Immortal
Jump to solution

Can you set CPU affinity for a VM? If so, how

A better question would be, why do you want to do this? VM Ware does a good job on it's own determining which CPU to use for the current virtual CPU

0 Kudos
HCC
Enthusiast
Enthusiast
Jump to solution

Hi, I guess then that the question is what is the better route or go ...use affinity or use DRS ?? thoughts. DRS gives you more dynamic assignment of VMs across hardware but I guess you could manually monitor the resources of each ESX Host via the Performance monitors. Does anyone use affinity very much?

I ask because we were looking at some applications that require servers as per vendor spec. and we thought about virtualizing them however specified they wanted a dedicated CPU which I guess is where affinity comes in. That being said, I am not sure why they require that. I guess it must be somewhat CPU intensive ? I would think it would be better to have the VMotion capability (HA) over using affinity? I don't use it so I can't say which is better.

Does anyone have any thoughts on it?

Thanks for all the replies.

0 Kudos
weinstein5
Immortal
Immortal
Jump to solution

I did not read through all the responses so if I am repeating I am sorry -

1) It is best practice not to set affinity - the vmkernel does an excellent job of scheduling the virtual CPU to insure resources

2) If you set CPU affinity you will not be able to vmotion

3) if you can not vmotion you will not be able to use DRS since it relies on vmotion to move the running V<S

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

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