Bug 1044396

Summary: virt-manager doesn't automatically recognize qcow2 when importing image
Product: Red Hat Enterprise Linux 7 Reporter: Martin <mholec>
Component: virt-managerAssignee: virt-mgr-maint
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: dyuan, gscrivan, hyao, lcui, mkletzan, tpelka, tzheng
Target Milestone: rc   
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1048691 (view as bug list) Environment:
Last Closed: 2014-01-16 14:45:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1048691    

Description Martin 2013-12-18 09:15:39 UTC
Description of problem:
virt-manager doesn't automatically recognize qcow2  when importing image

Version-Release number of selected component (if applicable):
virt-manager-0.10.0-7.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. Create new VM
2. Select: Import existing disk image
3. Provide path to image.
4. Complete setup and boot VM.

Actual results:
VM won't boot from image.
Storage format is in advanced options set to: raw

Expected results:
VM should boot from image.
Storage format in advanced options should be set to: qcow2

Additional info:
tested image: http://alt.fedoraproject.org/pub/fedora/linux/releases/19/Images/x86_64/Fedora-x86_64-19-20130627-sda.qcow2

Comment 1 tingting zheng 2013-12-19 09:11:25 UTC
I can not reproduce this issue
version:
virt-manager-0.10.0-8.el7.noarch

Steps:
1.Create qcow2 img.
# qemu-img create qcow2.img 1G -f qcow2
Formatting 'qcow2.img', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 lazy_refcounts=off

2.Use virt-manager to create a new vm,importing the image create by step1.

3.Storage format in advanced options is set as:qcow2.

4.Check the xml of the guest,the format of disk also show as qcow2.

    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/qcow2.img'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

Comment 2 Giuseppe Scrivano 2013-12-19 09:27:17 UTC
the directory /var/lib/libvirt/images is a libvirt storage pool.  The problem happens when you import an existing image that is not under a storage pool.

Comment 3 tingting zheng 2013-12-19 09:38:53 UTC
(In reply to Giuseppe Scrivano from comment #2)
> the directory /var/lib/libvirt/images is a libvirt storage pool.  The
> problem happens when you import an existing image that is not under a
> storage pool.

Yes,you are right,the image with qcow2 format in other directory instead of libvirt storage pool will show as raw from virt-manager GUI.

Comment 4 hyao@redhat.com 2014-01-06 05:58:56 UTC
I can reproduce this bug on 
# rpm -qa libvirt virt-manager
libvirt-1.1.1-17.el7.x86_64
virt-manager-0.10.0-9.el7.noarch


Steps: 

1. Import a qcow2 image to create a guest.
# qemu-img info /tmp/kvm-rhel6.5-x86_64-qcow2.img.1 
image: /tmp/kvm-rhel6.5-x86_64-qcow2.img.1
file format: qcow2
virtual size: 3.9G (4194304000 bytes)
disk size: 2.7G
cluster_size: 65536
Format specific information:
    compat: 0.10

2. Check the xml of the guest: 

<disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/tmp/kvm-rhel6.5-x86_64-qcow2.img.1'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>

Actual Result:
The disk format qcow2 is recognized as raw.

Comment 5 Martin Kletzander 2014-01-16 14:45:38 UTC

*** This bug has been marked as a duplicate of bug 949226 ***