Automatically generate neutron core configuration files

This adds a new tox environment, genconfig, which generates sample
neutron core configuration file using oslo-config-generator.

Updates to some configuration option help messages to reflect useful
details that were missing in the code but were present in config files.

It also adds details to devref on how to update config files.

Partially-Implements: blueprint autogen-neutron-conf-file

DocImpact

Change-Id: I1c6dc4e7d479f1b7c755597caded24a0f018c712
Closes-bug: #1199963
Co-Authored-By: Louis Taylor <louis@kragniz.eu>
This commit is contained in:
Martin Hickey 2015-11-09 23:37:37 +00:00
parent ee79ee3726
commit 71190773e1
41 changed files with 678 additions and 95 deletions

2
.gitignore vendored
View File

@ -6,6 +6,8 @@ cover/
covhtml/
dist/
doc/build
etc/*.sample
etc/neutron/plugins/ml2/*.sample
*.DS_Store
*.pyc
neutron.egg-info/

View File

@ -367,6 +367,21 @@ section of the third-party repo's own ``setup.cfg`` file.
config files, duplicate settings will collide. It is therefore recommended to
prefix section names with a third-party string, e.g. [vendor_foo].
Since Mitaka, configuration files are not maintained in the git repository but
should be generated as follows::
``tox -e genconfig``
If a 'tox' environment is unavailable, then you can run the following script
instead to generate the configuration files::
./tools/generate_config_file_samples.sh
It is advised that subprojects do not keep their configuration files in their
respective trees and instead generate them using a similar approach as Neutron
does.
Liberty Steps
+++++++++++++

9
etc/README.txt Normal file
View File

@ -0,0 +1,9 @@
To generate the sample neutron configuration files, run the following
command from the top level of the neutron directory:
tox -e genconfig
If a 'tox' environment is unavailable, then you can run the following script
instead to generate the configuration files:
./tools/generate_config_file_samples.sh

View File

@ -0,0 +1,7 @@
[DEFAULT]
output_file = etc/dhcp_agent.ini.sample
wrap_width = 79
namespace = neutron.base.agent
namespace = neutron.dhcp.agent
namespace = oslo.log

View File

@ -0,0 +1,7 @@
[DEFAULT]
output_file = etc/l3_agent.ini.sample
wrap_width = 79
namespace = neutron.base.agent
namespace = neutron.l3.agent
namespace = oslo.log

View File

@ -0,0 +1,6 @@
[DEFAULT]
output_file = etc/neutron/plugins/ml2/linuxbridge_agent.ini.sample
wrap_width = 79
namespace = neutron.ml2.linuxbridge.agent
namespace = oslo.log

View File

@ -0,0 +1,6 @@
[DEFAULT]
output_file = etc/metadata_agent.ini.sample
wrap_width = 79
namespace = neutron.metadata.agent
namespace = oslo.log

View File

@ -0,0 +1,6 @@
[DEFAULT]
output_file = etc/metering_agent.ini.sample
wrap_width = 79
namespace = neutron.metering.agent
namespace = oslo.log

View File

@ -0,0 +1,6 @@
[DEFAULT]
output_file = etc/neutron/plugins/ml2/ml2_conf.ini.sample
wrap_width = 79
namespace = neutron.ml2
namespace = oslo.log

View File

@ -0,0 +1,6 @@
[DEFAULT]
output_file = etc/neutron/plugins/ml2/ml2_conf_sriov.ini.sample
wrap_width = 79
namespace = neutron.ml2.sriov
namespace = oslo.log

View File

@ -0,0 +1,18 @@
[DEFAULT]
output_file = etc/neutron.conf.sample
wrap_width = 79
namespace = neutron
namespace = neutron.agent
namespace = neutron.db
namespace = neutron.extensions
namespace = neutron.qos
namespace = nova.auth
namespace = oslo.log
namespace = oslo.db
namespace = oslo.policy
namespace = oslo.concurrency
namespace = oslo.messaging
namespace = oslo.service.sslutils
namespace = oslo.service.wsgi
namespace = keystonemiddleware.auth_token

View File

@ -0,0 +1,6 @@
[DEFAULT]
output_file = etc/neutron/plugins/ml2/openvswitch_agent.ini.sample
wrap_width = 79
namespace = neutron.ml2.ovs.agent
namespace = oslo.log

View File

@ -0,0 +1,6 @@
[DEFAULT]
output_file = etc/neutron/plugins/ml2/sriov_agent.ini.sample
wrap_width = 79
namespace = neutron.ml2.sriov.agent
namespace = oslo.log

View File

@ -26,11 +26,18 @@ LOG = logging.getLogger(__name__)
ROOT_HELPER_OPTS = [
cfg.StrOpt('root_helper', default='sudo',
help=_('Root helper application.')),
help=_("Root helper application. "
"Use 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf' "
"to use the real root filter facility. Change to 'sudo' "
"to skip the filtering and just run the command "
"directly.")),
cfg.BoolOpt('use_helper_for_ns_read',
default=True,
help=_('Use the root helper to read the namespaces from '
'the operating system.')),
help=_("Use the root helper when listing the namespaces on a "
"system. This may not be required depending on the "
"security configuration. If the root helper is "
"not required, set this to False for a performance "
"improvement.")),
# We can't just use root_helper=sudo neutron-rootwrap-daemon $cfg because
# it isn't appropriate for long-lived processes spawned with create_process
# Having a bool use_rootwrap_daemon option precludes specifying the
@ -55,7 +62,11 @@ INTERFACE_DRIVER_OPTS = [
IPTABLES_OPTS = [
cfg.BoolOpt('comment_iptables_rules', default=True,
help=_("Add comments to iptables rules.")),
help=_("Add comments to iptables rules. "
"Set to false to disallow the addition of comments to "
"generated iptables rules that describe each rule's "
"purpose. System must support the iptables comments "
"module for addition of comments.")),
]
PROCESS_MONITOR_OPTS = [
@ -74,6 +85,17 @@ AVAILABILITY_ZONE_OPTS = [
help=_("Availability zone of this node")),
]
EXT_NET_BRIDGE_OPTS = [
cfg.StrOpt('external_network_bridge', default='br-ex',
deprecated_for_removal=True,
help=_("Name of bridge used for external network "
"traffic. This should be set to an empty value for the "
"Linux Bridge. When this parameter is set, each L3 "
"agent can be associated with no more than one external "
"network. This option is deprecated and will be removed "
"in the M release.")),
]
def get_log_args(conf, log_file_name, **kwargs):
cmd_args = []

View File

@ -47,7 +47,9 @@ FAILMODE_STANDALONE = 'standalone'
OPTS = [
cfg.IntOpt('ovs_vsctl_timeout',
default=DEFAULT_OVS_VSCTL_TIMEOUT,
help=_('Timeout in seconds for ovs-vsctl commands')),
help=_('Timeout in seconds for ovs-vsctl commands. '
'If the timeout expires, ovs commands will fail with '
'ALARMCLOCK error.')),
]
cfg.CONF.register_opts(OPTS)

View File

@ -18,20 +18,43 @@ from oslo_config import cfg
DHCP_AGENT_OPTS = [
cfg.IntOpt('resync_interval', default=5,
help=_("Interval to resync.")),
help=_("The DHCP agent will resync its state with Neutron to "
"recover from any transient notification or RPC errors. "
"The interval is number of seconds between attempts.")),
cfg.StrOpt('dhcp_driver',
default='neutron.agent.linux.dhcp.Dnsmasq',
help=_("The driver used to manage the DHCP server.")),
cfg.BoolOpt('enable_isolated_metadata', default=False,
help=_("Support Metadata requests on isolated networks.")),
help=_("The DHCP server can assist with providing metadata "
"support on isolated networks. Setting this value to "
"True will cause the DHCP server to append specific "
"host routes to the DHCP request. The metadata service "
"will only be activated when the subnet does not "
"contain any router port. The guest instance must be "
"configured to request host routes via DHCP (Option "
"121). This option doesn't have any effect when "
"force_metadata is set to True.")),
cfg.BoolOpt('force_metadata', default=False,
help=_("Force to use DHCP to get Metadata on all networks.")),
help=_("In some cases the Neutron router is not present to "
"provide the metadata IP but the DHCP server can be "
"used to provide this info. Setting this value will "
"force the DHCP server to append specific host routes "
"to the DHCP request. If this option is set, then the "
"metadata service will be activated for all the "
"networks.")),
cfg.BoolOpt('enable_metadata_network', default=False,
help=_("Allows for serving metadata requests from a "
"dedicated network. Requires "
"enable_isolated_metadata = True")),
help=_("Allows for serving metadata requests coming from a "
"dedicated metadata access network whose CIDR is "
"169.254.169.254/16 (or larger prefix), and is "
"connected to a Neutron router from which the VMs send "
"metadata:1 request. In this case DHCP Option 121 will "
"not be injected in VMs, as they will be able to reach "
"169.254.169.254 through a router. This option "
"requires enable_isolated_metadata = True.")),
cfg.IntOpt('num_sync_threads', default=4,
help=_('Number of threads to use during sync process.'))
help=_('Number of threads to use during sync process. '
'Should not exceed connection pool size configured on '
'server.'))
]
DHCP_OPTS = [

View File

@ -16,6 +16,7 @@
from oslo_config import cfg
from neutron.agent.common import config
from neutron.common import constants
@ -36,11 +37,6 @@ OPTS = [
"with DVR. This mode must be used for an L3 agent "
"running on a centralized node (or in single-host "
"deployments, e.g. devstack)")),
cfg.StrOpt('external_network_bridge', default='br-ex',
deprecated_for_removal=True,
help=_("Name of bridge used for external network "
"traffic. This option is deprecated and will be removed "
"in the M release.")),
cfg.PortOpt('metadata_port',
default=9697,
help=_("TCP Port used by Neutron metadata namespace proxy.")),
@ -54,10 +50,19 @@ OPTS = [
"that has the matching router ID.")),
cfg.BoolOpt('handle_internal_only_routers',
default=True,
help=_("Agent should implement routers with no gateway")),
help=_("Indicates that this L3 agent should also handle "
"routers that do not have an external network gateway "
"configured. This option should be True only for a "
"single agent in a Neutron deployment, and may be "
"False for all agents if all routers must have an "
"external network gateway.")),
cfg.StrOpt('gateway_external_network_id', default='',
help=_("UUID of external network for routers implemented "
"by the agents.")),
help=_("When external_network_bridge is set, each L3 agent can "
"be associated with no more than one external network. "
"This value should be set to the UUID of that external "
"network. To allow L3 agent support multiple external "
"networks, both the external_network_bridge and "
"gateway_external_network_id must be left empty.")),
cfg.StrOpt('ipv6_gateway', default='',
help=_("With IPv6, the network used for the external gateway "
"does not need to have an associated subnet, since the "
@ -95,3 +100,5 @@ OPTS = [
'external network. This mark will be masked with '
'0xffff so that only the lower 16 bits will be used.')),
]
OPTS += config.EXT_NET_BRIDGE_OPTS

View File

@ -37,7 +37,10 @@ OPTS = [
help=_('Name of Open vSwitch bridge to use')),
cfg.BoolOpt('ovs_use_veth',
default=False,
help=_('Uses veth for an interface or not')),
help=_('Uses veth for an OVS interface or not. '
'Support kernels with limited namespace support '
'(e.g. RHEL 6.5) so long as ovs_use_veth is set to '
'True.')),
cfg.IntOpt('network_device_mtu',
help=_('MTU setting for device.')),
]

View File

@ -59,7 +59,12 @@ METADATA_PROXY_HANDLER_OPTS = [
help=_("TCP Port used by Nova metadata server.")),
cfg.StrOpt('metadata_proxy_shared_secret',
default='',
help=_('Shared secret to sign instance-id request'),
help=_('When proxying metadata requests, Neutron signs the '
'Instance-ID header with a shared secret to prevent '
'spoofing. You may select any string for a secret, '
'but it must match here and in the configuration used '
'by the Nova Metadata Server. NOTE: Nova uses the same '
'config key, but in [neutron] section.'),
secret=True),
cfg.StrOpt('nova_metadata_protocol',
default='http',

View File

@ -30,6 +30,10 @@ OPTS = [
choices=interface_map.keys(),
default='vsctl',
help=_('The interface for interacting with the OVSDB')),
cfg.StrOpt('ovsdb_connection',
default='tcp:127.0.0.1:6640',
help=_('The connection string for the native OVSDB backend. '
'Requires the native ovsdb_interface to be enabled.'))
]
cfg.CONF.register_opts(OPTS, 'OVS')

View File

@ -26,13 +26,6 @@ from neutron.agent.ovsdb.native import connection
from neutron.agent.ovsdb.native import idlutils
OPTS = [
cfg.StrOpt('ovsdb_connection',
default='tcp:127.0.0.1:6640',
help=_('The connection string for the native OVSDB backend')),
]
cfg.CONF.register_opts(OPTS, 'OVS')
# TODO(twilson) DEFAULT.ovs_vsctl_timeout should be OVS.vsctl_timeout
cfg.CONF.import_opt('ovs_vsctl_timeout', 'neutron.agent.common.ovs_lib')
LOG = logging.getLogger(__name__)

View File

@ -42,7 +42,9 @@ security_group_opts = [
cfg.BoolOpt(
'enable_ipset',
default=True,
help=_('Use ipset to speed-up the iptables based security groups.'))
help=_('Use ipset to speed-up the iptables based security groups. '
'Enabling ipset support requires that ipset is installed on L2 '
'agent node.'))
]
cfg.CONF.register_opts(security_group_opts, 'SECURITYGROUP')

View File

@ -42,7 +42,13 @@ core_opts = [
cfg.PortOpt('bind_port', default=9696,
help=_("The port to bind to")),
cfg.StrOpt('api_extensions_path', default="",
help=_("The path for API extensions")),
help=_("The path for API extensions. "
"Note that this can be a colon-separated list of paths. "
"For example: api_extensions_path = "
"extensions:/path/to/more/exts:/even/more/exts. "
"The __path__ of neutron.extensions is appended to "
"this, so if your extensions are in there you don't "
"need to specify them here.")),
cfg.StrOpt('auth_strategy', default='keystone',
help=_("The type of authentication to use")),
cfg.StrOpt('core_plugin',
@ -50,7 +56,10 @@ core_opts = [
cfg.ListOpt('service_plugins', default=[],
help=_("The service plugins Neutron will use")),
cfg.StrOpt('base_mac', default="fa:16:3e:00:00:00",
help=_("The base MAC address Neutron will use for VIFs")),
help=_("The base MAC address Neutron will use for VIFs. "
"The first 3 octets will remain unchanged. If the 4th "
"octet is not 00, it will also be used. The others "
"will be randomly generated.")),
cfg.IntOpt('mac_generation_retries', default=16,
help=_("How many times Neutron will retry MAC generation")),
cfg.BoolOpt('allow_bulk', default=True,
@ -74,7 +83,7 @@ core_opts = [
"considered for high availability while scheduling "
"the resource.")),
cfg.IntOpt('max_dns_nameservers', default=5,
help=_("Maximum number of DNS nameservers")),
help=_("Maximum number of DNS nameservers per subnet")),
cfg.IntOpt('max_subnet_host_routes', default=20,
help=_("Maximum number of host routes per subnet")),
cfg.IntOpt('max_fixed_ips_per_port', default=5,
@ -83,16 +92,35 @@ core_opts = [
"is deprecated and will be removed in the N "
"release.")),
cfg.StrOpt('default_ipv4_subnet_pool', deprecated_for_removal=True,
help=_("Default IPv4 subnet-pool to be used for automatic "
"subnet CIDR allocation. This option is deprecated for "
"removal in the N release.")),
help=_("Default IPv4 subnet pool to be used for automatic "
"subnet CIDR allocation. "
"Specifies by UUID the pool to be used in case where "
"creation of a subnet is being called without a "
"subnet pool ID. If not set then no pool "
"will be used unless passed explicitly to the subnet "
"create. If no pool is used, then a CIDR must be passed "
"to create a subnet and that subnet will not be "
"allocated from any pool; it will be considered part of "
"the tenant's private address space. This option is "
"deprecated for removal in the N release.")),
cfg.StrOpt('default_ipv6_subnet_pool', deprecated_for_removal=True,
help=_("Default IPv6 subnet-pool to be used for automatic "
"subnet CIDR allocation. This option is deprecated for "
"removal in the N release.")),
help=_("Default IPv6 subnet pool to be used for automatic "
"subnet CIDR allocation. "
"Specifies by UUID the pool to be used in case where "
"creation of a subnet is being called without a "
"subnet pool ID. See the description for "
"default_ipv4_subnet_pool for more information. This "
"option is deprecated for removal in the N release.")),
cfg.BoolOpt('ipv6_pd_enabled', default=False,
help=_("Enables IPv6 Prefix Delegation for automatic subnet "
"CIDR allocation")),
"CIDR allocation. "
"Set to True to enable IPv6 Prefix Delegation for "
"subnet allocation in a PD-capable environment. Users "
"making subnet creation requests for IPv6 subnets "
"without providing a CIDR or subnetpool ID will be "
"given a CIDR via the Prefix Delegation mechanism. "
"Note that enabling PD will override the behavior of "
"the default IPv6 subnetpool.")),
cfg.IntOpt('dhcp_lease_duration', default=86400,
deprecated_name='dhcp_lease_time',
help=_("DHCP lease duration (in seconds). Use -1 to tell "
@ -104,9 +132,13 @@ core_opts = [
help=_("Allow sending resource operation"
" notification to DHCP agent")),
cfg.BoolOpt('allow_overlapping_ips', default=False,
help=_("Allow overlapping IP support in Neutron")),
help=_("Allow overlapping IP support in Neutron. "
"Attention: the following parameter MUST be set to "
"False if Neutron is being used in conjunction with "
"Nova security groups.")),
cfg.StrOpt('host', default=utils.get_hostname(),
help=_("Hostname to be used by the neutron server, agents and "
sample_default='example.domain',
help=_("Hostname to be used by the Neutron server, agents and "
"services running on this machine. All the agents and "
"services running on this machine must use the same "
"host value.")),
@ -127,7 +159,11 @@ core_opts = [
'to VMs via network methods (DHCP and RA MTU options) '
'when the network\'s preferred MTU is known.')),
cfg.StrOpt('ipam_driver',
help=_('IPAM driver to use.')),
help=_("Neutron IPAM (IP address management) driver to use. "
"If ipam_driver is not set (default behavior), no IPAM "
"driver is used. In order to use the reference "
"implementation of Neutron IPAM driver, "
"use 'internal'.")),
cfg.BoolOpt('vlan_transparent', default=False,
help=_('If True, then allow plugins that support it to '
'create VLAN transparent networks.')),

View File

@ -33,7 +33,7 @@ LOG = logging.getLogger(__name__)
extra_route_opts = [
#TODO(nati): use quota framework when it support quota for attributes
cfg.IntOpt('max_routes', default=30,
help=_("Maximum number of routes")),
help=_("Maximum number of routes per router")),
]
cfg.CONF.register_opts(extra_route_opts)

View File

@ -50,12 +50,14 @@ L3_HA_OPTS = [
help=_('Enable HA mode for virtual routers.')),
cfg.IntOpt('max_l3_agents_per_router',
default=3,
help=_('Maximum number of agents on which a router will be '
'scheduled.')),
help=_("Maximum number of L3 agents which a HA router will be "
"scheduled on. If it is set to 0 then the router will "
"be scheduled on every agent.")),
cfg.IntOpt('min_l3_agents_per_router',
default=constants.MINIMUM_AGENTS_FOR_HA,
help=_('Minimum number of agents on which a router will be '
'scheduled.')),
help=_("Minimum number of L3 agents which a HA router will be "
"scheduled on. If it is set to 0 then the router will "
"be scheduled on every agent.")),
cfg.StrOpt('l3_ha_net_cidr',
default='169.254.192.0/18',
help=_('Subnet used for the l3 HA admin network.')),

View File

@ -98,7 +98,8 @@ _db_opts = [
help=_('URL to database')),
cfg.StrOpt('engine',
default='',
help=_('Database engine')),
help=_('Database engine for which script will be generated '
'when using offline migration.')),
]
CONF = cfg.ConfigOpts()
@ -679,6 +680,10 @@ def validate_cli_options():
alembic_util.err(_("Cannot specify both --service and --subproject."))
def get_engine_config():
return [obj for obj in _db_opts if obj.name == 'engine']
def main():
CONF(project='neutron')
validate_cli_options()

View File

@ -17,7 +17,6 @@ import shlex
import socket
import netaddr
from oslo_config import cfg
from oslo_log import log as logging
from neutron.agent.linux import dhcp
@ -35,15 +34,6 @@ DEVICE_OWNER_COMPUTE_PROBE = constants.DEVICE_OWNER_COMPUTE_PREFIX + 'probe'
class NeutronDebugAgent(object):
OPTS = [
# Needed for drivers
cfg.StrOpt('external_network_bridge', default='br-ex',
deprecated_for_removal=True,
help=_("Name of bridge used for external network "
"traffic. This option is deprecated and will be "
"removed in the M release.")),
]
def __init__(self, conf, client, driver):
self.conf = conf
self.client = client

View File

@ -71,7 +71,7 @@ class NeutronDebugShell(shell.NeutronShell):
" either --config-file or env[NEUTRON_TEST_CONFIG_FILE]"))
client = self.client_manager.neutron
cfg.CONF.register_opts(interface.OPTS)
cfg.CONF.register_opts(debug_agent.NeutronDebugAgent.OPTS)
cfg.CONF.register_opts(config.EXT_NET_BRIDGE_OPTS)
config.register_interface_driver_opts_helper(cfg.CONF)
cfg.CONF(['--config-file', self.options.config_file])
config.setup_logging()

287
neutron/opts.py Normal file
View File

@ -0,0 +1,287 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import copy
import itertools
import operator
from keystoneclient import auth
from keystoneclient import session
from oslo_config import cfg
import neutron.agent.common.config
import neutron.agent.common.ovs_lib
import neutron.agent.dhcp.config
import neutron.agent.l2.extensions.manager
import neutron.agent.l3.config
import neutron.agent.l3.ha
import neutron.agent.linux.interface
import neutron.agent.metadata.config
import neutron.agent.ovsdb.api
import neutron.agent.securitygroups_rpc
import neutron.db.agents_db
import neutron.db.agentschedulers_db
import neutron.db.dvr_mac_db
import neutron.db.extraroute_db
import neutron.db.l3_agentschedulers_db
import neutron.db.l3_dvr_db
import neutron.db.l3_gwmode_db
import neutron.db.l3_hamode_db
import neutron.db.migration.cli
import neutron.extensions.allowedaddresspairs
import neutron.extensions.l3
import neutron.extensions.securitygroup
import neutron.openstack.common.cache.cache
import neutron.plugins.ml2.config
import neutron.plugins.ml2.drivers.linuxbridge.agent.common.config
import neutron.plugins.ml2.drivers.mech_sriov.agent.common.config
import neutron.plugins.ml2.drivers.mech_sriov.mech_driver.mech_driver
import neutron.plugins.ml2.drivers.openvswitch.agent.common.config
import neutron.plugins.ml2.drivers.type_flat
import neutron.plugins.ml2.drivers.type_geneve
import neutron.plugins.ml2.drivers.type_gre
import neutron.plugins.ml2.drivers.type_vlan
import neutron.plugins.ml2.drivers.type_vxlan
import neutron.quota
import neutron.service
import neutron.services.metering.agents.metering_agent
import neutron.services.qos.notification_drivers.manager
import neutron.wsgi
NOVA_GROUP = 'nova'
CONF = cfg.CONF
deprecations = {'nova.cafile': [cfg.DeprecatedOpt('ca_certificates_file',
group=NOVA_GROUP)],
'nova.insecure': [cfg.DeprecatedOpt('api_insecure',
group=NOVA_GROUP)],
'nova.timeout': [cfg.DeprecatedOpt('url_timeout',
group=NOVA_GROUP)]}
_nova_options = session.Session.register_conf_options(
CONF, NOVA_GROUP, deprecated_opts=deprecations)
def list_agent_opts():
return [
('agent',
itertools.chain(
neutron.agent.common.config.ROOT_HELPER_OPTS,
neutron.agent.common.config.AGENT_STATE_OPTS,
neutron.agent.common.config.IPTABLES_OPTS,
neutron.agent.common.config.PROCESS_MONITOR_OPTS,
neutron.agent.common.config.AVAILABILITY_ZONE_OPTS)
),
('DEFAULT',
itertools.chain(
neutron.agent.common.config.INTERFACE_DRIVER_OPTS,
neutron.agent.metadata.config.SHARED_OPTS,
neutron.agent.metadata.config.DRIVER_OPTS)
)
]
def list_extension_opts():
return [
('DEFAULT',
neutron.extensions.allowedaddresspairs.allowed_address_pair_opts),
('quotas',
itertools.chain(
neutron.extensions.l3.l3_quota_opts,
neutron.extensions.securitygroup.security_group_quota_opts)
)
]
def list_db_opts():
return [
('DEFAULT',
itertools.chain(
neutron.db.agents_db.AGENT_OPTS,
neutron.db.extraroute_db.extra_route_opts,
neutron.db.l3_gwmode_db.OPTS,
neutron.db.agentschedulers_db.AGENTS_SCHEDULER_OPTS,
neutron.db.dvr_mac_db.dvr_mac_address_opts,
neutron.db.l3_dvr_db.router_distributed_opts,
neutron.db.l3_agentschedulers_db.L3_AGENTS_SCHEDULER_OPTS,
neutron.db.l3_hamode_db.L3_HA_OPTS)
),
('database',
neutron.db.migration.cli.get_engine_config())
]
def list_opts():
return [
('DEFAULT',
itertools.chain(
neutron.common.config.core_cli_opts,
neutron.common.config.core_opts,
neutron.wsgi.socket_opts,
neutron.service.service_opts)
),
(neutron.common.config.NOVA_CONF_SECTION,
itertools.chain(
neutron.common.config.nova_opts)
),
('quotas', neutron.quota.quota_opts)
]
def list_qos_opts():
return [
('DEFAULT',
neutron.services.qos.notification_drivers.manager.QOS_PLUGIN_OPTS)
]
def list_base_agent_opts():
return [
('DEFAULT',
itertools.chain(
neutron.agent.linux.interface.OPTS,
neutron.agent.common.config.INTERFACE_DRIVER_OPTS,
neutron.agent.common.ovs_lib.OPTS)
),
('AGENT', neutron.agent.common.config.AGENT_STATE_OPTS)
]
def list_dhcp_agent_opts():
return [
('DEFAULT',
itertools.chain(
neutron.agent.dhcp.config.DHCP_AGENT_OPTS,
neutron.agent.dhcp.config.DHCP_OPTS,
neutron.agent.dhcp.config.DNSMASQ_OPTS)
)
]
def list_linux_bridge_opts():
return [
('linux_bridge',
neutron.plugins.ml2.drivers.linuxbridge.agent.common.config.
bridge_opts),
('vxlan',
neutron.plugins.ml2.drivers.linuxbridge.agent.common.config.
vxlan_opts),
('agent',
neutron.plugins.ml2.drivers.linuxbridge.agent.common.config.
agent_opts),
('securitygroup',
neutron.agent.securitygroups_rpc.security_group_opts)
]
def list_l3_agent_opts():
return [
('DEFAULT',
itertools.chain(
neutron.agent.l3.config.OPTS,
neutron.service.service_opts,
neutron.agent.l3.ha.OPTS)
)
]
def list_metadata_agent_opts():
return [
('DEFAULT',
itertools.chain(
neutron.agent.metadata.config.SHARED_OPTS,
neutron.agent.metadata.config.METADATA_PROXY_HANDLER_OPTS,
neutron.agent.metadata.config.UNIX_DOMAIN_METADATA_PROXY_OPTS,
neutron.openstack.common.cache.cache._get_oslo_configs())
),
('AGENT', neutron.agent.common.config.AGENT_STATE_OPTS)
]
def list_metering_agent_opts():
return [
('DEFAULT',
itertools.chain(
neutron.services.metering.agents.metering_agent.MeteringAgent.
Opts,
neutron.agent.common.config.INTERFACE_DRIVER_OPTS)
)
]
def list_ml2_conf_opts():
return [
('ml2',
neutron.plugins.ml2.config.ml2_opts),
('ml2_type_flat',
neutron.plugins.ml2.drivers.type_flat.flat_opts),
('ml2_type_vlan',
neutron.plugins.ml2.drivers.type_vlan.vlan_opts),
('ml2_type_gre',
neutron.plugins.ml2.drivers.type_gre.gre_opts),
('ml2_type_vxlan',
neutron.plugins.ml2.drivers.type_vxlan.vxlan_opts),
('ml2_type_geneve',
neutron.plugins.ml2.drivers.type_geneve.geneve_opts),
('securitygroup',
neutron.agent.securitygroups_rpc.security_group_opts)
]
def list_ml2_conf_sriov_opts():
return [
('ml2_sriov',
neutron.plugins.ml2.drivers.mech_sriov.mech_driver.mech_driver.
sriov_opts)
]
def list_ovs_opts():
return [
('ovs',
itertools.chain(
neutron.plugins.ml2.drivers.openvswitch.agent.common.config.
ovs_opts,
neutron.agent.ovsdb.api.OPTS)
),
('agent',
neutron.plugins.ml2.drivers.openvswitch.agent.common.config.
agent_opts),
('securitygroup',
neutron.agent.securitygroups_rpc.security_group_opts)
]
def list_sriov_agent_opts():
return [
('ml2_sriov',
neutron.plugins.ml2.drivers.mech_sriov.agent.common.config.
sriov_nic_opts),
('agent',
neutron.agent.l2.extensions.manager.L2_AGENT_EXT_MANAGER_OPTS)
]
def list_auth_opts():
opt_list = copy.deepcopy(_nova_options)
opt_list.insert(0, auth.get_common_conf_options()[0])
# NOTE(mhickey): There are a lot of auth plugins, we just generate
# the config options for a few common ones
plugins = ['password', 'v2password', 'v3password']
for name in plugins:
for plugin_option in auth.get_plugin_class(name).get_options():
if all(option.name != plugin_option.name for option in opt_list):
opt_list.append(plugin_option)
opt_list.sort(key=operator.attrgetter('name'))
return [(NOVA_GROUP, opt_list)]

View File

@ -24,7 +24,9 @@ ml2_opts = [
cfg.ListOpt('tenant_network_types',
default=['local'],
help=_("Ordered list of network_types to allocate as tenant "
"networks.")),
"networks. The default value 'local' is useful for "
"single-box testing but provides no connectivity "
"between hosts.")),
cfg.ListOpt('mechanism_drivers',
default=[],
help=_("An ordered list of networking mechanism driver "
@ -39,12 +41,17 @@ ml2_opts = [
cfg.IntOpt('path_mtu', default=0,
help=_('The maximum permissible size of an unfragmented '
'packet travelling from and to addresses where '
'encapsulated Neutron traffic is sent. If <= 0, '
'the path MTU is indeterminate.')),
'encapsulated Neutron traffic is sent. '
'Drivers calculate maximum viable MTU for validating '
'tenant requests based on this value (typically, '
'path_mtu - maxmum encapsulation header size). If <= 0, '
'the path MTU is indeterminate and no calculation '
'takes place.')),
cfg.IntOpt('segment_mtu', default=0,
help=_('The maximum permissible size of an unfragmented '
'packet travelling a L2 network segment. If <= 0, the '
'segment MTU is indeterminate.')),
'segment MTU is indeterminate and no calculation takes '
'place.')),
cfg.ListOpt('physical_network_mtus',
default=[],
help=_("A list of mappings of physical networks to MTU "

View File

@ -33,7 +33,10 @@ vxlan_opts = [
cfg.StrOpt('vxlan_group', default=DEFAULT_VXLAN_GROUP,
help=_("Multicast group(s) for vxlan interface. A range of "
"group addresses may be specified by using CIDR "
"notation. To reserve a unique group for each possible "
"notation. Specifying a range allows different VNIs to "
"use different group addresses, reducing or eliminating "
"spurious broadcast traffic to the tunnel endpoints. "
"To reserve a unique group for each possible "
"(24-bit) VNI, use a /8 such as 239.0.0.0/8. This "
"setting must be the same on all the agents.")),
cfg.IPOpt('local_ip', version=4,
@ -47,7 +50,14 @@ vxlan_opts = [
bridge_opts = [
cfg.ListOpt('physical_interface_mappings',
default=DEFAULT_INTERFACE_MAPPINGS,
help=_("List of <physical_network>:<physical_interface>")),
help=_("Comma-separated list of "
"<physical_network>:<physical_interface> tuples "
"mapping physical network names to the agent's "
"node-specific physical network interfaces to be used "
"for flat and VLAN networks. All physical networks "
"listed in network_vlan_ranges on the server should "
"have mappings to appropriate interfaces on each "
"agent.")),
cfg.ListOpt('bridge_mappings',
default=DEFAULT_BRIDGE_MAPPINGS,
help=_("List of <physical_network>:<physical_bridge>")),

View File

@ -62,23 +62,25 @@ agent_opts = [
sriov_nic_opts = [
cfg.ListOpt('physical_device_mappings',
default=DEFAULT_DEVICE_MAPPINGS,
help=_("List of <physical_network>:<network_device> mapping "
help=_("Comma-separated list of "
"<physical_network>:<network_device> tuples mapping "
"physical network names to the agent's node-specific "
"physical network device of SR-IOV physical "
"function to be used for VLAN networks. "
"All physical networks listed in network_vlan_ranges "
"on the server should have mappings to appropriate "
"interfaces on each agent")),
"physical network device interfaces of SR-IOV physical "
"function to be used for VLAN networks. All physical "
"networks listed in network_vlan_ranges on the server "
"should have mappings to appropriate interfaces on "
"each agent.")),
cfg.ListOpt('exclude_devices',
default=DEFAULT_EXCLUDE_DEVICES,
help=_("List of <network_device>:<excluded_devices> "
"mapping network_device to the agent's node-specific "
"list of virtual functions that should not be used "
"for virtual networking. excluded_devices is a "
"semicolon separated list of virtual functions "
"(BDF format).to exclude from network_device. "
"The network_device in the mapping should appear in "
"the physical_device_mappings list.")),
help=_("Comma-separated list of "
"<network_device>:<vfs_to_exclude> tuples, mapping "
"network_device to the agent's node-specific list of "
"virtual functions that should not be used for virtual "
"networking. vfs_to_exclude is a semicolon-separated "
"list of virtual functions to exclude from "
"network_device. The network_device in the mapping "
"should appear in the physical_device_mappings "
"list.")),
]

View File

@ -34,10 +34,10 @@ FLAT_VLAN = 0
sriov_opts = [
cfg.ListOpt('supported_pci_vendor_devs',
default=['15b3:1004', '8086:10ca'],
help=_("Supported PCI vendor devices, defined by "
"vendor_id:product_id according to the PCI ID "
"Repository. Default enables support for Intel "
"and Mellanox SR-IOV capable NICs")),
help=_("Comma-separated list of supported PCI vendor devices, "
"as defined by vendor_id:product_id according to the "
"PCI ID Repository. Default enables support for Intel "
"and Mellanox SR-IOV capable NICs.")),
]
cfg.CONF.register_opts(sriov_opts, "ml2_sriov")

View File

@ -28,7 +28,13 @@ DEFAULT_TUNNEL_TYPES = []
ovs_opts = [
cfg.StrOpt('integration_bridge', default='br-int',
help=_("Integration bridge to use.")),
help=_("Integration bridge to use. "
"Do not change this parameter unless you have a good "
"reason to. This is the name of the OVS integration "
"bridge. There is one per hypervisor. The integration "
"bridge acts as a virtual 'patch bay'. All VM VIFs are "
"attached to this bridge and then 'patched' according "
"to their network connectivity.")),
cfg.StrOpt('tunnel_bridge', default='br-tun',
help=_("Tunnel bridge to use.")),
cfg.StrOpt('int_peer_patch_port', default='patch-tun',
@ -41,18 +47,33 @@ ovs_opts = [
help=_("Local IP address of tunnel endpoint.")),
cfg.ListOpt('bridge_mappings',
default=DEFAULT_BRIDGE_MAPPINGS,
help=_("List of <physical_network>:<bridge>. "
"Deprecated for ofagent.")),
help=_("Comma-separated list of <physical_network>:<bridge> "
"tuples mapping physical network names to the agent's "
"node-specific Open vSwitch bridge names to be used "
"for flat and VLAN networks. The length of bridge "
"names should be no more than 11. Each bridge must "
"exist, and should have a physical network interface "
"configured as a port. All physical networks "
"configured on the server should have mappings to "
"appropriate bridges on each agent. "
"Note: If you remove a bridge from this "
"mapping, make sure to disconnect it from the "
"integration bridge as it won't be managed by the "
"agent anymore. Deprecated for ofagent.")),
cfg.BoolOpt('use_veth_interconnection', default=False,
help=_("Use veths instead of patch ports to interconnect the "
"integration bridge to physical bridges.")),
"integration bridge to physical networks. "
"Support kernel without Open vSwitch patch port "
"support so long as it is set to True.")),
cfg.StrOpt('of_interface', default='ovs-ofctl',
choices=['ovs-ofctl', 'native'],
help=_("OpenFlow interface to use.")),
cfg.StrOpt('datapath_type', default=constants.OVS_DATAPATH_SYSTEM,
choices=[constants.OVS_DATAPATH_SYSTEM,
constants.OVS_DATAPATH_NETDEV],
help=_("OVS datapath to use.")),
help=_("OVS datapath to use. 'system' is the default value and "
"corresponds to the kernel datapath. To enable the "
"userspace datapath set this value to 'netdev'.")),
cfg.StrOpt('vhostuser_socket_dir', default=constants.VHOST_USER_SOCKET_DIR,
help=_("OVS vhost-user socket directory.")),
cfg.IPOpt('of_listen_address', default='127.0.0.1',

View File

@ -36,9 +36,12 @@ geneve_opts = [
default=p_const.GENEVE_ENCAP_MIN_OVERHEAD,
help=_("Geneve encapsulation header size is dynamic, this "
"value is used to calculate the maximum MTU "
"for the driver."
"this is the sum of the sizes of the outer "
"ETH + IP + UDP + GENEVE header sizes")),
"for the driver. "
"This is the sum of the sizes of the outer "
"ETH + IP + UDP + GENEVE header sizes. "
"The default size for this field is 50, which is the "
"size of the Geneve header without any additional "
"option headers.")),
]
cfg.CONF.register_opts(geneve_opts, "ml2_type_geneve")

View File

@ -33,8 +33,10 @@ vxlan_opts = [
"enumerating ranges of VXLAN VNI IDs that are "
"available for tenant network allocation")),
cfg.StrOpt('vxlan_group',
help=_("Multicast group for VXLAN. If unset, disables VXLAN "
"multicast mode.")),
help=_("Multicast group for VXLAN. When configured, will "
"enable sending all broadcast traffic to this multicast "
"group. When left unconfigured, will disable multicast "
"VXLAN mode.")),
]
cfg.CONF.register_opts(vxlan_opts, "ml2_type_vxlan")

View File

@ -35,7 +35,7 @@ class TestDebugCommands(base.BaseTestCase):
def setUp(self):
super(TestDebugCommands, self).setUp()
cfg.CONF.register_opts(interface.OPTS)
cfg.CONF.register_opts(debug_agent.NeutronDebugAgent.OPTS)
cfg.CONF.register_opts(config.EXT_NET_BRIDGE_OPTS)
common_config.init([])
config.register_interface_driver_opts_helper(cfg.CONF)

View File

@ -0,0 +1,7 @@
---
prelude: >
Generation of sample Neutron core configuration files.
features:
- Neutron no longer includes static example configuration files. Instead,
use tools/generate_config_file_samples.sh to generate them. The files are
generated with a .sample extension.

View File

@ -149,6 +149,23 @@ oslo.messaging.notify.drivers =
neutron.openstack.common.notifier.test_notifier = oslo_messaging.notify._impl_test:TestDriver
neutron.openstack.common.notifier.rpc_notifier2 = oslo_messaging.notify.messaging:MessagingV2Driver
neutron.openstack.common.notifier.rpc_notifier = oslo_messaging.notify.messaging:MessagingDriver
oslo.config.opts =
neutron = neutron.opts:list_opts
neutron.agent = neutron.opts:list_agent_opts
neutron.base.agent = neutron.opts:list_base_agent_opts
neutron.db = neutron.opts:list_db_opts
neutron.dhcp.agent = neutron.opts:list_dhcp_agent_opts
neutron.extensions = neutron.opts:list_extension_opts
neutron.l3.agent = neutron.opts:list_l3_agent_opts
neutron.metadata.agent = neutron.opts:list_metadata_agent_opts
neutron.metering.agent = neutron.opts:list_metering_agent_opts
neutron.ml2 = neutron.opts:list_ml2_conf_opts
neutron.ml2.linuxbridge.agent = neutron.opts:list_linux_bridge_opts
neutron.ml2.ovs.agent = neutron.opts:list_ovs_opts
neutron.ml2.sriov = neutron.opts:list_ml2_conf_sriov_opts
neutron.ml2.sriov.agent = neutron.opts:list_sriov_agent_opts
neutron.qos = neutron.opts:list_qos_opts
nova.auth = neutron.opts:list_auth_opts
neutron.db.alembic_migrations =
neutron = neutron.db.migration:alembic_migrations
neutron.interface_drivers =

View File

@ -0,0 +1,28 @@
#!/bin/sh
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
set -e
GEN_CMD=oslo-config-generator
if ! type "$GEN_CMD" > /dev/null; then
echo "ERROR: $GEN_CMD not installed on the system."
exit 1
fi
for file in `ls etc/oslo-config-generator/*`; do
$GEN_CMD --config-file=$file
done
set -x

View File

@ -108,6 +108,7 @@ commands=
flake8
sh ./tools/coding-checks.sh --pylint '{posargs}'
neutron-db-manage --config-file neutron/tests/etc/neutron.conf check_migration
{[testenv:genconfig]commands}
whitelist_externals =
sh
bash
@ -125,6 +126,7 @@ commands=
flake8
sh ./tools/coding-checks.sh --pylint '{posargs}'
neutron-db-manage --config-file neutron/tests/etc/neutron.conf check_migration
{[testenv:genconfig]commands}
whitelist_externals = {[testenv:pep8]whitelist_externals}
[testenv:cover]
@ -171,3 +173,6 @@ exclude = ./.*,build,dist,neutron/openstack/common/*,neutron/tests/tempest
[hacking]
import_exceptions = neutron.i18n
local-check-factory = neutron.hacking.checks.factory
[testenv:genconfig]
commands = {toxinidir}/tools/generate_config_file_samples.sh