NUMA aware vswitches
Set configuration parameters to enable NUMA affinity for vswitches. The related nova changes are done in change: https://review.openstack.org/#/c/564440/ Depends-On: Id7c2f0b53c8871ff47a836ec4c324c8cce430b79 Change-Id: Ia8fd65a75bc732087128e9e32ba72b2491423898
This commit is contained in:
@@ -163,6 +163,15 @@
|
|||||||
# Accepts a string e.g "node:0,size:1GB,count:4" or a list of strings e.g:
|
# Accepts a string e.g "node:0,size:1GB,count:4" or a list of strings e.g:
|
||||||
# ["node:0,size:1GB,count:4", "node:1,size:1GB,count:4"]
|
# ["node:0,size:1GB,count:4", "node:1,size:1GB,count:4"]
|
||||||
#
|
#
|
||||||
|
# [*neutron_physnets_numa_nodes_mapping*]
|
||||||
|
# (optional) Map of physnet name as key and list of NUMA nodes as value.
|
||||||
|
# Defaults to {}
|
||||||
|
#
|
||||||
|
# [*neutron_tunnel_numa_nodes*]
|
||||||
|
# (optional) List of NUMA nodes to configure NUMA affinity for all
|
||||||
|
# tunneled networks.
|
||||||
|
# Defaults to []
|
||||||
|
#
|
||||||
# DEPRECATED PARAMETERS
|
# DEPRECATED PARAMETERS
|
||||||
#
|
#
|
||||||
# [*keymgr_api_class*]
|
# [*keymgr_api_class*]
|
||||||
@@ -205,6 +214,8 @@ class nova::compute (
|
|||||||
$keymgr_backend = 'nova.keymgr.conf_key_mgr.ConfKeyManager',
|
$keymgr_backend = 'nova.keymgr.conf_key_mgr.ConfKeyManager',
|
||||||
$verify_glance_signatures = $::os_service_default,
|
$verify_glance_signatures = $::os_service_default,
|
||||||
$reserved_huge_pages = $::os_service_default,
|
$reserved_huge_pages = $::os_service_default,
|
||||||
|
$neutron_physnets_numa_nodes_mapping = {},
|
||||||
|
$neutron_tunnel_numa_nodes = [],
|
||||||
# DEPRECATED PARAMETERS
|
# DEPRECATED PARAMETERS
|
||||||
$keymgr_api_class = undef,
|
$keymgr_api_class = undef,
|
||||||
) {
|
) {
|
||||||
@@ -237,6 +248,34 @@ class nova::compute (
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !empty($neutron_physnets_numa_nodes_mapping) {
|
||||||
|
validate_hash($neutron_physnets_numa_nodes_mapping)
|
||||||
|
$neutron_physnets_real = keys($neutron_physnets_numa_nodes_mapping)
|
||||||
|
nova_config {
|
||||||
|
'neutron/physnets': value => join(any2array($neutron_physnets_real), ',');
|
||||||
|
}
|
||||||
|
|
||||||
|
$neutron_physnets_numa_nodes_mapping.each |$physnet, $numa_nodes| {
|
||||||
|
nova_config {
|
||||||
|
"neutron_physnet_${physnet}/numa_nodes": value => join(any2array($numa_nodes), ',');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
nova_config {
|
||||||
|
'neutron/physnets': ensure => absent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !empty($neutron_tunnel_numa_nodes) {
|
||||||
|
nova_config {
|
||||||
|
'neutron_tunnel/numa_nodes': value => join(any2array($neutron_tunnel_numa_nodes), ',');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
nova_config {
|
||||||
|
'neutron_tunnel/numa_nodes': ensure => absent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if !is_service_default($reserved_huge_pages) and !empty($reserved_huge_pages) {
|
if !is_service_default($reserved_huge_pages) and !empty($reserved_huge_pages) {
|
||||||
if is_array($reserved_huge_pages) or is_string($reserved_huge_pages) {
|
if is_array($reserved_huge_pages) or is_string($reserved_huge_pages) {
|
||||||
$reserved_huge_pages_real = $reserved_huge_pages
|
$reserved_huge_pages_real = $reserved_huge_pages
|
||||||
|
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Add parameters `neutron_physnets_numa_nodes_mapping` and
|
||||||
|
`neutron_tunnel_numa_nodes` to provide numa affinity for
|
||||||
|
physnets attached to vswitches.
|
@@ -226,6 +226,28 @@ describe 'nova::compute' do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when neutron_physnets_numa_nodes_mapping and neutron_tunnel_numa_nodes are empty' do
|
||||||
|
let :params do
|
||||||
|
{ :neutron_physnets_numa_nodes_mapping => {},
|
||||||
|
:neutron_tunnel_numa_nodes => [], }
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_nova_config('neutron/physnets').with(:ensure => 'absent') }
|
||||||
|
it { is_expected.to contain_nova_config('neutron_tunnel/numa_nodes').with(:ensure => 'absent') }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when neutron_physnets_numa_nodes_mapping and neutron_tunnel_numa_nodes are set to valid values' do
|
||||||
|
let :params do
|
||||||
|
{ :neutron_physnets_numa_nodes_mapping => { 'foo' => [0, 1], 'bar' => [0] },
|
||||||
|
:neutron_tunnel_numa_nodes => 1, }
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_nova_config('neutron/physnets').with(:value => 'foo,bar') }
|
||||||
|
it { is_expected.to contain_nova_config('neutron_physnet_foo/numa_nodes').with(:value => '0,1') }
|
||||||
|
it { is_expected.to contain_nova_config('neutron_physnet_bar/numa_nodes').with(:value => '0') }
|
||||||
|
it { is_expected.to contain_nova_config('neutron_tunnel/numa_nodes').with(:value => '1') }
|
||||||
|
end
|
||||||
|
|
||||||
context 'with install_bridge_utils set to false' do
|
context 'with install_bridge_utils set to false' do
|
||||||
let :params do
|
let :params do
|
||||||
{ :install_bridge_utils => false }
|
{ :install_bridge_utils => false }
|
||||||
|
Reference in New Issue
Block a user