From 843af52d49554f15c13e5617b9eb672c35c7fe51 Mon Sep 17 00:00:00 2001 From: Alessandro Tagliapietra Date: Tue, 11 Sep 2012 19:39:13 +0200 Subject: Check flavor id on resize. Actually it checks for memory size changes so you can't change just cpu or hdd when resizing instances. Fixes bug 1049195 Change-Id: I793d19dbf5f1d89d365e63ab61b4edb983fdb11c --- nova/compute/api.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index 95ad4b7d0..230c55eae 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1580,11 +1580,8 @@ class API(base.Base): # NOTE(markwash): look up the image early to avoid auth problems later image = self.image_service.show(context, instance['image_ref']) - current_memory_mb = current_instance_type['memory_mb'] - new_memory_mb = new_instance_type['memory_mb'] - - if (current_memory_mb == new_memory_mb) and flavor_id: - raise exception.CannotResizeToSameSize() + if same_instance_type and flavor_id: + raise exception.CannotResizeToSameFlavor() # ensure there is sufficient headroom for upsizes deltas = self._upsize_quota_delta(context, new_instance_type, -- cgit