Ask Your Question
3

Can't convert image to volume

asked 2018-02-26 14:47:24 -0600

makz gravatar image

updated 2018-03-02 18:13:58 -0600

Hello,

I'm trying to convert a CentOS7 image to a volume, the volume is create but it's empty and i get this error

==> /var/log/cinder/volume.log <==
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume [req-32a018ce-8b9f-4823-b22f-d2d7909ec001 3829056496a04d929af44e29efc7568b f2b81bf3d8ec40c191ae06bc2682e606 - default default] Failed to copy image 9c469b08-3ed2-4252-b9ac-4cf1f8553675 to volume: ce370d4e-0e1e-4a20-b0e3-3025c4552ddc: ImageTooBig: Image 9c469b08-3ed2-4252-b9ac-4cf1f8553675 size exceeded available disk space: There is no space to convert image. Requested: 8589934592, available: 8312008704
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume Traceback (most recent call last):
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume   File "/usr/lib/python2.7/site-packages/cinder/volume/flows/manager/create_volume.py", line 555, in _copy_image_to_volume
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume     context, volume, image_service, image_id)
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume   File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/lvm.py", line 510, in copy_image_to_volume
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume     size=volume['size'])
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume   File "/usr/lib/python2.7/site-packages/cinder/image/image_utils.py", line 339, in fetch_to_raw
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume     run_as_root=run_as_root)
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume   File "/usr/lib/python2.7/site-packages/cinder/image/image_utils.py", line 412, in fetch_to_volume_format
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume     check_available_space(dest, data.virtual_size, image_id)
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume   File "/usr/lib/python2.7/site-packages/cinder/image/image_utils.py", line 517, in check_available_space
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume     raise exception.ImageTooBig(image_id=image_id, reason=msg)
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume ImageTooBig: Image 9c469b08-3ed2-4252-b9ac-4cf1f8553675 size exceeded available disk space: There is no space to convert image. Requested: 8589934592, available: 8312008704
2018-02-26 21:37:10.359 4488 ERROR cinder.volume.flows.manager.create_volume 
2018-02-26 21:37:10.623 4488 INFO cinder.volume.flows.manager.create_volume [req-32a018ce-8b9f-4823-b22f-d2d7909ec001 3829056496a04d929af44e29efc7568b f2b81bf3d8ec40c191ae06bc2682e606 - default default] Volume volume-ce370d4e-0e1e-4a20-b0e3-3025c4552ddc (ce370d4e-0e1e-4a20-b0e3-3025c4552ddc): created successfully
2018-02-26 21:37:10.629 4488 INFO cinder.volume.manager [req-32a018ce-8b9f-4823-b22f-d2d7909ec001 3829056496a04d929af44e29efc7568b f2b81bf3d8ec40c191ae06bc2682e606 - default default] Created volume successfully.

[root@cinder ~]# grep -E ^image_conversion /etc/cinder/cinder.conf 
image_conversion_dir = /var/lib/cinder/conversion
[root@cinder ~]# ll /var/lib/cinder/conversion
total 0
[root@cinder ~]# df -h /var/lib/cinder/conversion
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg00-var   30G  1.7G   29G   6% /var

As you can see, i have the room for the temporary image conversion, the image is ~8go

Up to date cluster.

Any ideas ?


Thanks


Edit:

The volume is 20Gb so, 8gb fit in 20gb volume and 8gb raw image fit in my ~29gb free tmp partition, i've commented the condition checking the free space on conversion (/usr/lib/python2.7/site-packages/cinder/image/image_utils ... (more)

edit retag flag offensive close merge delete

Comments

I have the same problem. Just as you said, editing out the space check and then restarting cinder worked for me. I am also using Pike (Packstack, in this case). I see your log file tells you about 8GB free (8312008704), but mine says about 4GB (4089868288). I have 41GB free.

MatthewSecaur gravatar imageMatthewSecaur ( 2018-03-07 08:06:44 -0600 )edit
1

FYI: Problem still exists in Queens, but the offending section is at line 588.

MatthewSecaur gravatar imageMatthewSecaur ( 2018-03-09 15:34:28 -0600 )edit

Thanks guys. It finally worked!

hson89 gravatar imagehson89 ( 2018-03-11 13:16:22 -0600 )edit

