From 959e65f320093a6b17945f52ad160da5aa042ff6 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 12 Feb 2013 12:34:39 -0500 Subject: Make compute manager use conductor for stopping instances During _sync_power_states, the manager will call to compute_api to stop instances as necessary. This takes a database hit, which isn't allowed. This directs that call through conductor, following the pattern of late. Fixes bug 1123219 Change-Id: I5d789dd73390cb1c41a245f6594b1c3aecf7efde --- nova/compute/manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 4bb08aa16..8927e682a 100755 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -3436,7 +3436,7 @@ class ComputeManager(manager.SchedulerDependentManager): # Note(maoy): here we call the API instead of # brutally updating the vm_state in the database # to allow all the hooks and checks to be performed. - self.compute_api.stop(context, db_instance) + self.conductor_api.compute_stop(context, db_instance) except Exception: # Note(maoy): there is no need to propagate the error # because the same power_state will be retrieved next @@ -3449,7 +3449,7 @@ class ComputeManager(manager.SchedulerDependentManager): LOG.warn(_("Instance is suspended unexpectedly. Calling " "the stop API."), instance=db_instance) try: - self.compute_api.stop(context, db_instance) + self.conductor_api.compute_stop(context, db_instance) except Exception: LOG.exception(_("error during stop() in " "sync_power_state."), @@ -3479,7 +3479,7 @@ class ComputeManager(manager.SchedulerDependentManager): try: # Note(maoy): this assumes that the stop API is # idempotent. - self.compute_api.stop(context, db_instance) + self.conductor_api.compute_stop(context, db_instance) except Exception: LOG.exception(_("error during stop() in " "sync_power_state."), -- cgit