From 4f10391494ad1135de5995abdc3cedc76672d8d2 Mon Sep 17 00:00:00 2001 From: Ruby Loo Date: Mon, 3 Apr 2017 11:35:05 -0400 Subject: [PATCH] Updates to RPC and object version pinning Adds a warning to pin_release_version config to indicate that it isn't being used yet since the rolling upgrades work isn't complete. Also includes updates as a followup to 9bc06783ecaff5eef58535904abc12ea15982329, including adding a release mapping for ironic version 8.0. Change-Id: I2145f76a6802e8116b9ee2c1e23a88322b1bdeac --- etc/ironic/ironic.conf.sample | 15 +++++++++------ ironic/common/release_mappings.py | 12 ++++++++++++ ironic/conf/default.py | 14 +++++++++----- ironic/tests/unit/common/test_release_mappings.py | 8 +++++--- 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/etc/ironic/ironic.conf.sample b/etc/ironic/ironic.conf.sample index f71df190a7..566d92db52 100644 --- a/etc/ironic/ironic.conf.sample +++ b/etc/ironic/ironic.conf.sample @@ -354,13 +354,16 @@ # value) #host = localhost +# WARNING: This configuration option is part of the incomplete +# rolling upgrades work; changing this value has no effect. # Used for rolling upgrades. Setting this option downgrades -# the internal ironic RPC communication to the specified -# version to enable communication with older services. When -# doing a rolling upgrade from version X to version Y, set -# this to X. Defaults to using the newest possible RPC -# behavior. (string value) -# Allowed values: ocata, 7.0 +# (or pins) the internal ironic RPC communication to the +# specified version to enable communication with older +# services. When doing a rolling upgrade from version X to +# version Y, set (pin) this to X. To unpin, leave it unset. +# Defaults to using the newest possible RPC behavior. (string +# value) +# Allowed values: ocata, 8.0, 7.0 #pin_release_version = # Path to the rootwrap configuration file to use for running diff --git a/ironic/common/release_mappings.py b/ironic/common/release_mappings.py index 063e14a4fc..cc4592fa99 100644 --- a/ironic/common/release_mappings.py +++ b/ironic/common/release_mappings.py @@ -57,6 +57,18 @@ RELEASE_MAPPING = { 'VolumeTarget': '1.0', } }, + '8.0': { + 'rpc': '1.40', + 'objects': { + 'Node': '1.21', + 'Conductor': '1.2', + 'Chassis': '1.3', + 'Port': '1.6', + 'Portgroup': '1.3', + 'VolumeConnector': '1.0', + 'VolumeTarget': '1.0', + } + }, 'master': { 'rpc': '1.40', 'objects': { diff --git a/ironic/conf/default.py b/ironic/conf/default.py index 79d1079ebd..476e7b8613 100644 --- a/ironic/conf/default.py +++ b/ironic/conf/default.py @@ -265,11 +265,15 @@ service_opts = [ cfg.StrOpt('pin_release_version', choices=versions.RELEASE_VERSIONS, # TODO(xek): mutable=True, - help=_('Used for rolling upgrades. Setting this option ' - 'downgrades the internal ironic RPC communication to ' - 'the specified version to enable communication with ' - 'older services. When doing a rolling upgrade from ' - 'version X to version Y, set this to X. Defaults to ' + help=_('WARNING: This configuration option is part of the ' + 'incomplete rolling upgrades work; changing this ' + 'value has no effect. ' + 'Used for rolling upgrades. Setting this option ' + 'downgrades (or pins) the internal ironic RPC ' + 'communication to the specified version to enable ' + 'communication with older services. When doing a ' + 'rolling upgrade from version X to version Y, set (pin) ' + 'this to X. To unpin, leave it unset. Defaults to ' 'using the newest possible RPC behavior.')), ] diff --git a/ironic/tests/unit/common/test_release_mappings.py b/ironic/tests/unit/common/test_release_mappings.py index 74d8d58535..783921bb72 100644 --- a/ironic/tests/unit/common/test_release_mappings.py +++ b/ironic/tests/unit/common/test_release_mappings.py @@ -29,8 +29,10 @@ def _check_versions_compatibility(conf_version, actual_version): Returns True if the configured version is <= the actual version; otherwise returns False. - param conf_version: configured version, a string with dots - param actual_version: actual version, a string with dots + :param conf_version: configured version, a string with dots + :param actual_version: actual version, a string with dots + :returns: True if the configured version is <= the actual version; + False otherwise. """ conf_cap = versionutils.convert_version_to_tuple(conf_version) actual_cap = versionutils.convert_version_to_tuple(actual_version) @@ -80,7 +82,7 @@ class ReleaseMappingsTestCase(base.TestCase): exceptions = set(['NodeTag', 'ConductorHardwareInterfaces']) # NOTE(xek): As a rule, all models which can be changed between # releases or are sent through RPC should have their counterpart - # versioned objects. This means all, but very simple models. + # versioned objects. model_names -= exceptions object_names = set(RELEASE_MAPPING['master']['objects']) self.assertEqual(model_names, object_names)