Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add finish_resize() to the compute rpcapi.

This patch adds the finish_resize() method to the compute rpcapi.  It is
used by the compute manager.

Change-Id: I989bc70c1af44001a095e64b8abde05a0f99964d
  • Loading branch information...
commit 53d91a813a14c00400e14c4eeff3fa71c5b9d5b1 1 parent 00122d6
@russellb authored
View
13 nova/compute/manager.py
@@ -1402,17 +1402,8 @@ def resize_instance(self, context, instance_uuid, migration_id, image):
self._instance_update(context, instance_uuid,
task_state=task_states.RESIZE_MIGRATED)
- service = self.db.service_get_by_host_and_topic(
- context, migration_ref['dest_compute'], FLAGS.compute_topic)
- topic = rpc.queue_get_for(context,
- FLAGS.compute_topic,
- migration_ref['dest_compute'])
- params = {'migration_id': migration_id,
- 'disk_info': disk_info,
- 'instance_uuid': instance_ref['uuid'],
- 'image': image}
- rpc.cast(context, topic, {'method': 'finish_resize',
- 'args': params})
+ self.compute_rpcapi.finish_resize(context, instance_ref, migration_id,
+ image, disk_info, migration_ref['dest_compute'])
self._notify_about_instance_usage(context, instance_ref, "resize.end",
network_info=network_info)
View
7 nova/compute/rpcapi.py
@@ -96,6 +96,13 @@ def detach_volume(self, ctxt, instance, volume_id):
instance_uuid=instance['uuid'], volume_id=volume_id),
topic=self._compute_topic(ctxt, None, instance))
+ def finish_resize(self, ctxt, instance, migration_id, image, disk_info,
+ host):
+ self.cast(ctxt, self.make_msg('finish_resize',
+ instance_uuid=instance['uuid'], migration_id=migration_id,
+ image=image, disk_info=disk_info),
+ topic=self._compute_topic(ctxt, host, instance))
+
def finish_revert_resize(self, ctxt, instance, migration_id, host):
self.cast(ctxt, self.make_msg('finish_revert_resize',
instance_uuid=instance['uuid'], migration_id=migration_id),
View
5 nova/tests/compute/test_rpcapi.py
@@ -104,6 +104,11 @@ def test_detach_volume(self):
self._test_compute_api('detach_volume', 'cast',
instance=self.fake_instance, volume_id='id')
+ def test_finish_resize(self):
+ self._test_compute_api('finish_resize', 'cast',
+ instance=self.fake_instance, migration_id='id',
+ image='image', disk_info='disk_info', host='host')
+
def test_finish_revert_resize(self):
self._test_compute_api('finish_revert_resize', 'cast',
instance=self.fake_instance, migration_id='id', host='host')
Please sign in to comment.
Something went wrong with that request. Please try again.