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 1032401 - Disk format in the virtual image descriptor is detected as raw if unspecified
Summary: Disk format in the virtual image descriptor is detected as raw if unspecified
Keywords:
Status: CLOSED DUPLICATE of bug 949226
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-manager
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Giuseppe Scrivano
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1032399
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-20 05:53 UTC by hyao@redhat.com
Modified: 2014-06-09 10:45 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1032399
Environment:
Last Closed: 2014-06-09 10:45:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description hyao@redhat.com 2013-11-20 05:53:59 UTC
Clone the bug since it reproduce with the packages below:
# rpm -qa libvirt virt-manager
virt-manager-0.10.0-7.el7.noarch
libvirt-1.1.1-12.el7.x86_64

+++ This bug was initially created as a clone of Bug #1032399 +++

Description
Add qcow2 and vmdk format disks in the virtual image descriptor. Use virt-image to provision the domain and the disks are detected to be raw. Use qcow2 image  but set format in xml as "raw" or other types,virt-image will not show error. 

Version:
# rpm -qa python-virtinst libvirt
python-virtinst-0.600.0-18.el6.noarch
libvirt-0.10.2-29.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a virtual image XML descriptor file with qcow2 and vmdk disk included.
# cat vmdk_qcow2.xml
<image>
<name>demo</name>
<domain>
<boot type="hvm">
<guest>
<arch>x86_64</arch>
</guest>
<os>
<loader dev="hd"/>
</os>
<drive disk="mydisk" target="hda"/>
<drive disk="user" target="hdb"/>
</boot>
<devices>
<vcpu>1</vcpu>
<memory>262144</memory>
<interface/>
<graphics/>
</devices>
</domain>
<storage>
<disk id="mydisk" file="kvm-rhel6.4-i386-qcow2.img" use="system"/>
<disk id="user" file="/var/lib/libvirt/images/vmdk" use="user"/>
</storage>
</image>

# qemu-img info vmdk
image: vmdk
file format: vmdk
virtual size: 100M (104857600 bytes)
disk size: 12K

# qemu-img info kvm-rhel6.4-i386-qcow2.img
image: kvm-rhel6.4-i386-qcow2.img
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: 1.9G
cluster_size: 65536

2. Create a virtual machine from image.xml
#v# virt-image vmdk_qcow2.xml


Creating guest demo...
Creating domain...                                                                                                                |    0 B     00:00  

3. Check the domain configuration file.
[root@7-204 images]# virsh dumpxml demo | grep disk -A 10
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/> ============>type should be qcow2
      <source file='/var/lib/libvirt/images/kvm-rhel6.4-i386-qcow2.img'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk> what format it is.
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/> ============>type should be vmdk
      <source file='/var/lib/libvirt/images/vmdk'/>
      <target dev='hdb' bus='ide'/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
4. Use qcow2 image but set the format to be "raw"
# cat qcow2.xml
<image>
...
<storage>
<disk id="mydisk" file="kvm-rhel6.4-i386-qcow2.img" format="raw"use="system"/>
</storage>
</image>

5. #virt-image qcow2.xml
Creating guest demo...
Creating domain...                                                                                                                |    0 B     00:00 
No error notify the wrong format is given in the xml descriptor. 

Check the domain configuration xml:
#virsh dumpxml demo 
...
<disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/kvm-rhel6.4-i386-qcow2.img'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
...


Actual results:
Step3: qcow2 and vmdk format disks in the virtual image descriptor are detected to be raw.  
Step5: And no error pops up about the wrong format in the xml descriptor.

 
Expected results:
Disk format in the virtual image descriptor are detected as what format the disk is. and errors notify the user once the wrong format in the xml descriptor.
Use virt-install to import an existing disk to deploy a vm, the disk format is detected automatically, virt-image is expected to do the same.

Comment 6 Giuseppe Scrivano 2014-06-09 10:45:31 UTC

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


Note You need to log in before you can comment on or make changes to this bug.