How to assign dedicated vCPUs to specific VM on Proxmox (KVM) or what system could do that

cpu-usagehypervisorproxmoxvcpuvirtualization

I'm posting this here, because what I've found about the topic is either outdated, incomplete or not suitable for various reasons.

I have wanted for a long time to learn how to map specific vCPUs to a specific VM (that needs the maximum possible CPU performance and the less possible CPU blocking/context switches), while in the same node there are other VMs that can't access the pinned cores (they need to be only accesible to the specific VM), and whose CPU allocation is done by the scheduler as "by default".

My current system of choice is Proxmox (only using KVM), usually the latest version in the pvetest branch and latest 3.X kernel.

For my specific needs, rather than learning how to do this in my current system, I would consider switching to other systems or even hypervisors that allows advanced management of CPU allocation to VMs. My budget for paid solutions is close to none, not excluding them all from the start but they should be very cheap to consider.

Thanks a lot in advance, and hope the (many possible) answers to this are useful to many other people.

This feature could be useful for users/admins of virtualization hosts (for whatever reason, in my case because I use different operating systems) where most VMs needs low CPU time, but there are one (or some) that needs ensured high CPU time.

Best Answer

It seems proxmox already has some similar options.

https://forum.proxmox.com/threads/numa-config-option.21313/

Yes, it will make use of CPU pinning (affinity). It is my understanding that enabling NUMA will change the scheduling algorithm such that it is now aware of NUMA nodes on the underlying physical CPU. Thus will attempt to keep vCPU scheduling within the same NUMA node whenever possible.