Comment 0 for bug 1799221

Revision history for this message
Francois Deppierraz (francois-ctrlaltdel) wrote :

The following code from cinder/image/image_utils.py doesn't correctly handled cases where image_service.download raises an IOError which is due to something else than disk space issues (ie. network connection timeouts).

            try:
                image_service.download(context, image_id, image_file)
            except IOError as e:
                if e.errno == errno.ENOSPC:
                    params = {'path': os.path.dirname(path),
                              'image': image_id}
                    reason = _("No space left in image_conversion_dir "
                               "path (%(path)s) while fetching "
                               "image %(image)s.") % params
                    LOG.exception(reason)
                    raise exception.ImageTooBig(image_id=image_id,
                                                reason=reason)

Using openstack-ansible for queens, we experienced this issue because the storage system behind /var/lib/cinder/conversion was too slow and glance connections sometimes failed because of timeouts. When this happened, a truncated volume in status available was created while we would have expected it to be in error state instead.

The solution looks simple, raise the initial exception when e.errno != errno.ENOSPC