diff options
| author | Scott Moser <smoser@ubuntu.com> | 2011-09-12 02:23:20 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-09-12 02:23:20 +0000 |
| commit | 66dd77887641f9db5f690f871b0cfb4d381d6a3e (patch) | |
| tree | 8e811d117156ffa1d5b85cb1c2e0182395a00781 /nova | |
| parent | 020d4e735977ffa4f632500f7b977c64721861e9 (diff) | |
| parent | dd7aa0234080d5c3512d0e9bab831a621aac10aa (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.py | 2 |
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) |
