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
Password:
Connected to Oracle Linux Virtualization Manager 4.3.10.4-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]
Note: if the VM is running you must now stop and then start the VM from Oracle Linux Virtualization Manager in order for CPU pinning changes to take effect.
Note: a restart or a reboot of the VM is not sufficient to put CPU pinning changes into effect.
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
VCPU: 0
CPU: 10
State: running
CPU time: 35.0s
CPU Affinity: 0 (out of 72)
…
…
VCPU: 15
CPU: 13
State: running
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.