diff --git a/nova/baserpc.py b/nova/baserpc.py index 95336a9da648..d51281ec1a10 100644 --- a/nova/baserpc.py +++ b/nova/baserpc.py @@ -18,18 +18,14 @@ Base RPC client and server common to all services. """ -from oslo_config import cfg import oslo_messaging as messaging from oslo_serialization import jsonutils +import nova.conf from nova import rpc -CONF = cfg.CONF -rpcapi_cap_opt = cfg.StrOpt('baseapi', - help='Set a version cap for messages sent to the base api in any ' - 'service') -CONF.register_opt(rpcapi_cap_opt, 'upgrade_levels') +CONF = nova.conf.CONF _NAMESPACE = 'baseapi' diff --git a/nova/compute/opts.py b/nova/compute/opts.py index 8f90ff662c56..9b4788642517 100644 --- a/nova/compute/opts.py +++ b/nova/compute/opts.py @@ -31,8 +31,4 @@ def list_opts(): nova.compute.manager.timeout_opts, nova.compute.rpcapi.rpcapi_opts, )), - ('upgrade_levels', - itertools.chain( - [nova.compute.rpcapi.rpcapi_cap_opt], - )), ] diff --git a/nova/compute/rpcapi.py b/nova/compute/rpcapi.py index dc63973710f6..24e346f4b20a 100644 --- a/nova/compute/rpcapi.py +++ b/nova/compute/rpcapi.py @@ -20,6 +20,7 @@ from oslo_log import log as logging import oslo_messaging as messaging from oslo_serialization import jsonutils +import nova.conf from nova import context from nova import exception from nova.i18n import _, _LI, _LE @@ -35,24 +36,9 @@ rpcapi_opts = [ help='The topic compute nodes listen on'), ] -CONF = cfg.CONF +CONF = nova.conf.CONF CONF.register_opts(rpcapi_opts) -rpcapi_cap_opt = cfg.StrOpt('compute', - help='Set a version cap for messages sent to compute services. ' - 'Set this option to "auto" if you want to let the compute RPC ' - 'module automatically determine what version to use based on ' - 'the service versions in the deployment. ' - 'Otherwise, you can set this to a specific version to pin this ' - 'service to messages at a particular level. ' - 'All services of a single type (i.e. compute) should be ' - 'configured to use the same version, and it should be set ' - 'to the minimum commonly-supported version of all those ' - 'services in the deployment.') - - -CONF.register_opt(rpcapi_cap_opt, 'upgrade_levels') - LOG = logging.getLogger(__name__) LAST_VERSION = None diff --git a/nova/conductor/rpcapi.py b/nova/conductor/rpcapi.py index 912973c40bf0..48d64df07f65 100644 --- a/nova/conductor/rpcapi.py +++ b/nova/conductor/rpcapi.py @@ -15,7 +15,6 @@ """Client side of the conductor RPC API.""" -from oslo_config import cfg import oslo_messaging as messaging from oslo_serialization import jsonutils from oslo_versionedobjects import base as ovo_base @@ -26,10 +25,6 @@ from nova import rpc CONF = nova.conf.CONF -rpcapi_cap_opt = cfg.StrOpt('conductor', - help='Set a version cap for messages sent to conductor services') -CONF.register_opt(rpcapi_cap_opt, 'upgrade_levels') - class ConductorAPI(object): """Client side of the conductor RPC API diff --git a/nova/conf/__init__.py b/nova/conf/__init__.py index ce55500814ea..2b903c168d37 100644 --- a/nova/conf/__init__.py +++ b/nova/conf/__init__.py @@ -68,7 +68,7 @@ from nova.conf import serial_console # from nova.conf import spice # from nova.conf import ssl # from nova.conf import trusted_computing -# from nova.conf import upgrade_levels +from nova.conf import upgrade_levels from nova.conf import virt # from nova.conf import vmware from nova.conf import vnc @@ -129,7 +129,7 @@ serial_console.register_opts(CONF) # spice.register_opts(CONF) # ssl.register_opts(CONF) # trusted_computing.register_opts(CONF) -# upgrade_levels.register_opts(CONF) +upgrade_levels.register_opts(CONF) virt.register_opts(CONF) # vmware.register_opts(CONF) vnc.register_opts(CONF) diff --git a/nova/conf/cells.py b/nova/conf/cells.py index 41ace3105036..2c283c273104 100644 --- a/nova/conf/cells.py +++ b/nova/conf/cells.py @@ -729,57 +729,6 @@ Related options: """) ] - -rpcapi_cap_intercell_opt = cfg.StrOpt('intercell', - help=""" -Intercell version - -Intercell RPC API is the client side of the Cell<->Cell RPC API. -Use this option to set a version cap for messages sent between -cells services. - -Possible values: - -* None: This is the default value. -* grizzly: message version 1.0. - -Services which consume this: - -* nova-cells - -Related options: - -* None -""") - - -rpcapi_cap_cells_opt = cfg.StrOpt('cells', - help=""" -Cells version - -Cells client-side RPC API version. Use this option to set a version -cap for messages sent to local cells services. - -Possible values: - -* None: This is the default value. -* grizzly: message version 1.6. -* havana: message version 1.24. -* icehouse: message version 1.27. -* juno: message version 1.29. -* kilo: message version 1.34. -* liberty: message version 1.37. - -Services which consume this: - -* nova-cells - -Related options: - -* None -""") - - ALL_CELLS_OPTS = list(itertools.chain( cells_opts, mute_weigher_opts, @@ -792,17 +741,10 @@ ALL_CELLS_OPTS = list(itertools.chain( cell_state_manager_opts )) -ALL_RPCAPI_CAP_OPTS = [rpcapi_cap_intercell_opt, - rpcapi_cap_cells_opt] - def register_opts(conf): conf.register_opts(ALL_CELLS_OPTS, group="cells") - conf.register_opts(ALL_RPCAPI_CAP_OPTS, group="upgrade_levels") def list_opts(): - return { - 'cells': ALL_CELLS_OPTS, - 'upgrade_levels': ALL_RPCAPI_CAP_OPTS, - } + return {'cells': ALL_CELLS_OPTS} diff --git a/nova/conf/cert.py b/nova/conf/cert.py index 51bc42d21954..4f325a204e9d 100644 --- a/nova/conf/cert.py +++ b/nova/conf/cert.py @@ -35,32 +35,10 @@ Any string. None """) -rpcapi_cap_opt = cfg.StrOpt("cert", - help=""" -Specifies the maximum version for messages sent from cert services. This should -be the minimum value that is supported by all of the deployed cert services. - -Possible values: - -Any valid OpenStack release name, in lower case, such as 'mitaka' or 'liberty'. -Alternatively, it can be any string representing a version number in the format -'N.N'; for example, possible values might be '1.12' or '2.0'. - -* Services which consume this: - - ``nova-cert`` - -* Related options: - - None -""") - def register_opts(conf): conf.register_opts([cert_topic_opt]) - conf.register_opt(rpcapi_cap_opt, "upgrade_levels") def list_opts(): - return {"DEFAULT": [cert_topic_opt], - "upgrade_levels": [rpcapi_cap_opt]} + return {"DEFAULT": [cert_topic_opt]} diff --git a/nova/conf/scheduler.py b/nova/conf/scheduler.py index 3fc2d1eea5fc..b6126e9eb07c 100644 --- a/nova/conf/scheduler.py +++ b/nova/conf/scheduler.py @@ -19,7 +19,6 @@ DEFAULT_GROUP_NAME = "DEFAULT" # The scheduler has options in several groups METRICS_GROUP_NAME = "metrics" TRUSTED_GROUP_NAME = "trusted_computing" -UPGRADE_GROUP_NAME = "upgrade_levels" host_subset_size_opt = cfg.IntOpt("scheduler_host_subset_size", @@ -388,28 +387,6 @@ which will *always* be restricted to isolated hosts. scheduler/isolated_hosts """) -# This option specifies an option group, so register separately -rpcapi_cap_opt = cfg.StrOpt("scheduler", - help=""" -Sets a version cap (limit) for messages sent to scheduler services. In the -situation where there were multiple scheduler services running, and they were -not being upgraded together, you would set this to the lowest deployed version -to guarantee that other services never send messages that any of your running -schedulers cannot understand. - -This is rarely needed in practice as most deployments run a single scheduler. -It exists mainly for design compatibility with the other services, such as -compute, which are routinely upgraded in a rolling fashion. - -* Services that use this: - - ``nova-compute, nova-conductor`` - -* Related options: - - None -""") - # These opts are registered as a separate OptGroup trusted_opts = [ cfg.StrOpt("attestation_server", @@ -943,7 +920,6 @@ default_opts = [host_subset_size_opt, def register_opts(conf): conf.register_opts(default_opts) - conf.register_opt(rpcapi_cap_opt, UPGRADE_GROUP_NAME) trust_group = cfg.OptGroup(name=TRUSTED_GROUP_NAME, title="Trust parameters") conf.register_group(trust_group) @@ -953,7 +929,6 @@ def register_opts(conf): def list_opts(): return {DEFAULT_GROUP_NAME: default_opts, - UPGRADE_GROUP_NAME: [rpcapi_cap_opt], TRUSTED_GROUP_NAME: trusted_opts, METRICS_GROUP_NAME: metrics_weight_opts, } diff --git a/nova/conf/upgrade_levels.py b/nova/conf/upgrade_levels.py new file mode 100644 index 000000000000..8ef34c6f1632 --- /dev/null +++ b/nova/conf/upgrade_levels.py @@ -0,0 +1,158 @@ +# Copyright 2016 OpenStack Foundation +# All Rights Reserved. +# +# 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. + + +from oslo_config import cfg + +upgrade_group = cfg.OptGroup('upgrade_levels', + title='Upgrade levels Options') + +rpcapi_cap_cells_opt = cfg.StrOpt('cells', + help=""" +Cells version + +Cells client-side RPC API version. Use this option to set a version +cap for messages sent to local cells services. + +Possible values: + +* None: This is the default value. +* grizzly: message version 1.6. +* havana: message version 1.24. +* icehouse: message version 1.27. +* juno: message version 1.29. +* kilo: message version 1.34. +* liberty: message version 1.37. + +Services which consume this: + +* nova-cells + +Related options: + +* None +""") + +rpcapi_cap_intercell_opt = cfg.StrOpt('intercell', + help=""" +Intercell version + +Intercell RPC API is the client side of the Cell<->Cell RPC API. +Use this option to set a version cap for messages sent between +cells services. + +Possible values: + +* None: This is the default value. +* grizzly: message version 1.0. + +Services which consume this: + +* nova-cells + +Related options: + +* None +""") + +rpcapi_cap_cert_opt = cfg.StrOpt("cert", + help=""" + +Specifies the maximum version for messages sent from cert services. This should +be the minimum value that is supported by all of the deployed cert services. + +Possible values: + +Any valid OpenStack release name, in lower case, such as 'mitaka' or 'liberty'. +Alternatively, it can be any string representing a version number in the format +'N.N'; for example, possible values might be '1.12' or '2.0'. + +Services which consume this: + +* nova-cert + +Related options: + +* None +""") + +rpcapi_cap_compute_opt = cfg.StrOpt('compute', + help='Set a version cap for messages sent to compute services. ' + 'Set this option to "auto" if you want to let the compute RPC ' + 'module automatically determine what version to use based on ' + 'the service versions in the deployment. ' + 'Otherwise, you can set this to a specific version to pin this ' + 'service to messages at a particular level. ' + 'All services of a single type (i.e. compute) should be ' + 'configured to use the same version, and it should be set ' + 'to the minimum commonly-supported version of all those ' + 'services in the deployment.') + +rpcapi_cap_scheduler_opt = cfg.StrOpt("scheduler", + help=""" +Sets a version cap (limit) for messages sent to scheduler services. In the +situation where there were multiple scheduler services running, and they were +not being upgraded together, you would set this to the lowest deployed version +to guarantee that other services never send messages that any of your running +schedulers cannot understand. + +This is rarely needed in practice as most deployments run a single scheduler. +It exists mainly for design compatibility with the other services, such as +compute, which are routinely upgraded in a rolling fashion. + +Services that use this: + +* nova-compute, nova-conductor + +Related options: + +* None +""") + +rpcapi_cap_conductor_opt = cfg.StrOpt('conductor', + help='Set a version cap for messages sent to conductor services') + +rpcapi_cap_console_opt = cfg.StrOpt('console', + help='Set a version cap for messages sent to console services') + +rpcapi_cap_consoleauth_opt = cfg.StrOpt('consoleauth', + help='Set a version cap for messages sent to consoleauth services') + +rpcapi_cap_network_opt = cfg.StrOpt('network', + help='Set a version cap for messages sent to network services') + +rpcapi_cap_baseapi_opt = cfg.StrOpt('baseapi', + help='Set a version cap for messages sent to the base api in any ' + 'service') + +ALL_OPTS = [rpcapi_cap_cells_opt, + rpcapi_cap_intercell_opt, + rpcapi_cap_cert_opt, + rpcapi_cap_compute_opt, + rpcapi_cap_scheduler_opt, + rpcapi_cap_conductor_opt, + rpcapi_cap_console_opt, + rpcapi_cap_consoleauth_opt, + rpcapi_cap_network_opt, + rpcapi_cap_baseapi_opt] + + +def register_opts(conf): + conf.register_group(upgrade_group) + conf.register_opts(ALL_OPTS, group=upgrade_group) + + +def list_opts(): + return {upgrade_group: ALL_OPTS} diff --git a/nova/console/rpcapi.py b/nova/console/rpcapi.py index 2f4b5085b0f6..5002396749fa 100644 --- a/nova/console/rpcapi.py +++ b/nova/console/rpcapi.py @@ -19,6 +19,7 @@ Client side of the console RPC API. from oslo_config import cfg import oslo_messaging as messaging +import nova.conf from nova import rpc rpcapi_opts = [ @@ -27,13 +28,9 @@ rpcapi_opts = [ help='The topic console proxy nodes listen on'), ] -CONF = cfg.CONF +CONF = nova.conf.CONF CONF.register_opts(rpcapi_opts) -rpcapi_cap_opt = cfg.StrOpt('console', - help='Set a version cap for messages sent to console services') -CONF.register_opt(rpcapi_cap_opt, 'upgrade_levels') - class ConsoleAPI(object): '''Client side of the console rpc API. diff --git a/nova/consoleauth/rpcapi.py b/nova/consoleauth/rpcapi.py index 32bed3e92339..2aefc685c49f 100644 --- a/nova/consoleauth/rpcapi.py +++ b/nova/consoleauth/rpcapi.py @@ -16,16 +16,12 @@ Client side of the consoleauth RPC API. """ -from oslo_config import cfg import oslo_messaging as messaging +import nova.conf from nova import rpc -CONF = cfg.CONF - -rpcapi_cap_opt = cfg.StrOpt('consoleauth', - help='Set a version cap for messages sent to consoleauth services') -CONF.register_opt(rpcapi_cap_opt, 'upgrade_levels') +CONF = nova.conf.CONF class ConsoleAuthAPI(object): diff --git a/nova/network/opts.py b/nova/network/opts.py index 810944f9e6a8..435efa8d8e70 100644 --- a/nova/network/opts.py +++ b/nova/network/opts.py @@ -32,8 +32,4 @@ def list_opts(): nova.network.security_group.openstack_driver.security_group_opts, )), ('neutron', nova.network.neutronv2.api.neutron_opts), - ('upgrade_levels', - itertools.chain( - [nova.network.rpcapi.rpcapi_cap_opt], - )), ] diff --git a/nova/network/rpcapi.py b/nova/network/rpcapi.py index 53e05e67438f..9bd24050dbc3 100644 --- a/nova/network/rpcapi.py +++ b/nova/network/rpcapi.py @@ -20,6 +20,7 @@ from oslo_config import cfg import oslo_messaging as messaging from oslo_serialization import jsonutils +import nova.conf from nova.objects import base as objects_base from nova import rpc @@ -33,13 +34,9 @@ rpcapi_opts = [ 'some rpc network calls will be sent directly to host.'), ] -CONF = cfg.CONF +CONF = nova.conf.CONF CONF.register_opts(rpcapi_opts) -rpcapi_cap_opt = cfg.StrOpt('network', - help='Set a version cap for messages sent to network services') -CONF.register_opt(rpcapi_cap_opt, 'upgrade_levels') - class NetworkAPI(object): '''Client side of the network rpc API. diff --git a/nova/opts.py b/nova/opts.py index 963998b6817f..fe1e7b7d0aa4 100644 --- a/nova/opts.py +++ b/nova/opts.py @@ -78,12 +78,5 @@ def list_opts(): itertools.chain( nova.cmd.spicehtml5proxy.opts, nova.spice.spice_opts, - )), - ('upgrade_levels', - itertools.chain( - [nova.baserpc.rpcapi_cap_opt], - [nova.conductor.rpcapi.rpcapi_cap_opt], - [nova.console.rpcapi.rpcapi_cap_opt], - [nova.consoleauth.rpcapi.rpcapi_cap_opt], - )), + )) ]