I've just run into this in a kolla-ansible deployed cloud for queens. How is this still not fixed in upstream?

theque42 gravatar imagetheque42 ( 2018-04-27 07:38:42 -0600 )edit

3 answers

Sort by » oldest newest most voted
0

answered 2018-02-28 00:21:36 -0600

Deepa gravatar image

What was the minimum disk size mentioned while image creation ?What is the size of the volume given ?error clearly says it doesn't have room for Image to Volume conversion .Try downloading a fresh cent OS image and make sure not to mention anything in minimum disk and then convert it to volume

edit flag offensive delete link more

Comments

1

The centos image in qcow is ~850mb, the raw is 8go. The volume is 20Gb.

I've commented out the condition checking the space for conversion and my volume has been created with image conversion. The temporary file is in the right folder /var/lib/cinder/conversion.

Idk what's happening here.

makz gravatar imagemakz ( 2018-02-28 02:13:37 -0600 )edit
0

answered 2018-06-08 16:14:06 -0600

ckonstanski gravatar image

updated 2018-06-08 16:57:43 -0600

Also seeing this issue in queens.

The image has a 2.2 GB partition table size:

ckonstanski@sphinkpad:~/media/iso $ sudo fdisk -l /dev/nbd0
Festplatte /dev/nbd0: 2,2 GiB, 2361393152 Bytes, 4612096 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 512 Bytes
E/A-Größe (minimal/optimal): 512 Bytes / 512 Bytes
Festplattenbezeichnungstyp: gpt
Festplattenbezeichner: 5F593404-0505-4FDA-8A39-CC2B7C79C90D

Gerät        Anfang    Ende Sektoren Größe Typ
/dev/nbd0p1  227328 4612062  4384735  2,1G Linux-Dateisystem
/dev/nbd0p14   2048   10239     8192    4M BIOS boot
/dev/nbd0p15  10240  227327   217088  106M EFI-System

The volume I'm trying to load with this image is 20 GB. There is 235 GB free on the storage host.

There is this openstack bug, but it does not address queens. The ceph bit is just the reporter's personal situation. My image is QCOW2 and it needs to be converted. But there is plenty of free space to perform the conversion.

https://bugs.launchpad.net/cinder/+bug/1683228 (https://bugs.launchpad.net/cinder/+bu...)

I converted the image to raw and tried again. Same problem. So I added some more debugging output to image_utils.py. Here is the error with the image conversion destination directory added:

msg = ('There is no space to convert image. '
        'Destination: %(dest)s, Requested: %(image_size)s, available: %(free_space)s'
        ) % {'dest': dest, 'image_size': image_size, 'free_space': free_space}

The output:

ERROR cinder.volume.flows.manager.create_volume ImageTooBig: Image 715a1396-582d-4567-8907-e6a48cb1a885 size exceeded available disk space: There is no space to convert image. Destination: /dev/mapper, Requested: 2361393152, available: 1015443456

It seems very strange that we're using /dev/mapper (or any other pseudofilesystem) as our location to convert a qemu image.

>>> import psutil
>>> print psutil.disk_usage("/dev/mapper").free
1015443456
>>> print psutil.disk_usage("/tmp").free
251659313152
edit flag offensive delete link more
0

answered 2018-03-02 16:08:26 -0600

@Deepa is on the right track with the internal image size - your concern is not the free space left on the compute node, but the partition layou that the CentOS image has been created with. If I remember correctly, the CentOS cloudimage had an 8GB internal partition.

Even though the image itself might be smaller, your Cinder volume must be able to fit the unpacked disk layout, so try creating it with said 8GB volume.

If you want to be sure, you can mount the image with qemu-nbd (if the format is qcow) and see the partition layout for yourself with e.g. fdisk -l. Everything you need to know about mounting a qcow-formatted image is here: http://alexeytorkhov.blogspot.sk/2009...

edit flag offensive delete link more

Comments

I doubt it, since the error information clearly complains on "There is no space to convert image". I have the same problem with a 5 gig volume and a fedora glance image that contains a 4 gig partition

theque42 gravatar imagetheque42 ( 2018-04-27 07:42:21 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2018-02-26 14:47:24 -0600

Seen: 825 times

Last updated: Jun 08