Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 918989

Summary: Creating new VM from existing image format (qcow2) is not correctly recognized
Product: Red Hat Enterprise Linux 6 Reporter: Marian Csontos <mcsontos>
Component: virt-managerAssignee: Martin Kletzander <mkletzan>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4CC: acathrow, codong, dallan, dyuan, gscrivan, hyao, lcui, mjenner, mkletzan, shyu, tzheng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 949226 (view as bug list) Environment:
Last Closed: 2014-02-19 11:28:43 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 949226    

Description Marian Csontos 2013-03-07 10:51:03 UTC
Description of problem:
When using virt-manager UI to create a new VM from existing disk qcow2 image, the image format is not recognized and raw is always used. One has to modify configuration manually. `file $IMAGE` states correctly file is qcow2 image.

Version-Release number of selected component (if applicable):
virt-manager-0.9.0-18.el6.x86_64
libvirt-0.10.2-18.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Take an existing qcow2 image
2. Create a VM from the image using virt-manager's UI using existing image
  
Actual results:
- VM does not boot
- see machine's details: image is imported as raw

Expected results:
- image type is recognized and set correctly in the XML

Additional info:
- same behavior seen on F17, clone if upstream is affected, please.

Comment 1 CongDong 2013-04-02 09:37:04 UTC
I can't reproduce this bug.
1. Install a win7 guest with qcow2
2. After installation copy the img file of win7 to a new one named "new-win7"
  #qemu-img info new-win7
  image: new-win7.img
  file format: qcow2
  virtual size: 15G (16106127360 bytes)
  disk size: 7.1G
  cluster_size: 65536
3. Create a VM "new-win7" from the image using new-win7, the VM work well, and the disk type is qcow2
 #virsh dumpxml new-win7
    ...
     <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/new-win7.img'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
   ...


-----------------
RHEL 6.4 
[root@localhost ~]# rpm -qa virt-manager libvirt qemu-kvm
virt-manager-0.9.0-18.el6.x86_64
libvirt-0.10.2-18.el6.x86_64
qemu-kvm-0.12.1.2-2.355.el6.x86_64
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

Comment 2 Marian Csontos 2013-04-02 14:04:33 UTC
I spot one difference: my image was created on command-line and is not in any pool.

the qemu-img says:

    > qemu-img info f18-clone.img 
    image: f18-clone.img
    file format: qcow2
    virtual size: 8.0G (8589934592 bytes)
    disk size: 4.0G
    cluster_size: 65536

After selecting the image, the last step of the New... VM "Wizard/Guide" says:

    Storage: 4.1 Gb /path/to/the/image

So the size is wrong here.

Also, when I check the Customize configuration before install, opening "Disk 1" `Storage format` is empty. And the VM of course does not boot saying:

    No bootable device

So the type of disk is wrong too.

Comment 3 Marian Csontos 2013-04-02 14:16:24 UTC
I verified that's likely the issue. When using image in a pool the type is correct.

Comment 4 CongDong 2013-04-07 03:16:30 UTC
I can produce this bug with the image I created with command-line:

# qemu-img create -f qcow2 /home/node.img 10G
Formatting '/home/node.img', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536
# qemu-img info node.img 
image: node.img
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 136K
cluster_size: 65536

Comment 7 Giuseppe Scrivano 2014-02-19 11:28:43 UTC
the feature is present upstream, but the backport is not trivial at this point.