~ubuntu-branches/ubuntu/saucy/quantum/saucy

« back to all changes in this revision

Viewing changes to quantum/plugins/nicira/common/config.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2013-05-31 09:37:25 UTC
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20130531093725-09i9oem8a2xlw442
Tags: upstream-2013.2~b1
ImportĀ upstreamĀ versionĀ 2013.2~b1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
 
2
 
 
3
# Copyright 2012 Nicira, Inc.
 
4
#
 
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
 
8
#
 
9
#         http://www.apache.org/licenses/LICENSE-2.0
 
10
#
 
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
 
15
#    under the License.
 
16
 
 
17
from oslo.config import cfg
 
18
 
 
19
from quantum import scheduler
 
20
 
 
21
nvp_opts = [
 
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 "
 
40
                      "should be used.")),
 
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)")),
 
47
]
 
48
 
 
49
connection_opts = [
 
50
    cfg.StrOpt('nvp_user',
 
51
               default='admin',
 
52
               help=_('User name for NVP controllers in this cluster')),
 
53
    cfg.StrOpt('nvp_password',
 
54
               default='admin',
 
55
               secret=True,
 
56
               help=_('Password for NVP controllers in this cluster')),
 
57
    cfg.IntOpt('req_timeout',
 
58
               default=30,
 
59
               help=_('Total time limit for a cluster request')),
 
60
    cfg.IntOpt('http_timeout',
 
61
               default=10,
 
62
               help=_('Time before aborting a request')),
 
63
    cfg.IntOpt('retries',
 
64
               default=2,
 
65
               help=_('Number of time a request should be retried')),
 
66
    cfg.IntOpt('redirects',
 
67
               default=2,
 
68
               help=_('Number of times a redirect should be followed')),
 
69
    cfg.ListOpt('nvp_controllers',
 
70
                help=_("Lists the NVP controllers in this cluster")),
 
71
]
 
72
 
 
73
cluster_opts = [
 
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 "
 
86
                      "floating IPs")),
 
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")),
 
94
]
 
95
 
 
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).
 
103
# ### BEGIN
 
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."))
 
110
 
 
111
host_route_depr = cfg.BoolOpt('metadata_dhcp_host_route', default=None)
 
112
 
 
113
 
 
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")
 
120
 
 
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)
 
125
# ### END