From 72fa94f72b361a6c097eaf071fe7f26b2ba4e924 Mon Sep 17 00:00:00 2001 From: "Kevin L. Mitchell" Date: Thu, 17 Nov 2011 13:47:56 -0600 Subject: Implement schedule_prep_resize() Implement schedule_prep_resize() in the distributed scheduler. Adds a request_spec argument to enable the current host of an instance to be excluded for resizes. Corrects bug 888236. Change-Id: Ia52415e79639275a06bef59f1e13ca64bf7243ee --- nova/compute/api.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index 5c7ed9ba3..490e91ace 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1294,12 +1294,22 @@ class API(base.Base): vm_state=vm_states.RESIZING, task_state=task_states.RESIZE_PREP) + request_spec = { + 'instance_type': new_instance_type, + 'filter': None, + 'num_instances': 1, + 'original_host': instance['host'], + 'avoid_original_host': not FLAGS.allow_resize_to_same_host, + 'local_zone': True, + } + self._cast_scheduler_message(context, {"method": "prep_resize", "args": {"topic": FLAGS.compute_topic, "instance_id": instance['uuid'], "update_db": False, - "instance_type_id": new_instance_type['id']}}) + "instance_type_id": new_instance_type['id'], + "request_spec": request_spec}}) @scheduler_api.reroute_compute("add_fixed_ip") def add_fixed_ip(self, context, instance, network_id): -- cgit