From fec0dfb47d1fa6dfa25139992ff7291c7b9cc682 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Fri, 13 Mar 2020 11:03:30 -0400 Subject: [PATCH] [TRAIN and before] Introduce ContainerCpusetCpus Add a role specific parameter, ContainerCpusetCpus, default to 'all', which allows to limit the specific CPUs or cores a container can use. To disable it and rely on container engine default, set it to ''. Change-Id: I3b669665548668423d4ce7e34262c12903fba522 Related-Bug: #1867357 (cherry picked from commit 85850d8af240722facdf59eea79f2523057d1e8a) --- docker/services/nova-libvirt.yaml | 10 +++++++++- releasenotes/notes/cpuset_cpus-4dbde2cec2152b30.yaml | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/cpuset_cpus-4dbde2cec2152b30.yaml diff --git a/docker/services/nova-libvirt.yaml b/docker/services/nova-libvirt.yaml index 17a2e1c617..e3f77a8e5f 100644 --- a/docker/services/nova-libvirt.yaml +++ b/docker/services/nova-libvirt.yaml @@ -131,6 +131,12 @@ parameters: type: string tags: - role_specific + ContainerCpusetCpus: + description: Limit the specific CPUs or cores a container can use. + type: string + default: 'all' + tags: + - role_specific conditions: @@ -188,9 +194,11 @@ resources: map_replace: - map_replace: - vhostuser_socket_group: VhostuserSocketGroup + container_cpuset_cpus: ContainerCpusetCpus - values: {get_param: [RoleParameters]} - values: VhostuserSocketGroup: {get_param: VhostuserSocketGroup} + ContainerCpusetCpus: {get_param: ContainerCpusetCpus} ContainersCommon: @@ -324,7 +332,7 @@ outputs: pid: host privileged: true restart: always - cpuset_cpus: all + cpuset_cpus: {get_attr: [RoleParametersValue, value, container_cpuset_cpus]} volumes: list_concat: - {get_attr: [ContainersCommon, volumes]} diff --git a/releasenotes/notes/cpuset_cpus-4dbde2cec2152b30.yaml b/releasenotes/notes/cpuset_cpus-4dbde2cec2152b30.yaml new file mode 100644 index 0000000000..e6fe3625fc --- /dev/null +++ b/releasenotes/notes/cpuset_cpus-4dbde2cec2152b30.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Add a role specific parameter, ContainerCpusetCpus, default to 'all', which + allows to limit the specific CPUs or cores a container can use. + To disable it and rely on container engine default, set it to ''.