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
9bc06783ec, including adding a
release mapping for ironic version 8.0.

Change-Id: I2145f76a6802e8116b9ee2c1e23a88322b1bdeac
This commit is contained in:
Ruby Loo 2017-04-03 11:35:05 -04:00
parent 73c29a4c66
commit 4f10391494
4 changed files with 35 additions and 14 deletions

View File

@ -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 = <None>
# Path to the rootwrap configuration file to use for running

View File

@ -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': {

View File

@ -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.')),
]

View File

@ -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)