diff options
| author | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2011-11-17 13:47:56 -0600 |
|---|---|---|
| committer | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2011-11-18 17:35:43 +0000 |
| commit | 72fa94f72b361a6c097eaf071fe7f26b2ba4e924 (patch) | |
| tree | 7ddcb91d72f25035672c3e86a0d00a1883c825dc /nova/compute | |
| parent | 15937a41609a0216020aa23a8debbd10c1f74de6 (diff) | |
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
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 12 |
1 files changed, 11 insertions, 1 deletions
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): |
