summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authormatt.dietz@rackspace.com <>2011-07-20 15:38:29 -0500
committermatt.dietz@rackspace.com <>2011-07-20 15:38:29 -0500
commit77347efae5171e5a6ffa5af885c0ffd7220688cf (patch)
tree97c2aa193075a648fe6b79af65ea37ac4208c7de /nova/virt
parentf926ae2a0fcf115beae78b8edfbf4ddee1d646be (diff)
Fix plus passing tests
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/xenapi/vmops.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index c332c27b0..8bce6bb89 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -566,17 +566,20 @@ class VMOps(object):
return new_cow_uuid
def resize_instance(self, instance, vdi_uuid):
- """Resize a running instance by changing it's RAM and disk size."""
+ """Resize a running instance by changing its RAM and disk size."""
#TODO(mdietz): this will need to be adjusted for swap later
#The new disk size must be in bytes
- new_disk_size = str(instance.local_gb * 1024 * 1024 * 1024)
+ new_disk_size = instance.local_gb * 1024 * 1024 * 1024
instance_name = instance.name
instance_local_gb = instance.local_gb
LOG.debug(_("Resizing VDI %(vdi_uuid)s for instance %(instance_name)s."
" Expanding to %(instance_local_gb)d GB") % locals())
vdi_ref = self._session.call_xenapi('VDI.get_by_uuid', vdi_uuid)
- self._session.call_xenapi('VDI.resize_online', vdi_ref, new_disk_size)
+ # for an instance with no local storage
+ if new_disk_size > 0:
+ self._session.call_xenapi('VDI.resize_online', vdi_ref,
+ str(new_disk_size))
LOG.debug(_("Resize instance %s complete") % (instance.name))
def reboot(self, instance):