From f6e8c512fbce7c8ab2444c6a31132dc461f5638b Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Fri, 14 May 2021 10:08:35 +0200 Subject: [PATCH] Bump min placement microversion to 1.36 To implement the usage of same_subtree query parameter in the allocation candidate request first the minimum requires placement microversion needs to be bumped from 1.35 to 1.36. This patch makes such bump and update the related nova upgrade check. Later patches will modify the query generation to include the same_subtree param to the request. Change-Id: I5bfec9b9ec49e60c454d71f6fc645038504ef9ef blueprint: qos-minimum-guaranteed-packet-rate --- doc/source/cli/nova-status.rst | 4 ++++ nova/cmd/status.py | 8 ++++---- nova/scheduler/client/report.py | 4 ++-- nova/tests/functional/test_report_client.py | 2 +- nova/tests/unit/scheduler/client/test_report.py | 6 +++--- ...-placemnet-api-microversion-1.36-1129fe4afc949075.yaml | 7 +++++++ 6 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 releasenotes/notes/require-placemnet-api-microversion-1.36-1129fe4afc949075.yaml diff --git a/doc/source/cli/nova-status.rst b/doc/source/cli/nova-status.rst index 6d50ccaf6828..a198159e17ce 100644 --- a/doc/source/cli/nova-status.rst +++ b/doc/source/cli/nova-status.rst @@ -148,6 +148,10 @@ Upgrade * Checks for computes older than the previous major release * Checks for any instances without ``hw_machine_type`` set. + **24.0.0 (Xena)** + + * Checks for the Placement API are modified to require version 1.36. + See Also ======== diff --git a/nova/cmd/status.py b/nova/cmd/status.py index 2f14e3fed2ff..f95a1a4a93e7 100644 --- a/nova/cmd/status.py +++ b/nova/cmd/status.py @@ -49,12 +49,12 @@ from nova.volume import cinder CONF = nova.conf.CONF -# NOTE(efried): 1.35 is required by nova-scheduler to support the root_required -# queryparam to make GET /allocation_candidates require that a trait be present -# on the root provider, irrespective of how the request groups are specified. +# NOTE(gibi): 1.36 is required by nova-scheduler to support the same_subtree +# queryparam to make GET /allocation_candidates require that a list of request +# groups are satisfied from the same provider subtree. # NOTE: If you bump this version, remember to update the history # section in the nova-status man page (doc/source/cli/nova-status). -MIN_PLACEMENT_MICROVERSION = "1.35" +MIN_PLACEMENT_MICROVERSION = "1.36" # NOTE(mriedem): 3.44 is needed to work with volume attachment records which # are required for supporting multi-attach capable volumes. diff --git a/nova/scheduler/client/report.py b/nova/scheduler/client/report.py index 257aaf07ca76..c38d6e862f53 100644 --- a/nova/scheduler/client/report.py +++ b/nova/scheduler/client/report.py @@ -42,7 +42,7 @@ from nova import utils CONF = nova.conf.CONF LOG = logging.getLogger(__name__) WARN_EVERY = 10 -ROOT_REQUIRED_VERSION = '1.35' +SAME_SUBTREE_VERSION = '1.36' RESHAPER_VERSION = '1.30' CONSUMER_GENERATION_VERSION = '1.28' ALLOW_RESERVED_EQUAL_TOTAL_INVENTORY_VERSION = '1.26' @@ -292,7 +292,7 @@ class SchedulerReportClient(object): """ # Note that claim_resources() will use this version as well to # make allocations by `PUT /allocations/{consumer_uuid}` - version = ROOT_REQUIRED_VERSION + version = SAME_SUBTREE_VERSION qparams = resources.to_querystring() url = "/allocation_candidates?%s" % qparams resp = self.get(url, version=version, diff --git a/nova/tests/functional/test_report_client.py b/nova/tests/functional/test_report_client.py index aea7ee56c54a..83fe0f3ae590 100644 --- a/nova/tests/functional/test_report_client.py +++ b/nova/tests/functional/test_report_client.py @@ -1285,7 +1285,7 @@ class SchedulerReportClientTests(test.TestCase): 'CUSTOM_FOO')) acs, _, ver = self.client.get_allocation_candidates( self.context, utils.ResourceRequest.from_request_spec(req_spec)) - self.assertEqual('1.35', ver) + self.assertEqual('1.36', ver) # This prints which ddt permutation we're using if it fails. self.assertEqual(data['expected_acs'], len(acs), data) diff --git a/nova/tests/unit/scheduler/client/test_report.py b/nova/tests/unit/scheduler/client/test_report.py index 887e05fa6846..f8e9812b77d9 100644 --- a/nova/tests/unit/scheduler/client/test_report.py +++ b/nova/tests/unit/scheduler/client/test_report.py @@ -2124,7 +2124,7 @@ class TestProviderOperations(SchedulerReportClientTestCase): expected_url = '/allocation_candidates?%s' % parse.urlencode( expected_query) self.ks_adap_mock.get.assert_called_once_with( - expected_url, microversion='1.35', + expected_url, microversion='1.36', global_request_id=self.context.global_id) self.assertEqual(mock.sentinel.alloc_reqs, alloc_reqs) self.assertEqual(mock.sentinel.p_sums, p_sums) @@ -2168,7 +2168,7 @@ class TestProviderOperations(SchedulerReportClientTestCase): expected_query) self.assertEqual(mock.sentinel.alloc_reqs, alloc_reqs) self.ks_adap_mock.get.assert_called_once_with( - expected_url, microversion='1.35', + expected_url, microversion='1.36', global_request_id=self.context.global_id) self.assertEqual(mock.sentinel.p_sums, p_sums) @@ -2194,7 +2194,7 @@ class TestProviderOperations(SchedulerReportClientTestCase): res = self.client.get_allocation_candidates(self.context, resources) self.ks_adap_mock.get.assert_called_once_with( - mock.ANY, microversion='1.35', + mock.ANY, microversion='1.36', global_request_id=self.context.global_id) url = self.ks_adap_mock.get.call_args[0][0] split_url = parse.urlsplit(url) diff --git a/releasenotes/notes/require-placemnet-api-microversion-1.36-1129fe4afc949075.yaml b/releasenotes/notes/require-placemnet-api-microversion-1.36-1129fe4afc949075.yaml new file mode 100644 index 000000000000..b8d75876e800 --- /dev/null +++ b/releasenotes/notes/require-placemnet-api-microversion-1.36-1129fe4afc949075.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + Nova now requires that the Placement API supports at least + microversion 1.36, added in Train. The related nova-upgrade + check has been modified to warn if this prerequisite is not + fulfilled.