Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 622684 - virt-convert: converted qcow2 image failed to boot guest
virt-convert: converted qcow2 image failed to boot guest
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst (Show other bugs)
6.1
All Linux
low Severity medium
: rc
: ---
Assigned To: Cole Robinson
Virtualization Bugs
: RHELNAK
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-10 03:13 EDT by weizhang
Modified: 2011-06-09 23:40 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
virt-convert did not preserve the storage format in the generated xml configuration file causing some image files to fail to boot with the error "no bootable device". The xml configuration now correctly preserves the storage format allowing the image to boot successfully.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-19 09:45:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0636 normal SHIPPED_LIVE python-virtinst bug fix and enhancement update 2011-05-18 13:55:48 EDT

  None (edit)
Description weizhang 2010-08-10 03:13:51 EDT
Description of problem:
Converting vmdk to qcow2 format image files succeeded, but the image files failed to boot with error "no bootable device".


Version-Release number of selected component (if applicable):
libvirt-0.8.1-21.el6.x86_64
python-virtinst-0.500.3-7.el6.noarch
qemu-kvm-0.12.1.2-2.108.el6.x86_64
kernel 2.6.32-59.1.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.# virt-convert -i vmx -o virt-image -D qcow2 ESX4-RHEL5U4-x86_64-kvm-smp.vmx 
Generating output in 'virt-image' format to ESX4-RHEL5U4-x86_64-kvm-smp/
Converting disk 'ESX4-RHEL5U4-x86_64-kvm-smp-flat.vmdk' to type qcow2...
Done.
2.ls ESX4-RHEL5U4-x86_64-kvm-smp
ESX4-RHEL5U4-x86_64-kvm-smp-flat.qcow2  ESX4-RHEL5U4-x86_64-kvm-smp.virt-image.xml
3.boot the qcow2 file
  
Actual results:
fail to boot with error "no bootable device"

Expected results:
boot successfully

Additional info:
vi ESX4-RHEL5U4-x86_64-kvm-smp.virt-image.xml

<image>
 <name>ESX4-RHEL5U4-x86_64-kvm-smp</name>
 <label>ESX4-RHEL5U4-x86_64-kvm-smp</label>
 <description></description>
 <domain>

  <boot type="hvm">
   <guest>
    <arch>x86_64</arch>
   </guest>
   <os>
    <loader dev="hd"/>
   </os>
   <drive disk="ESX4-RHEL5U4-x86_64-kvm-smp-flat.qcow2" target="hda" />

  </boot>

  <devices>
   <vcpu>2</vcpu>
   <memory>524288</memory>
   <interface />
   <graphics />
  </devices>
 </domain>
 <storage>
  <disk file="ESX4-RHEL5U4-x86_64-kvm-smp-flat.qcow2" use="system" format="raw"/>

 </storage>
</image>

# qemu-img info ESX4-RHEL5U4-x86_64-kvm-smp-flat.qcow2 
image: ESX4-RHEL5U4-x86_64-kvm-smp-flat.qcow2
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 2.2G
cluster_size: 65536
Comment 2 RHEL Product and Program Management 2010-08-10 03:38:41 EDT
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 RHEL Product and Program Management 2010-08-18 17:29:55 EDT
Thank you for your bug report. This issue was evaluated for inclusion
in the current release of Red Hat Enterprise Linux. Unfortunately, we
are unable to address this request in the current release. Because we
are in the final stage of Red Hat Enterprise Linux 6 development, only
significant, release-blocking issues involving serious regressions and
data corruption can be considered.

If you believe this issue meets the release blocking criteria as
defined and communicated to you by your Red Hat Support representative,
please ask your representative to file this issue as a blocker for the
current release. Otherwise, ask that it be evaluated for inclusion in
the next minor release of Red Hat Enterprise Linux.
Comment 4 Cole Robinson 2010-12-01 11:59:43 EST
Hmm, is this virt-convert specific? If you take the original file and just try to run it with /usr/libvirt/qemu-kvm, does it work? If you then convert the original file to qcow2 using qemu-img, and again run it manually with qemu-kvm, does that work?

Basically, is it the virt-convert step that breaks things, or maybe qemu-img, or maybe the binary doesn't work
Comment 5 weizhang 2010-12-02 04:50:04 EST
qemu-kvm command when start domain:
ps aux |grep kvm|grep ESX3.5-RHEL6-64b-20100909.1
qemu     28502  9.9  0.2 1305108 23604 ?       Sl   16:54   4:17 /usr/libexec/qemu-kvm -S -M rhel6.0.0 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name ESX3.5-RHEL6-64b-20100909.1 -uuid fba69155-ee15-f867-3e81-4402469bc71b -nodefconfig -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/ESX3.5-RHEL6-64b-20100909.1.monitor,server,nowait -mon chardev=monitor,mode=control -rtc base=utc -boot c -drive file=/var/lib/libvirt/images/ESX3.5-RHEL6-x64-20100807.0/ESX3.5-RHEL6-x64-20100807.0-flat.qcow2,if=none,id=drive-ide0-0-0,boot=on,format=raw,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -netdev tap,fd=28,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:ad:b8:63,bus=pci.0,addr=0x3 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -vnc 127.0.0.1:3 -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4

convert to qcow2 with qemu-img:
qemu-img convert -O qcow2 ESX3.5-RHEL6-x64-20100807.0-flat.vmdk ESX3.5-RHEL6-x64-20100807.0-flat.qcow2

