Merge lp:~smoser/nova/lp836759 into lp:~hudson-openstack/nova/milestone-proposed

Proposed by Vish Ishaya
Status: Merged
Approved by: Vish Ishaya
Approved revision: 1525
Merged at revision: 1160
Proposed branch: lp:~smoser/nova/lp836759
Merge into: lp:~hudson-openstack/nova/milestone-proposed
Diff against target: 12 lines (+1/-1)
1 file modified
nova/virt/disk.py (+1/-1)
To merge this branch: bzr merge lp:~smoser/nova/lp836759
Reviewer Review Type Date Requested Status
OpenStack release team Pending
Review via email: mp+74940@code.launchpad.net

Description of the change

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.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/virt/disk.py'
2--- nova/virt/disk.py 2011-08-23 05:17:51 +0000
3+++ nova/virt/disk.py 2011-09-12 05:44:26 +0000
4@@ -58,7 +58,7 @@
5 file_size = os.path.getsize(image)
6 if file_size >= size:
7 return
8- utils.execute('truncate', '-s', size, image)
9+ utils.execute('qemu-img', 'resize', image, size)
10 # NOTE(vish): attempts to resize filesystem
11 utils.execute('e2fsck', '-fp', image, check_exit_code=False)
12 utils.execute('resize2fs', image, check_exit_code=False)

Subscribers

People subscribed via source and target branches