diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-11-22 08:59:36 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-11-22 08:59:36 +0000 |
| commit | d0432fabc8e5893fe1f7f043cd368836acaee087 (patch) | |
| tree | 0863a6008cd53cb811e5e1d97580e052c62cbfe3 /nova/virt | |
| parent | c45915391647ddf7798d46c50649d155985799ac (diff) | |
| parent | 7c5c8a743c21733120c85fdefb84b4357f5848d0 (diff) | |
Merge "Xenapi: Don't resize down if not auto_disk_config"
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 6 |
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, |
