failed to copy volume to image

Bug #1514442 reported by zhangsong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
zhangsong

Bug Description

When I try to upload volume to image in horizon, an error occurred like this :

'''
2015-11-09 07:57:04.777 26189 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/image/image_utils.py", line 129, in _convert_image
2015-11-09 07:57:04.777 26189 ERROR oslo_messaging.rpc.dispatcher fsz_mb = os.stat(source).st_size / units.Mi
2015-11-09 07:57:04.777 26189 ERROR oslo_messaging.rpc.dispatcher OSError: [Errno 2] No such file or directory: 'sheepdog:10.133.17.61:7000:volume-a0a70f9b-a50e-4369-885f-c41a894c9fe5'
'''

I use sheepdog as cinder backend.

zhangsong (zhangsong)
description: updated
Changed in cinder:
assignee: nobody → zhangsong (zhangsong)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/243152

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/243152
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=53073d19217778d6af48e9eb7d8f96ca7a92b931
Submitter: Jenkins
Branch: master

commit 53073d19217778d6af48e9eb7d8f96ca7a92b931
Author: zhangsong <email address hidden>
Date: Mon Nov 9 23:00:08 2015 +0800

    Fix the bug of OSError when convert image

    When I try to convert a image use image_utils.convert_image() method,
    an error occurred like this :
    '''
    OSError: [Errno 2] No such file or directory:
    'sheepdog:10.133.17.61:7000:volume-a0a70f9b-a50e-4369-885f-c41a894c9fe5'
    '''
    The reason is that in some cluster storage systems, like
    ceph/sheepdog, QEMU can access an image directly via their private
    protocol, and there’s no need to map an image as a block device on
    the host. In this case, the qemu-img convert command may like:

        #qemu-img convert -O raw sheepdog:Ip:port:image_name temp_file
        #qemu-img convert -O raw rbd:pool_name/image_name temp_file

    The source path may be 'sheepdog:Ip:port:image_name' or
    'rbd:pool_name/image_name', it doesn't exist in OS. So, when it runs
    the os.stat(source) in image_utils.convert_image(source,dest,out_format)
    method, an OSError would be raised.

    We can use qemu_img_info method instead to resolve this problem, because
    the 'qemu-img info' command can always get the image size info which has
    support qemu-img tool. Here we capture a ValueError just in case, but it
    only need to give a warning message, because the image has been successfully
    converted.

    Change-Id: I5fd1e51840972a67053b85a76f8e001fa8148ad7
    Closes-Bug: #1514442

Changed in cinder:
status: In Progress → Fix Committed
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/cinder 8.0.0.0b1

This issue was fixed in the openstack/cinder 8.0.0.0b1 development milestone.

Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.