summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-09-12 02:23:20 +0000
committerTarmac <>2011-09-12 02:23:20 +0000
commit66dd77887641f9db5f690f871b0cfb4d381d6a3e (patch)
tree8e811d117156ffa1d5b85cb1c2e0182395a00781 /nova
parent020d4e735977ffa4f632500f7b977c64721861e9 (diff)
parentdd7aa0234080d5c3512d0e9bab831a621aac10aa (diff)
use 'qemu-image resize' rather than 'truncate' to grow image files
qcow-image is capable of growing qcow formated disks in addition to being able to grow a qcow formated one. (LP: #836759) I've verified that after this change both a full disk uploaded as 'raw' and one that was uploaded as 'qcow2' are correctly resized, and that in oneiric, the instance has its root filesystem resized for /dev/vda1 correctly.
Diffstat (limited to 'nova')
-rw-r--r--nova/virt/disk.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/virt/disk.py b/nova/virt/disk.py
index 52b2881e8..50c7c40e9 100644
--- a/nova/virt/disk.py
+++ b/nova/virt/disk.py
@@ -58,7 +58,7 @@ def extend(image, size):
file_size = os.path.getsize(image)
if file_size >= size:
return
- utils.execute('truncate', '-s', size, image)
+ utils.execute('qemu-img', 'resize', image, size)
# NOTE(vish): attempts to resize filesystem
utils.execute('e2fsck', '-fp', image, check_exit_code=False)
utils.execute('resize2fs', image, check_exit_code=False)