The olvm-vmcontrol utility can be used to configure hard partitioning of a vCPU to a physical CPU.
# olvm-vmcontrol -m okvmmgmt.test.local -u admin@internal -v Node1 -c setvcpu -s 0-15
Oracle Linux Virtualization Manager VM Control Utility 4.3.1-1
Connected to Oracle Linux Virtualization Manager 220.127.116.11-1.0.14.el7
Setting vcpu pinning ...
Trying to pin virtual cpu # 0
Trying to pin virtual cpu # 1
Trying to pin virtual cpu # 15
Retrieving vcpu pinning to confirm it has been set...
vcpu 0 pinned to cpuSet[0-15]
vcpu 1 pinned to cpuSet[0-15]
vcpu 15 pinned to cpuSet[0-15]
As shown in the output above, after the VM is configured for CPU pinning, the VM needs to be stopped and started once again before CPU pinning takes place.
Note: The CPU pinning needs to take place before installing Oracle Database.
CPU pinning can be verified by the virsh command as follows:
# virsh --readonly list
Id Name State
10 Node1 running
# virsh --readonly vcpuinfo Node1 –pretty
CPU time: 35.0s
CPU Affinity: 0 (out of 72)
CPU time: 16.4s
CPU Affinity: 15 (out of 72)
The VM now has CPU affinity assigned for 16 virtual CPUs to physical CPU 0-15.