Require nova_client.api_version >= 2.56
The [nova_client]/api_version defaults to 2.56 since change Idd6ebc94f81ad5d65256c80885f2addc1aaeaae1. There is compatibility code for that change but if 2.56 is not available watcher_non_live_migrate_instance will still fail if a destination host is used. Since 2.56 has been available since the Queens version of nova it should be reasonable to require at least that version of nova is running for using Watcher. This adds code which enforces the minimum version along with a release note and "watcher-status upgrade check" check method. Note that it's kind of weird for watcher to have a config option like nova_client.api_version since compute API microversions are per API request even though novaclient is constructed with the single configured version. It should really be something the client (watcher in this case) determines using version discovery and gracefully enables features if the required nova API version is available, but that's a bigger change. Change-Id: Id34938c7bb8a5ca934d997e52cac3b365414c006
This commit is contained in:
@@ -18,13 +18,24 @@
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from watcher.common import clients
|
||||
|
||||
nova_client = cfg.OptGroup(name='nova_client',
|
||||
title='Configuration Options for Nova')
|
||||
|
||||
NOVA_CLIENT_OPTS = [
|
||||
cfg.StrOpt('api_version',
|
||||
default='2.56',
|
||||
help='Version of Nova API to use in novaclient.'),
|
||||
help="""
|
||||
Version of Nova API to use in novaclient.
|
||||
|
||||
Minimum required version: %s
|
||||
|
||||
Certain Watcher features depend on a minimum version of the compute
|
||||
API being available which is enforced with this option. See
|
||||
https://docs.openstack.org/nova/latest/reference/api-microversion-history.html
|
||||
for the compute API microversion history.
|
||||
""" % clients.MIN_NOVA_API_VERSION),
|
||||
cfg.StrOpt('endpoint_type',
|
||||
default='publicURL',
|
||||
help='Type of endpoint to use in novaclient. '
|
||||
|
||||
Reference in New Issue
Block a user