summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-11-22 08:59:36 +0000
committerGerrit Code Review <review@openstack.org>2012-11-22 08:59:36 +0000
commitd0432fabc8e5893fe1f7f043cd368836acaee087 (patch)
tree0863a6008cd53cb811e5e1d97580e052c62cbfe3 /nova/virt
parentc45915391647ddf7798d46c50649d155985799ac (diff)
parent7c5c8a743c21733120c85fdefb84b4357f5848d0 (diff)
Merge "Xenapi: Don't resize down if not auto_disk_config"
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/xenapi/vmops.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 4915804a9..a68c9eb8d 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -770,8 +770,10 @@ class VMOps(object):
"""
vm_ref = self._get_vm_opaque_ref(instance)
sr_path = vm_utils.get_sr_path(self._session)
- resize_down = (instance['auto_disk_config'] and
- instance['root_gb'] > instance_type['root_gb'])
+ resize_down = instance['root_gb'] > instance_type['root_gb']
+ if resize_down and not instance['auto_disk_config']:
+ reason = _('Resize down not allowed without auto_disk_config')
+ raise exception.ResizeError(reason=reason)
# 0. Zero out the progress to begin
self._update_instance_progress(context, instance,