nova does not grow qcow disk images correctly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Scott Moser |
Bug Description
I've just loaded a full disk qcow2 image from [1] to nova. I've noticed that the disk is not "resized up" as it is if a partition image is loaded. (Note related bug 833265)
Ie, given these 2 images, both running as 'm1.small' in this cloud:
ami-00000067 private smoser-
ami-00000066 public smoser-
Where:
$ qemu-img info oneiric-
image: oneiric-
file format: qcow2
virtual size: 2.0G (2147483648 bytes)
disk size: 194M
cluster_size: 65536
An m1.small instance launched from the qcow2 disk gets:
$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 2.0G 575M 1.3G 31% /
$ grep . /proc/partitions
major minor #blocks name
253 0 2097152 vda
253 1 2088450 vda1
253 16 20971520 vdb
But a m1.small instance launched from the partition image (ami-00000066) gets:
$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/vda 9.9G 576M 8.8G 7% /
$ grep . /proc/partitions
major minor #blocks name
253 0 10485760 vda
253 16 20971520 vdb
Note, I'm not expecting nova to rewrite the partition table and then attempt to resize the partition filesystems inside. I explicitly do not want that. I am asking that nova simply grow the disk, extending it with zeros.
The Ubuntu images have code that will rewrite the partition table on first boot if the disk is larger than the first partition [2], so all that is needed is to grow the disk.
[1] https:/
[2] http://
Related branches
- OpenStack release team: Pending requested
-
Diff: 12 lines (+1/-1)1 file modifiednova/virt/disk.py (+1/-1)
- Brian Waldon (community): Approve
- Brian Lamar (community): Approve
-
Diff: 12 lines (+1/-1)1 file modifiednova/virt/disk.py (+1/-1)
summary: |
- nova does not resize disks like it does partitions + nova does not grow disks images it does partition images |
summary: |
- nova does not grow disks images it does partition images + nova does not grow disk images as it does partition images |
summary: |
- nova does not grow disk images as it does partition images + nova does not grow qcow disk images correctly |
tags: | added: server-o-rs |
Changed in nova: | |
status: | Triaged → In Progress |
Changed in nova: | |
assignee: | nobody → Scott Moser (smoser) |
Changed in nova: | |
status: | In Progress → Fix Committed |
Changed in nova: | |
milestone: | none → 2011.3 |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Scott: thanks for the info there. I thought it was using truncate to expand the image, but it may not be doing so, especially in the case of a qcow2 disk.