Bug 1032399 - Disk format in the virtual image descriptor are detected to be raw if without sepcified and no error pops up about the wrong format given in the xml.
Summary: Disk format in the virtual image descriptor are detected to be raw if withou...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst
Version: 6.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: virt-mgr-maint
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1032401
TreeView+ depends on / blocked
 
Reported: 2013-11-20 05:48 UTC by hyao@redhat.com
Modified: 2014-02-06 17:24 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1032401 (view as bug list)
Environment:
Last Closed: 2014-02-06 17:24:58 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description hyao@redhat.com 2013-11-20 05:48:24 UTC
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 2 Giuseppe Scrivano 2014-02-06 17:24:58 UTC
it looks like a minor problem.  I am going to close it, please reopen if I am underestimating this issue.


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