Minimal construct plumbing for nova show when a cell is down

This patch sets the stage for modifying the behavior of nova show
which currently gives a 500 when the cell in which the instance
lives is down. The new behavior will return a partial construct
consisting of uuid, project_id, created_at from instance_mappings
table and user_id, flavor, image_ref and availability_zone info
from request_specs table.  Note that the rest of the keys will be
missing. This behavior will be enabled by passing a new enough
microversion, handling for which is introduced later in this series.

Related to blueprint handling-down-cell

Change-Id: Iaea1cb4ed93bb98f451de4f993106d7891ca3682
This commit is contained in:
Surya Seetharaman
2018-08-14 14:17:12 +02:00
committed by Matt Riedemann
parent 031314b6d8
commit ef5aa8a818
22 changed files with 276 additions and 78 deletions
@@ -127,7 +127,8 @@ class MigrateServerTestsV21(admin_only_action_common.CommonTests):
mock_resize.assert_called_once_with(
self.context, instance, host_name=self.host_name)
self.mock_get.assert_called_once_with(self.context, instance.uuid,
expected_attrs=None)
expected_attrs=None,
cell_down_support=False)
def test_migrate_too_many_instances(self):
exc_info = exception.TooManyInstances(overs='', req='', used=0,
@@ -149,7 +150,8 @@ class MigrateServerTestsV21(admin_only_action_common.CommonTests):
'hostname', self.force, self.async_)
self.mock_get.assert_called_once_with(self.context, instance.uuid,
expected_attrs=None)
expected_attrs=None,
cell_down_support=False)
def test_migrate_live_enabled(self):
param = self._get_params(host='hostname')
@@ -226,7 +228,8 @@ class MigrateServerTestsV21(admin_only_action_common.CommonTests):
self.context, instance, False, self.disk_over_commit,
'hostname', self.force, self.async_)
self.mock_get.assert_called_once_with(self.context, instance.uuid,
expected_attrs=None)
expected_attrs=None,
cell_down_support=False)
def test_migrate_live_compute_service_unavailable(self):
self._test_migrate_live_failed_with_exception(
@@ -443,7 +446,8 @@ class MigrateServerTestsV234(MigrateServerTestsV230):
self.context, instance, None, self.disk_over_commit,
'hostname', self.force, self.async_)
self.mock_get.assert_called_once_with(self.context, instance.uuid,
expected_attrs=None)
expected_attrs=None,
cell_down_support=False)
def test_migrate_live_unexpected_error(self):
body = {'os-migrateLive':
@@ -461,7 +465,8 @@ class MigrateServerTestsV234(MigrateServerTestsV230):
self.context, instance, None, self.disk_over_commit,
'hostname', self.force, self.async_)
self.mock_get.assert_called_once_with(self.context, instance.uuid,
expected_attrs=None)
expected_attrs=None,
cell_down_support=False)
class MigrateServerTestsV256(MigrateServerTestsV234):