How smart is Proxmox VE choosing correct cpu to run a VM?

seanr22a

Member
Dec 16, 2022
5
1
8
I have server with two intel cpus (numa0 and numa1). Each one has a SAS controller connected to the PCI bus(one to PCI bus 0 and one to PCI bus 1).

There is 20 VMs, each one has one virtual hdd attached (Virtio SCSI SIngel). This virtual hdd is on a ZFS volume on SAS controller 1 or 2.

So my question: Is PVE smart so it knows on which cpu to run each VM ? It would not be good for performance if the VM that has a hdd on cpu1 runs on cpu2.
 
If I use the easy approch with affinity in the CPU settings, I have 88 cores, 0-21, 44-65 CPU0 - 22-43, 66-87 CPU1

If I would set cpu affinity to 0-21, 44-65 for all VMs I want to run on CPU0 and 22-43, 66-87 for all VMs I want to run on CPU1 would that work ?

I'm not interested to set specific cores for each VM. As long as they use the CPU that is in the range I specified. Would this work or do I have to set specific cores for each VM ?
 
Now I'm trying my settings as I wrote in my previous post. It did not protest entering the whole range of cores for each CPU for each VM. VMs restarted, everything is working and no errors in the logs.

How do I verify ? Is there any command that can show which cores each VM is using ?
 
You can do that with ps -aeF, see the C column.
Didn't know you could see that with ps, always learn something new. I could not get the info I needed with ps -aeF, I used ps -eLF. Now I have checked all VMs and it works they stay at the CPU I set.

You don't need to specify specific cores for the VM you can just enter all the cores for CPU0 in CPU affinity on all VMs you want to run on CPU0 and the same for those you want to run only on CPU1. :cool:
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!