blueprint host-aggregates: host maintenance

First cut at implementing host maintenance (aka host evacuation). This allows
zero-downtime upgrades of the hosts by moving VMs off of to another host to
carry out hypervisor upgrades.

A number of issues have been addressed in this changeset:

- improved the semantic of update operation on hosts (as per dabo comment)
- refactored host-related operations into a separate class in to improve
  readability/maintainability
- refactored test_hosts to reduce duplicated code
- added first stub of host-maintenance operation

Change-Id: I933f7cb8736e56c9ecea5255936d8826ef6decec
This commit is contained in:
Armando Migliaccio
2012-02-10 19:16:29 +00:00
parent 4a94613f90
commit 4cf5ece64b

View File

@@ -2369,8 +2369,7 @@ class ComputeAPITestCase(BaseTestCase):
self.assertEqual(instance_properties['host'], 'host2')
self.assertIn('host2', filter_properties['ignore_hosts'])
self.stubs.Set(self.compute_api, '_cast_scheduler_message',
_fake_cast)
self.stubs.Set(compute.api, '_cast_scheduler_message', _fake_cast)
context = self.context.elevated()
instance = self._create_fake_instance(dict(host='host2'))
@@ -2389,8 +2388,7 @@ class ComputeAPITestCase(BaseTestCase):
self.assertEqual(instance_properties['host'], 'host2')
self.assertNotIn('host2', filter_properties['ignore_hosts'])
self.stubs.Set(self.compute_api, '_cast_scheduler_message',
_fake_cast)
self.stubs.Set(compute.api, '_cast_scheduler_message', _fake_cast)
self.flags(allow_resize_to_same_host=True)
context = self.context.elevated()