the same problem as before. I think it is qemu-img problem
Comment 6 Daniel Berrange 2010-12-02 06:13:01 EST
> -drive
> file=/var/lib/libvirt/images/ESX3.5-RHEL6-x64-20100807.0/ESX3.5-RHEL6-x64-20100807.0-flat.qcow2,if=none,id=drive-ide0-0-0,boot=on,format=raw,cache=none

There is the problem - the disk is set to  format=raw, rather than format=qcow2. Which must in turn mean the XML config is wrong.
Comment 7 weizhang 2010-12-02 22:06:50 EST
(In reply to comment #6)
> > -drive
> > file=/var/lib/libvirt/images/ESX3.5-RHEL6-x64-20100807.0/ESX3.5-RHEL6-x64-20100807.0-flat.qcow2,if=none,id=drive-ide0-0-0,boot=on,format=raw,cache=none
> 
> There is the problem - the disk is set to  format=raw, rather than
> format=qcow2. Which must in turn mean the XML config is wrong.

ah, yes. The problem is that after I virt-convert vmx to qcow2, there is a file ESX3.5-RHEL6-x64-20100807.0.virt-image.xml created, with 
> <disk file="ESX4-RHEL5U4-x86_64-kvm-smp-flat.qcow2" use="system"
format="raw"/>

After I create the domain with virt-image, it shows <driver type='raw'>, so that is the problem. After change type from 'raw' to 'qcow2', it works well, so no problem on qemu-img, sorry for wrong conclusion before.

There is another problem that after I manually change the ESX3.5-RHEL6-x64-20100807.0.virt-image.xml from <disk format="raw"/> to <disk format="qcow2"/>, with virt-image to create domain, the driver type is also 'raw', but not 'qcow2'.
Comment 8 Cole Robinson 2010-12-07 20:23:36 EST
Thanks for the thorough report, fixed upstream now:

http://hg.fedorahosted.org/hg/python-virtinst/rev/4e218aaddb42
Comment 9 Cole Robinson 2011-01-14 17:10:41 EST
Fix built in python-virtinst-0.500.5-1.el6
Comment 14 Cole Robinson 2011-03-02 16:20:24 EST
Okay, I fixed virt-image to do the right thing, but virt-convert was still handling 'format' in a funky way. Fixed upstream:

http://hg.fedorahosted.org/hg/python-virtinst/rev/08bf078b2229
Comment 15 Cole Robinson 2011-03-10 11:38:11 EST
Fixed in python-virtinst-0.500.5-2.el6
Comment 17 Marko Myllynen 2011-03-11 04:08:17 EST
> Fixed in python-virtinst-0.500.5-2.el6

I can confirm this fixes guest creation with virt-image when using qcow2.

Thanks!
Comment 18 zhe peng 2011-03-23 04:00:03 EDT
Verified on python-virtinst-0.500.5-2.el6
# rpm -qa|grep python-virtinst
python-virtinst-0.500.5-2.el6.noarch

# virt-convert -i vmx -o virt-image -D qcow2 ESX3.5-RHEL6-x64-20100807.0.vmx
Generating output in 'virt-image' format to ESX3.5-RHEL6-64b-20100909.1/
Converting disk 'ESX3.5-RHEL6-x64-20100807.0-flat.vmdk' to type qcow2...
Done.
# ls ESX3.5-RHEL6-64b-20100909.1/
ESX3.5-RHEL6-64b-20100909.1.virt-image.xml
ESX3.5-RHEL6-x64-20100807.0-flat.qcow2
# virt-image -n test ESX3.5-RHEL6-64b-20100909.1.virt-image.xml 
# cat ESX3.5-RHEL6-64b-20100909.1.virt-image.xml 
...........
<storage>
  <disk file="ESX3.5-RHEL6-x64-20100807.0-flat.qcow2" use="system" format="qcow2"/>
 </storage>
...........
# virsh list --all
 Id Name                 State
----------------------------------
 40 test                 running
the guest worked well.
the bug is fixed.
Comment 19 Nan Zhang 2011-03-23 04:21:46 EDT
According to comment #18, move to VERIFIED.
Comment 20 zhe peng 2011-04-15 06:27:58 EDT
verified this bug with:
Linux localhost.localdomain 2.6.32-130.el6.x86_64 #1 SMP Tue Apr 5 19:58:31 EDT
2011 x86_64 x86_64 x86_64 GNU/Linux

python-virtinst-0.500.5-3.el6.noarch
libvirt-0.8.7-17.el6.x86_64

passed.
Comment 22 Michael Hideo 2011-05-11 21:11:23 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
virt-convert did not preserve the storage format in the generated xml configuration file causing some image files to fail to boot with the error "no bootable device". The xml configuration now correctly preserves the storage format allowing the image to boot successfully. (BZ#622684)
Comment 23 Michael Hideo 2011-05-16 17:42:56 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-virt-convert did not preserve the storage format in the generated xml configuration file causing some image files to fail to boot with the error "no bootable device". The xml configuration now correctly preserves the storage format allowing the image to boot successfully. (BZ#622684)+virt-convert did not preserve the storage format in the generated xml configuration file causing some image files to fail to boot with the error "no bootable device". The xml configuration now correctly preserves the storage format allowing the image to boot successfully.
Comment 24 errata-xmlrpc 2011-05-19 09:45:50 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0636.html

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