]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Fail when image is bigger than the volume
authorXavier Queralt <xqueralt@redhat.com>
Tue, 22 Oct 2013 18:37:53 +0000 (20:37 +0200)
committerXavier Queralt <xqueralt@redhat.com>
Tue, 12 Nov 2013 12:00:15 +0000 (13:00 +0100)
commit6e287c0f2bb7d4994d50f1763f412277e4dac6f7
treeb835dabc0944e9fad9257048f79322fb433d26fa
parent20d177db3747610d931666a7261d6fd92e91c5de
Fail when image is bigger than the volume

When creating a new volume from a qcow2 image stored in glance, we will
be given the physical size of the image instead of the virtual size.
Most drivers will convert that image to raw after downloading for
resizing it to the requested volume size afterwards.

If the virtual size of the image is bigger than the requested one, the
resulting volume might end up being unusable after the resize even
though the creation went good.

This patch will make the volume creation fail if the virtual size of
the image exceeds the one of the requested volume.

Closes-Bug: #1235358
Change-Id: I254cd9e3acf5d9eb7eb913b37d27a14e97568dec
15 files changed:
cinder/image/image_utils.py
cinder/tests/test_block_device.py
cinder/tests/test_coraid.py
cinder/tests/test_image_utils.py
cinder/tests/test_nfs.py
cinder/tests/test_rbd.py
cinder/tests/test_scality.py
cinder/tests/test_volume.py
cinder/volume/driver.py
cinder/volume/drivers/block_device.py
cinder/volume/drivers/gpfs.py
cinder/volume/drivers/lvm.py
cinder/volume/drivers/nfs.py
cinder/volume/drivers/rbd.py
cinder/volume/drivers/scality.py