Currently in CNF Testbed, only two CPUs are fully supported in the Ansible role that handles CPU isolation:
Intel® Xeon® Gold 5120 (14 cores)
Intel® Xeon® Gold 5218 (16 cores)
The existing implementation will isolate 12 cores (24 threads per socket, as both Hyperthreading and dual socket is expected), which works when using m2.xlarge.x86 or n2.xlarge.x86 from Packet.com. For any other configuration the CPU isolation will either be skipped, or potentially fail when the system is rebooted during the configuration.
Goal:
Make CPU isolation through Ansible more dynamic than it currently is in CNF Testbed. The Ansible role should be able to add the necessary entries to the node GRUB configuration file, based on the CPU, number of sockets and if Hyperthreading is enabled.
In addition, it should be possible to specify the number of cores to isolate from the higher level Ansible playbook. If the configuration is not possible on a given node, a default (dynamic) configuration will be applied instead.
Tasks:
[x] Refactor (and ideally rename) existing role for CPU isolation (grub_vswitch) to provide dynamic CPU isolation through GRUB on target nodes.
[x] Update high-level playbook(s) to use new isolation role instead of the current one
[x] Update documentation and existing environment file(s) to include/mention added argument(s)
[x] Verify behavior of role is as expected
Acceptance Criteria
For the below criteria, the resulting isolation can be found by running cat /proc/cmdline on the target worker node(s).
[ ] When using the Makefile, relevant parts (vswitch, pktgen, isolcpus) are deployed as expected and without errors.
[ ] When using the Makefile, the number of cores isolated on the target worker node(s) should match the value specified in ISOLATED_CORES (default 0). When set to 0 or not set at all, the maximum number of cores available on the worker node(s) (all except the first core on each socket) will be isolated.
[ ] Setting a value in ISOLATED_CORES higher than the number of cores available on the target server(s) should result in the maximum number of cores available being isolated.
Based on discussion found here
PR avaialble here: cncf/cnf-testbed#337
Background:
Currently in CNF Testbed, only two CPUs are fully supported in the Ansible role that handles CPU isolation:
m2.xlarge.x86
orn2.xlarge.x86
from Packet.com. For any other configuration the CPU isolation will either be skipped, or potentially fail when the system is rebooted during the configuration.Goal:
Make CPU isolation through Ansible more dynamic than it currently is in CNF Testbed. The Ansible role should be able to add the necessary entries to the node GRUB configuration file, based on the CPU, number of sockets and if Hyperthreading is enabled.
In addition, it should be possible to specify the number of cores to isolate from the higher level Ansible playbook. If the configuration is not possible on a given node, a default (dynamic) configuration will be applied instead.
Tasks:
grub_vswitch
) to provide dynamic CPU isolation through GRUB on target nodes.Acceptance Criteria
For the below criteria, the resulting isolation can be found by running
cat /proc/cmdline
on the target worker node(s).ISOLATED_CORES
(default 0). When set to 0 or not set at all, the maximum number of cores available on the worker node(s) (all except the first core on each socket) will be isolated.ISOLATED_CORES
higher than the number of cores available on the target server(s) should result in the maximum number of cores available being isolated.