1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3
# Copyright 2012 Nicira, Inc.
5
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6
# not use this file except in compliance with the License. You may obtain
7
# a copy of the License at
9
# http://www.apache.org/licenses/LICENSE-2.0
11
# Unless required by applicable law or agreed to in writing, software
12
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
# License for the specific language governing permissions and limitations
17
from oslo.config import cfg
19
from quantum import scheduler
22
cfg.IntOpt('max_lp_per_bridged_ls', default=64,
23
help=_("Maximum number of ports of a logical switch on a "
24
"bridged transport zone (default 64)")),
25
cfg.IntOpt('max_lp_per_overlay_ls', default=256,
26
help=_("Maximum number of ports of a logical switch on an "
27
"overlay transport zone (default 64)")),
28
cfg.IntOpt('concurrent_connections', default=5,
29
help=_("Maximum concurrent connections")),
30
cfg.IntOpt('nvp_gen_timeout', default=-1,
31
help=_("Number of seconds a generation id should be valid for "
32
"(default -1 meaning do not time out)")),
33
cfg.StrOpt('metadata_mode', default='access_network',
34
help=_("If set to access_network this enables a dedicated "
35
"connection to the metadata proxy for metadata server "
36
"access via Quantum router. If set to dhcp_host_route "
37
"this enables host route injection via the dhcp agent. "
38
"This option is only useful if running on a host that "
39
"does not support namespaces otherwise access_network "
41
cfg.BoolOpt('enable_metadata_access_network', default=True,
42
help=_("Enables dedicated connection to the metadata proxy "
43
"for metadata server access via Quantum router")),
44
cfg.StrOpt('default_transport_type', default='stt',
45
help=_("The default network tranport type to use (stt, gre, "
46
"bridge, ipsec_gre, or ipsec_stt)")),
50
cfg.StrOpt('nvp_user',
52
help=_('User name for NVP controllers in this cluster')),
53
cfg.StrOpt('nvp_password',
56
help=_('Password for NVP controllers in this cluster')),
57
cfg.IntOpt('req_timeout',
59
help=_('Total time limit for a cluster request')),
60
cfg.IntOpt('http_timeout',
62
help=_('Time before aborting a request')),
65
help=_('Number of time a request should be retried')),
66
cfg.IntOpt('redirects',
68
help=_('Number of times a redirect should be followed')),
69
cfg.ListOpt('nvp_controllers',
70
help=_("Lists the NVP controllers in this cluster")),
74
cfg.StrOpt('default_tz_uuid',
75
help=_("This is uuid of the default NVP Transport zone that "
76
"will be used for creating tunneled isolated "
77
"\"Quantum\" networks. It needs to be created in NVP "
78
"before starting Quantum with the nvp plugin.")),
79
cfg.StrOpt('nvp_cluster_uuid',
80
help=_("Optional paramter identifying the UUID of the cluster "
81
"in NVP. This can be retrieved from NVP management "
82
"console \"admin\" section.")),
83
cfg.StrOpt('default_l3_gw_service_uuid',
84
help=_("Unique identifier of the NVP L3 Gateway service "
85
"which will be used for implementing routers and "
87
cfg.StrOpt('default_l2_gw_service_uuid',
88
help=_("Unique identifier of the NVP L2 Gateway service "
89
"which will be used by default for network gateways")),
90
cfg.StrOpt('default_interface_name', default='breth0',
91
help=_("Name of the interface on a L2 Gateway transport node"
92
"which should be used by default when setting up a "
93
"network connection")),
96
# Register the configuration options
97
cfg.CONF.register_opts(connection_opts)
98
cfg.CONF.register_opts(cluster_opts)
99
cfg.CONF.register_opts(nvp_opts, "NVP")
100
cfg.CONF.register_opts(scheduler.AGENTS_SCHEDULER_OPTS)
101
# NOTE(armando-migliaccio): keep the following code until we support
102
# NVP configuration files in older format (Grizzly or older).
104
controller_depr = cfg.MultiStrOpt('nvp_controller_connection',
105
help=_("Describes a connection to a single "
106
"controller. A different connection "
107
"for each controller in the cluster "
108
"can be specified; there must be at "
109
"least one connection per cluster."))
111
host_route_depr = cfg.BoolOpt('metadata_dhcp_host_route', default=None)
114
def register_deprecated(conf):
115
conf.register_opts([host_route_depr])
116
multi_parser = cfg.MultiConfigParser()
117
read_ok = multi_parser.read(conf.config_file)
118
if len(read_ok) != len(conf.config_file):
119
raise cfg.Error("Some config files were not parsed properly")
121
for parsed_file in multi_parser.parsed:
122
for section in parsed_file.keys():
123
if section not in conf and section.startswith("CLUSTER:"):
124
conf.register_opts(cluster_opts + [controller_depr], section)