From 939f082cc2fb0b71bb601f80e3ea95d0be355e4c Mon Sep 17 00:00:00 2001 From: Armando Migliaccio Date: Fri, 17 Feb 2012 16:17:44 +0000 Subject: blueprint host-aggregates: host maintenance - xenapi implementation this changeset introduces the following: - refactoring around host-related operations for xenapi - increased test coverage - first cut at implementing host evacuation for a XS/XCP host Change-Id: I8509cdde95f6777ecfa928663b0c4bedbccf5d38 --- nova/compute/api.py | 4 +++- nova/compute/manager.py | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'nova/compute') 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 @@ -1463,6 +1463,12 @@ class ComputeManager(manager.SchedulerDependentManager): """Reboots, shuts down or powers up the host.""" 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.""" -- cgit