nova-status: relax the resource providers check

As of 4660333d0d the filter
scheduler will fallback to not using the placement service
if the minimum nova-compute service version in the deployment
is not new enough to ensure the computes are reporting into
the placement service.

This means we need to relax our check for when there are no
resource providers but there are compute nodes, since the filter
scheduler will not fail on that in Ocata. We intend on making
that a hard failure in Pike, at which time we'll need to adjust
nova-status again.

Change-Id: I1e4dae17cf9d1336bf0ca72948b135b02434ba15
Closes-Bug: #1660484
This commit is contained in:
Matt Riedemann 2017-01-31 17:59:53 -05:00
parent 1129a9ff47
commit a954bab009
2 changed files with 21 additions and 7 deletions

View File

@ -268,6 +268,13 @@ class UpgradeCommands(object):
This check relies on the placement service running because if it's not
then there won't be any resource providers for the filter scheduler to
use during instance build and move requests.
Note that in Ocata, the filter scheduler will only use placement if
the minimum nova-compute service version in the deployment is >= 16
which signals when nova-compute will fail to start if placement is not
configured on the compute. Otherwise the scheduler will fallback
to pulling compute nodes from the database directly as it has always
done. That fallback will be removed in Pike.
"""
# Get the total count of resource providers from the API DB that can
@ -290,9 +297,11 @@ class UpgradeCommands(object):
if num_rps == 0:
if num_computes != 0:
# This is a failure because there are compute nodes in the
# This is a warning because there are compute nodes in the
# database but nothing is reporting resource providers to the
# placement service.
# placement service. This will not result in scheduling
# failures in Ocata because of the fallback that is in place
# but we signal it as a warning since there is work to do.
msg = (_('There are no compute resource providers in the '
'Placement service but there are %(num_computes)s '
'compute nodes in the deployment. This means no '
@ -301,7 +310,7 @@ class UpgradeCommands(object):
'%(placement_docs_link)s for more details.') %
{'num_computes': num_computes,
'placement_docs_link': PLACEMENT_DOCS_LINK})
return UpgradeCheckResult(UpgradeCheckCode.FAILURE, msg)
return UpgradeCheckResult(UpgradeCheckCode.WARNING, msg)
# There are no resource providers and no compute nodes so we
# assume this is a fresh install and move on. We should return a
@ -317,6 +326,11 @@ class UpgradeCommands(object):
elif num_rps < num_computes:
# There are fewer resource providers than compute nodes, so return
# a warning explaining that the deployment might be underutilized.
# Technically this is not going to result in scheduling failures in
# Ocata because of the fallback that is in place if there are older
# compute nodes still, but it is probably OK to leave the wording
# on this as-is to prepare for when the fallback is removed in
# Pike.
msg = (_('There are %(num_resource_providers)s compute resource '
'providers and %(num_compute_nodes)s compute nodes in '
'the deployment. Ideally the number of compute resource '

View File

@ -469,7 +469,7 @@ class TestUpgradeCheckResourceProviders(test.NoDBTestCase):
def test_check_resource_providers_no_rps_one_compute(self):
"""Tests the scenario where we have compute nodes in the cell but no
resource providers yet - VCPU or otherwise. This is a failure because
resource providers yet - VCPU or otherwise. This is a warning because
the compute isn't reporting into placement.
"""
self._setup_cells()
@ -488,7 +488,7 @@ class TestUpgradeCheckResourceProviders(test.NoDBTestCase):
cpu_info='{"arch": "x86_64"}')
cn.create()
result = self.cmd._check_resource_providers()
self.assertEqual(status.UpgradeCheckCode.FAILURE, result.code)
self.assertEqual(status.UpgradeCheckCode.WARNING, result.code)
self.assertIn('There are no compute resource providers in the '
'Placement service but there are 1 compute nodes in the '
'deployment.', result.details)
@ -511,7 +511,7 @@ class TestUpgradeCheckResourceProviders(test.NoDBTestCase):
def test_check_resource_providers_no_compute_rps_one_compute(self):
"""Tests the scenario where we have compute nodes in the cell but no
compute (VCPU) resource providers yet. This is a failure because the
compute (VCPU) resource providers yet. This is a failure warning the
compute isn't reporting into placement.
"""
self._setup_cells()
@ -536,7 +536,7 @@ class TestUpgradeCheckResourceProviders(test.NoDBTestCase):
self._create_resource_provider(FAKE_IP_POOL_INVENTORY)
result = self.cmd._check_resource_providers()
self.assertEqual(status.UpgradeCheckCode.FAILURE, result.code)
self.assertEqual(status.UpgradeCheckCode.WARNING, result.code)
self.assertIn('There are no compute resource providers in the '
'Placement service but there are 1 compute nodes in the '
'deployment.', result.details)