diff options
| author | Yun Mao <yunmao@gmail.com> | 2012-06-06 15:08:15 -0400 |
|---|---|---|
| committer | Yun Mao <yunmao@gmail.com> | 2012-06-06 16:05:02 -0400 |
| commit | 53cb7ea71409dc7ecfe36f92df63e11231022455 (patch) | |
| tree | ce46ad39541344b3e6f00205cc0169bc386c0004 /nova/api | |
| parent | 9121fc6b9d6b1a7a9d945cfdad944fa59b648106 (diff) | |
| download | nova-53cb7ea71409dc7ecfe36f92df63e11231022455.tar.gz nova-53cb7ea71409dc7ecfe36f92df63e11231022455.tar.xz nova-53cb7ea71409dc7ecfe36f92df63e11231022455.zip | |
Make live_migration a first-class compute API.
* Move the trivial implementation from admin_actions to compute.api
* Remove the dependency to scheduler from admin_actions
* Add check_instance_state like all other compute APIs to prevent
undesirable behavior
Change-Id: Ib5176718eae624de982f641bf3ec201fc7b4efcc
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/admin_actions.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/nova/api/openstack/compute/contrib/admin_actions.py b/nova/api/openstack/compute/contrib/admin_actions.py index 7cda220db..18adf8377 100644 --- a/nova/api/openstack/compute/contrib/admin_actions.py +++ b/nova/api/openstack/compute/contrib/admin_actions.py @@ -25,7 +25,6 @@ from nova import compute from nova import exception from nova import flags from nova import log as logging -from nova.scheduler import rpcapi as scheduler_rpcapi FLAGS = flags.FLAGS @@ -41,7 +40,6 @@ class AdminActionsController(wsgi.Controller): def __init__(self, *args, **kwargs): super(AdminActionsController, self).__init__(*args, **kwargs) self.compute_api = compute.API() - self.scheduler_rpcapi = scheduler_rpcapi.SchedulerAPI() # TODO(bcwaldon): These action names should be prefixed with 'os-' @@ -275,12 +273,8 @@ class AdminActionsController(wsgi.Controller): try: instance = self.compute_api.get(context, id) - self.scheduler_rpcapi.live_migration(context, - block_migration, - disk_over_commit, - instance["id"], - host, - topic=FLAGS.compute_topic) + self.compute_api.live_migrate(context, instance, block_migration, + disk_over_commit, host) except Exception: msg = _("Live migration of instance %(id)s to host %(host)s" " failed") % locals() |
