create a volume from image failed on downloading if the volume size is smaller than the image size
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Invalid
|
Undecided
|
Thang Pham |
Bug Description
My image size is 1.5GB, and require disk space at least 4GB. When I create a volume with size to 1GB and from this image.
It failed, but failed during downloading, and only give a "error" information, nothing else.
It would be better to be failed at cinder API server like Nova to check to see if the volume size is big enough for the image.
for example, in Nova API server, :
root_gb = instance_
if root_gb:
if int(image.
if int(image.
When you boot a VM with a smaller flavor for the image, it will throw an exception to indicate what exactly happened.
Error: Flavor's disk is too small for requested image. (HTTP 400) (Request-ID: req-e4116085-
Changed in cinder: | |
assignee: | nobody → Thang Pham (thang-pham) |
I took a look at the bug. The proper checks are in place and are working. The reason you are not seeing the error message (as in nova) is that the virtual disk size is not found until after the task starts. Since the task spawned successfully, no error messages were shown.
The task essentially calls driver. copy_image_ to_volume, which calls image_utils. fetch_to_ volume_ format. The virtual disk size is found at https:/ /github. com/openstack/ cinder/ blob/master/ cinder/ image/image_ utils.py# L225. It fails at https:/ /github. com/openstack/ cinder/ blob/master/ cinder/ image/image_ utils.py# L233.
If you look at the c-vol.log, you would clearly see the error: cinder/ cinder/ volume/ flows/manager/ create_ vol to_volume\ n raise exception. ImageUnacceptab le(ex)\ n', "ImageUnacceptable: d371-47b1- bff1-fbce069c95 47 is unacceptable: Size is 2GB and doesn't fit in a volume of size 1
File "/opt/stack/
ume.py", line 501, in _copy_image_
Image f8b0c104-
GB.\n"]
I do not believe this is something that can be fixed, since it requires you to fetch the image in order to determine the virtual disk size. Alternatively, you could put a min-disk size requirement on the image, so that an error message similar to nova's can be shown, and the command would fail before trying to fetch the image.