I have a Ubuntu Linux VM running on VMWare, and I have changed the CPU affinity for multiple processes using the taskset command. The VM has 16 cores allocated to it, and so does the actual server that contains the VMWare hypervisor. Is there anyway to verify that the processes are actually being bound to the physical cores and the VM isn't just reporting that this is so?
Asked
Active
Viewed 595 times
1
-
1You can check `cat /proc/cpuinfo` on the VM it shows all the info about your CPU. Other than that why would the VM just "report that it is so"? – Broco Aug 03 '16 at 13:01
-
1`The VM has 16 cores allocated to it, and so does the actual server that contains the VMWare hypervisor` - don't do that. Leave at least one core to the hypervisor. Make sure that you don't count cores and threads, allocate only `n-1` cores to the guest. Where `n` is number of all cores in the hypervisor. – Michal Sokolowski Aug 03 '16 at 13:13
-
I know this used to be the case but isn't the allocation dynamic? Unless you use the Reservation parameter it shouldn't be a problem and even then the Hypervisor would throw an error. – Broco Aug 03 '16 at 13:39
-
Why do you care which physical cores a particular program in a VM is using? The whole point of having a hypervisor is so that you can abstract the physical layer. If you're that worried about it all the same, just run Linux on the bare metal. – GregL Aug 03 '16 at 14:24
-
1@Broco yes, the VM is reporting the output that I am looking for, i.e process 1 is set to CPU1, process 2 is set to CPU2, process 3.. etc. However, I want to verify that these processes are actually binding to the physical cores. – mariahm24 Aug 03 '16 at 15:50
-
@mariahm24 I don't get it, you just said that the VM is reporting what you want what is there to verify? You think the VM lies to you? – Broco Aug 03 '16 at 16:01
-
1@Broco CPUs on virual machines are vCPUs, I want to know that the CPU affinity is propagating down to the physical server CPUs. Like GregL stated, hypervisors add a layer of abstraction. – mariahm24 Aug 03 '16 at 16:52
-
1@mariahm24 your question suggests that the guest OS is reporting that the processes are bound to the physical cores, and that you want to verify this report. But the guest OS is probably not reporting this. It is reporting binding to the virtual cores. What I think you really want to ask is if ESXi respects the affinity settings you've made in the guest OS and if there is a way to verify it is "passing on" the request to the physical host for execution there. I'm not sure that this is a feature of ESXi. – JasonAzze Aug 04 '16 at 12:18