VMware Cloud Community
fordian
Hot Shot
Hot Shot

CPU Affinity

I migrated VC 1.4.1 to VC 2.0.1 patch 2. 4 and ESX 2.5.4 ESX server attached to it.

Is it always possible to choose CPU affinity with VC2 and ESX 2.5.4 ?

When editing VM setting I not the option to do this.

Any ideas ?

Thank you

Dominic

Reply
0 Kudos
13 Replies
oreeh
Immortal
Immortal

No.

VC under some circumstances prohibits the usage of CPU affinity settings.

One example is fully automated DRS.

fordian
Hot Shot
Hot Shot

I saw :(( The only wait to do this is to modify the vmx file manually.

Thank you

Dominic

Reply
0 Kudos
oreeh
Immortal
Immortal

This could break DRS and HA !

Reply
0 Kudos
fordian
Hot Shot
Hot Shot

Actually we have only ESX 2.5.4 running with VC 2.0.1, so I think we cannot use DRS and HA ?

Thank you

Dominic

Reply
0 Kudos
oreeh
Immortal
Immortal

it could break vMotion too (if your hosts have different numbers of CPUs / cores)

Reply
0 Kudos
fordian
Hot Shot
Hot Shot

Until now we reserved the CPU0 only for the COS. Each VM has a cpu affinity set to "1,2,3,4,5,6,7".

Is it a good practice to do this ? Or it is better to have no affinity ?

Thank you

Dominic

Reply
0 Kudos
oreeh
Immortal
Immortal

I wouldn't do this (and I don't think this is a good practice).

You simply waste processing power on CPU0 by doing this.

In your case I wouldn't set any affinity at all.

Reply
0 Kudos
fordian
Hot Shot
Hot Shot

I don't really which one, but I think I read it in a VMware document. Anyway that is a lesser issue.

Thank you for your help

Dominic

Reply
0 Kudos
pengo
Enthusiast
Enthusiast

if you set the cpu affinity to "1,2,3,4,5,6,7" for example, you will definitely break HA.

I hade old VMs with cpu affinity set, and HA never worked correctly until we removed the affinity.

//Daniel

fordian
Hot Shot
Hot Shot

I will remember this information when ESX server will at 3.x.

Thank you

Dominic

Reply
0 Kudos
TCronin
Expert
Expert

Since you are not running any ESX 3 hosts I wouldn't worry about breaking HA. There are several other ways you can set affinity either temporarily or permanently (i.e. the setting survives a reboot).

To set affinity from the command line you can echo the settings into the proc files. You need to know the vmid of the guest you are changing to do this. I find it by doing:

grep /cpu/affinity

The setting will revert to whats in the configuration file when the guest reboots. To make the setting persistent you would have to edit the .vmx file to change the affinity there.

You can also set the affinity through the guest property page in the MUI

Tom Cronin, VCP, VMware vExpert 2009 - 2021, Co-Leader Buffalo, NY VMUG
Reply
0 Kudos
mvoss18
Hot Shot
Hot Shot

You could probably set affinity through the MUI. I've had issues trying to increase shares or reserver CPU on my esx 2.5.3 hosts managed by VC 2.0.1. I've been able to make those changes in the MUI, but you need to be careful about using the MUI and VC to manage a host a the same time.

However, I would recommend not using affnity at all. If I'm concerned about a particular virtual machine's cpu performance, I'll reserver some cpu cycles or increase it's shares. If you are running a VI3 Cluster with DRS you don't even see the affinity options! Running on standalone hosts, you can do it.

In fact, do some tests with and without affinity settings, and tell me if it makes any difference. I think you'll find that it's increased work for you to manage affinity and it gives you little to no performance increase for the VM. I'd much rather use DRS/reservations/shares to manage cpu resources!

Mike, VCP

Reply
0 Kudos
fordian
Hot Shot
Hot Shot

I agree with you. The only way I used CPU affinity is to make sure the COS never run out of CPU0. We have script running on the console for statistics output.

In ESX 3 we will not have this concern so we will not used CPU affinity at all.

Thank you

Dominic

Reply
0 Kudos