|
76 | 76 | needs to create a resource in Neutron it will requery Neutron for the
|
77 | 77 | extensions that it has loaded. Setting value to 0 will refresh the
|
78 | 78 | extensions with no wait.
|
| 79 | +"""), |
| 80 | + cfg.ListOpt('physnets', |
| 81 | + default=[], |
| 82 | + help=""" |
| 83 | +List of physnets present on this host. |
| 84 | +
|
| 85 | +For each *physnet* listed, an additional section, |
| 86 | +``[neutron_physnet_$PHYSNET]``, will be added to the configuration file. Each |
| 87 | +section must be configured with a single configuration option, ``numa_nodes``, |
| 88 | +which should be a list of node IDs for all NUMA nodes this physnet is |
| 89 | +associated with. For example:: |
| 90 | +
|
| 91 | + [neutron] |
| 92 | + physnets = foo, bar |
| 93 | +
|
| 94 | + [neutron_physnet_foo] |
| 95 | + numa_nodes = 0 |
| 96 | +
|
| 97 | + [neutron_physnet_bar] |
| 98 | + numa_nodes = 0,1 |
| 99 | +
|
| 100 | +Any *physnet* that is not listed using this option will be treated as having no |
| 101 | +particular NUMA node affinity. |
| 102 | +
|
| 103 | +Tunnelled networks (VXLAN, GRE, ...) cannot be accounted for in this way and |
| 104 | +are instead configured using the ``[neutron_tunnel]`` group. For example:: |
| 105 | +
|
| 106 | + [neutron_tunnel] |
| 107 | + numa_nodes = 1 |
| 108 | +
|
| 109 | +Related options: |
| 110 | +
|
| 111 | +* ``[neutron_tunnel] numa_nodes`` can be used to configure NUMA affinity for |
| 112 | + all tunneled networks |
| 113 | +* ``[neutron_physnet_$PHYSNET] numa_nodes`` must be configured for each value |
| 114 | + of ``$PHYSNET`` specified by this option |
79 | 115 | """),
|
80 | 116 | ]
|
81 | 117 |
|
@@ -118,6 +154,26 @@ def register_opts(conf):
|
118 | 154 | confutils.register_ksa_opts(conf, neutron_group, DEFAULT_SERVICE_TYPE)
|
119 | 155 |
|
120 | 156 |
|
| 157 | +def register_dynamic_opts(conf): |
| 158 | + """Register dynamically-generated options and groups. |
| 159 | +
|
| 160 | + This must be called by the service that wishes to use the options **after** |
| 161 | + the initial configuration has been loaded. |
| 162 | + """ |
| 163 | + opt = cfg.ListOpt('numa_nodes', default=[], item_type=cfg.types.Integer()) |
| 164 | + |
| 165 | + # Register the '[neutron_tunnel] numa_nodes' opt, implicitly |
| 166 | + # registering the '[neutron_tunnel]' group in the process. This could |
| 167 | + # be done statically but is done to avoid this group appearing in |
| 168 | + # nova.conf documentation while the other group does not. |
| 169 | + conf.register_opt(opt, group='neutron_tunnel') |
| 170 | + |
| 171 | + # Register the '[neutron_physnet_$PHYSNET] numa_nodes' opts, implicitly |
| 172 | + # registering the '[neutron_physnet_$PHYSNET]' groups in the process |
| 173 | + for physnet in conf.neutron.physnets: |
| 174 | + conf.register_opt(opt, group='neutron_physnet_%s' % physnet) |
| 175 | + |
| 176 | + |
121 | 177 | def list_opts():
|
122 | 178 | return {
|
123 | 179 | neutron_group: (
|
|
0 commit comments