summaryrefslogtreecommitdiff
path: root/nova/tests/unit/conductor
diff options
context:
space:
mode:
authorMatt Riedemann <mriedem.os@gmail.com>2019-04-05 15:36:00 -0400
committerMatt Riedemann <mriedem.os@gmail.com>2019-08-20 11:20:19 -0400
commit95df2a239c32f2ee5d00f06a59a9e91b59f3aca5 (patch)
tree0e0bb366491a2dca3d9653abb349125fabbe5b80 /nova/tests/unit/conductor
parenta7bd9688d533aaa622d6049a99d9339d1fbfa88f (diff)
downloadnova-95df2a239c32f2ee5d00f06a59a9e91b59f3aca5.tar.gz
Restrict RequestSpec to cell when evacuating
When evacuating a server in a multi-cell environment we need to restrict the scheduling request during evacuate to the cell in which the instance already exists since we don't support cross-cell evacuate. This fixes the issue by restricting the RequestSpec to the instance's current cell during evacuate in the same way we do during unshelve. Note that this should also improve performance when rebuilding a server with a new image since we will only look for the ComputeNode from the targeted cell rather than iterate all enabled cells during scheduling. Change-Id: I497180fb81fd966d1d3d4b54ac66d2609347583e Closes-Bug: #1823370
Diffstat (limited to 'nova/tests/unit/conductor')
-rw-r--r--nova/tests/unit/conductor/test_conductor.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/tests/unit/conductor/test_conductor.py b/nova/tests/unit/conductor/test_conductor.py
index 31bbb5d8fd..870bc82078 100644
--- a/nova/tests/unit/conductor/test_conductor.py
+++ b/nova/tests/unit/conductor/test_conductor.py
@@ -1687,6 +1687,10 @@ class _BaseTaskTestCase(object):
reset_fd.assert_called_once_with()
# The RequestSpec.ignore_hosts field should be overwritten.
self.assertEqual([inst_obj.host], fake_spec.ignore_hosts)
+ # The RequestSpec.requested_destination.cell field should be set.
+ self.assertIn('requested_destination', fake_spec)
+ self.assertIn('cell', fake_spec.requested_destination)
+ self.assertIsNotNone(fake_spec.requested_destination.cell)
select_dest_mock.assert_called_once_with(self.context,
fake_spec, [inst_obj.uuid], return_objects=True,
return_alternates=False)