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 620456 - virt-install misidentify qcow2 images as raw
Summary: virt-install misidentify qcow2 images as raw
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst
Version: 6.0
Hardware: All
OS: Linux
low
urgent
Target Milestone: rc
: ---
Assignee: Cole Robinson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 615239 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-08-02 15:07 UTC by Juan Quintela
Modified: 2013-01-09 22:58 UTC (History)
9 users (show)

Fixed In Version: python-virtinst-0.500.3-7.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-10 21:23:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Set qemu format= value from passed virt-install format= (4.46 KB, text/plain)
2010-08-02 16:41 UTC, Cole Robinson
no flags Details

Description Juan Quintela 2010-08-02 15:07:01 UTC
Description of problem:

virt-install (via libvirt) misidentifies qcow2 images as raw failing installation

Version-Release number of selected component (if applicable):


How reproducible:

Always

Steps to Reproduce:
1. create new qcow2 image
   $ qemu-img create /var/lib/libvirt/images/rhel6.0X-64.img 6G -f  qcow2
   Formatting '/var/lib/libvirt/images/rhel6.0X-64.img', fmt=qcow2
   size=6442450944 encryption=off cluster_size=0 

2. run virt-install
time virt-install --pxe --disk path=/mnt/images/r60X-64.img  --name r60X-64 --ram=1024 --network bridge=br0 --os-variant=rhel6
  
Actual results:

Installation fails with error "Disk not big enough".
doing a ps -aux shows that qemu is launched with format=raw for the image.

Expected results:

Complete the installation using format=qcow2

Additional info:

Adding format=qcow2 to the virt-install command line makes no difference.

Comment 2 RHEL Program Management 2010-08-02 15:27:56 UTC
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **

Comment 3 Cole Robinson 2010-08-02 16:41:23 UTC
Created attachment 436064 [details]
Set qemu format= value from passed virt-install format=

This is the unfortunate fallout of the recent libvirt CVE fixes. We
currently depend on libvirt's image file format detection for setting
the qemu format= option, however that just offloaded the original qemu
format CVE to libvirt. Now libvirt defaults to reporting all image files
as 'raw' format.

virt-install needs to be fixed to use the user passed format= option
when setting the qemu format= value. This is easy if the user is asking
virt-install to create a new disk image, since the format needs to be
required, but pointing to an existing qcow2 image now requires explictly
specifying the --disk format= value.

Comment 4 Cole Robinson 2010-08-02 16:50:15 UTC
This is potential blocker material, depending on how important qcow2 is. Risk is low, but it is in an area of the code that is slightly complex, QE would want to make sure raw disk creation still works fine.

Instructions for QE:

virt-install --disk path=...,format=qcow2 --debug should show

<driver name='qemu' type='qcow2'/>

in the generated XML. If a format isn't specified, type should be ='raw'. Verify that creating a guest from an existing qcow2 image boots up fine.

Workaround for this unfortunately requires manually editing the XML after creating the guest. And this fix doesn't address adding qcow2 images via virt-manager: that is still broken and would require manually editing the XML.

Comment 8 Cole Robinson 2010-08-03 18:04:28 UTC
Fixed in python-virtinst-0.500.3-7.el6

Comment 10 Cole Robinson 2010-08-06 18:10:04 UTC
*** Bug 615239 has been marked as a duplicate of this bug. ***

Comment 11 Johnny Liu 2010-08-11 08:16:15 UTC
Verify this bug with python-virtinst-0.500.3-7.el6.noarch, and PASSED.

1. Create new qcow2 image
   $ qemu-img create /var/lib/libvirt/images/rhel6.0X-64.img 6G -f  qcow2
   Formatting '/var/lib/libvirt/images/rhel6.0X-64.img', fmt=qcow2
   size=6442450944 encryption=off cluster_size=0

2. Copy this image file to /mnt/images

3. Run virt-install
# virt-install --pxe --disk path=/mnt/images/r60X-64.img,format=qcow2  --name r60X-64 --ram=1024 --network bridge=br0 --os-variant=rhel6

4. Dump domain xml to check disk driver type:
<---SNIP---->
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/mnt/images/rhel6.0X-64.img'/>
<---SNIP---->

And installation is finished successfully.

If not specify format at step 3, the disk type will be "raw", this will cause installation failed. This is expected behaviour.
# virt-install --pxe --disk path=/mnt/images/rhel6.0X-64.img  --name r60X-64 --ram=1024 --network bridge=br0 --os-variant=rhel6

Dump domain xml to check disk driver type:
<---SNIP---->
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/mnt/images/rhel6.0X-64.img'/>
<---SNIP---->

So this bug is fixed.

Comment 12 releng-rhel@redhat.com 2010-11-10 21:23:58 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.


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