diff options
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 4 | ||||
| -rw-r--r-- | nova/compute/manager.py | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index be9b8dbb9..80abd37e1 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1640,7 +1640,9 @@ class HostAPI(base.Base): def set_host_maintenance(self, context, host, mode): """Start/Stop host maintenance window. On start, it triggers guest VMs evacuation.""" - raise NotImplementedError() + return _call_compute_message(self.db, "host_maintenance_mode", context, + host=host, params={"host": host, + "mode": mode}) class AggregateAPI(base.Base): diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 3066cb3a6..b64086115 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1464,6 +1464,12 @@ class ComputeManager(manager.SchedulerDependentManager): return self.driver.host_power_action(host, action) @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) + def host_maintenance_mode(self, context, host, mode): + """Start/Stop host maintenance window. On start, it triggers + guest VMs evacuation.""" + return self.driver.host_maintenance_mode(host, mode) + + @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) def set_host_enabled(self, context, host=None, enabled=None): """Sets the specified host's ability to accept new instances.""" return self.driver.set_host_enabled(host, enabled) |
