summaryrefslogtreecommitdiffstats
path: root/nova/scheduler/manager.py
diff options
context:
space:
mode:
authorJohn Garbutt <john@johngarbutt.com>2013-05-14 10:44:13 +0100
committerJohn Garbutt <john.garbutt@rackspace.com>2013-06-24 10:49:07 +0100
commit2d7beddc0bb7830c2a8bf893b9221c0de568c55d (patch)
treec1d5c31d289d13eb7d0aa625ecb2699ecd874a65 /nova/scheduler/manager.py
parentfacf42d0bab7a4f97c654a5724189609ad185559 (diff)
downloadnova-2d7beddc0bb7830c2a8bf893b9221c0de568c55d.tar.gz
nova-2d7beddc0bb7830c2a8bf893b9221c0de568c55d.tar.xz
nova-2d7beddc0bb7830c2a8bf893b9221c0de568c55d.zip
Extract live-migration scheduler logic from the scheduler driver
Before moving the control of live-migration into the conductor, extract the live-migration control logic into a separate class. The callback to select_hosts will be replaced by a new scheduler rpc method in a later changeset. Part of blueprint live-migration-to-conductor Change-Id: I6de33ada6dc377e20f8df07da92244f2c150b9fe
Diffstat (limited to 'nova/scheduler/manager.py')
-rw-r--r--nova/scheduler/manager.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py
index 5c99feb03..3d62ff9b0 100644
--- a/nova/scheduler/manager.py
+++ b/nova/scheduler/manager.py
@@ -30,6 +30,7 @@ from nova.compute import task_states
from nova.compute import utils as compute_utils
from nova.compute import vm_states
from nova.conductor import api as conductor_api
+from nova.conductor.tasks import live_migrate
import nova.context
from nova import exception
from nova import manager
@@ -102,9 +103,8 @@ class SchedulerManager(manager.Manager):
def live_migration(self, context, instance, dest,
block_migration, disk_over_commit):
try:
- return self.driver.schedule_live_migration(
- context, instance, dest,
- block_migration, disk_over_commit)
+ self._schedule_live_migration(context, instance, dest,
+ block_migration, disk_over_commit)
except (exception.NoValidHost,
exception.ComputeServiceUnavailable,
exception.InvalidHypervisorType,
@@ -131,6 +131,13 @@ class SchedulerManager(manager.Manager):
{'vm_state': vm_states.ERROR},
context, ex, request_spec)
+ def _schedule_live_migration(self, context, instance, dest,
+ block_migration, disk_over_commit):
+ task = live_migrate.LiveMigrationTask(context, instance,
+ dest, block_migration, disk_over_commit,
+ self.driver.select_hosts)
+ return task.execute()
+
def run_instance(self, context, request_spec, admin_password,
injected_files, requested_networks, is_first_time,
filter_properties):