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
(cherry picked from commit 6e287c0f2bb7d4994d50f1763f412277e4dac6f7)
Reviewed: https:/ /review. openstack. org/56188 github. com/openstack/ cinder/ commit/ c5cb131c5fbc8aa 5c5992a81468dd3 0631d9c8e9
Committed: http://
Submitter: Jenkins
Branch: stable/havana
commit c5cb131c5fbc8aa 5c5992a81468dd3 0631d9c8e9
Author: Xavier Queralt <email address hidden>
Date: Tue Oct 22 20:37:53 2013 +0200
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 eb7eb913b37d27a 14e97568dec 94d50f1763f4122 77e4dac6f7)
Change-Id: I254cd9e3acf5d9
(cherry picked from commit 6e287c0f2bb7d49