I was trying to benchmark application performance across bare metal and hypervisors. I have a 24-core server on which hyper-v is running. On the same machine, I have centos7 installed. I can set the number of cores a VM can get from hyper-v console, but how can I do the same for bare-metal case as well?
I'm aware of using nr_cpus or max_cpus parameters in grub or even hot unplugging the core via /sys/devices/system/cpu/cpu/online source but I'm facing a small problem there. Hyper-V doesn't allow hard-affinity for processors, and when I try to switch off certain cores in bare-metal manually, the performance in VM is better. I need a method in which the number of cores can be fixed but the id of those are allowed to change.