Failed to get image info

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

Bug Description

I try to use imageutils.QemuImgInfo class to get the virtual_size info of my image in cinder, but an error occured:

2015-11-12 12:46:49.123 32474 ERROR oslo_messaging.rpc.dispatcher raise ValueError(_('Invalid input value "%s".') % details)
2015-11-12 12:46:49.123 32474 ERROR oslo_messaging.rpc.dispatcher ValueError: Invalid input value "unavailable".

If I manually run the qemu_img info command, the virtual_size can be successfully acquired:

#qemu-img info sheepdog:volume-1af1afa0-7820-4063-9b90-4fa6161a74a9
image: sheepdog:volume-1af1afa0-7820-4063-9b90-4fa6161a74a9
file format: raw
virtual size: 10G (10737418240 bytes)
disk size: unavailable

# qemu-img info -f rbd rbd:data/foo
image: rbd:data/foo
file format: rbd
virtual size: 10G (10737418240 bytes)
disk size: unavailable
cluster_size: 4194304

This occured both in ceph and sheepdog. We can see that disk size info is unavailable, but the virtual size really exists. Why I can't get the 'virtual size' info which is really exist?

zhangsong (zhangsong)
Changed in cinder:
assignee: nobody → zhangsong (zhangsong)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by zhangsong (<email address hidden>) on branch: master
Review: https://review.openstack.org/245241
Reason: This patch should be in openstack/oslo-incubator.

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

Reviewed: https://review.openstack.org/245241
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=7cf6d6457c74a63ec7df282c402fcd31a60a12af
Submitter: Jenkins
Branch: master

commit 7cf6d6457c74a63ec7df282c402fcd31a60a12af
Author: zhangsong <email address hidden>
Date: Sat Nov 14 00:44:53 2015 +0800

    Fix the bug of can't get the desired image info

    When we use 'qemu-img info' command to get image info, some kinds
    of image may show an 'unavailable' disk size. For example:

    $qemu-img info sheepdog:volume-1af1afa0-7820-4063-9b90-4fa6161a74a9
    image: sheepdog:volume-1af1afa0-7820-4063-9b90-4fa6161a74a9
    file format: raw
    virtual size: 10G (10737418240 bytes)
    disk size: unavailable

    $qemu-img info -f rbd rbd:data/foo
    image: rbd:data/foo
    file format: rbd
    virtual size: 10G (10737418240 bytes)
    disk size: unavailable
    cluster_size: 4194304

    The current code didn't consider 'unavailable' size, and it will
    raise a ValueError in this case. This patch fixed this bug by
    adding the judgment of 'unavailable' size.

    Change-Id: Ic5f3b80e172baaafc07432319f8aa24bf117b392
    Closes-Bug: #1516083

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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/254605

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/255058

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (stable/liberty)

Change abandoned by zhangsong (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/254605

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/liberty)

Reviewed: https://review.openstack.org/255058
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=59bb5c1f81a8b795b1f2f31babb047e6577e816e
Submitter: Jenkins
Branch: stable/liberty

commit 59bb5c1f81a8b795b1f2f31babb047e6577e816e
Author: zhangsong <email address hidden>
Date: Sat Nov 14 00:44:53 2015 +0800

    Fix the bug of can't get the desired image info

    When we use 'qemu-img info' command to get image info, some kinds
    of image may show an 'unavailable' disk size. For example:

    $qemu-img info sheepdog:volume-1af1afa0-7820-4063-9b90-4fa6161a74a9
    image: sheepdog:volume-1af1afa0-7820-4063-9b90-4fa6161a74a9
    file format: raw
    virtual size: 10G (10737418240 bytes)
    disk size: unavailable

    $qemu-img info -f rbd rbd:data/foo
    image: rbd:data/foo
    file format: rbd
    virtual size: 10G (10737418240 bytes)
    disk size: unavailable
    cluster_size: 4194304

    The current code didn't consider 'unavailable' size, and it will
    raise a ValueError in this case. This patch fixed this bug by
    adding the judgment of 'unavailable' size.

    Change-Id: Ic5f3b80e172baaafc07432319f8aa24bf117b392
    Closes-Bug: #1516083
    (cherry picked from commit 7cf6d6457c74a63ec7df282c402fcd31a60a12af)

tags: added: in-stable-liberty
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/oslo.utils 3.3.0

This issue was fixed in the openstack/oslo.utils 3.3.0 release.

Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in cinder 7.0.1

This issue was fixed in the cinder 7.0.1 release (liberty).

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.