Bug 624714 - Virt-install to a qcow2 disk gets error at end of kickstart
Virt-install to a qcow2 disk gets error at end of kickstart
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst (Show other bugs)
6.0
All Linux
low Severity low
: rc
: ---
Assigned To: Cole Robinson
Virtualization Bugs
: RHELNAK
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-17 10:42 EDT by David Knierim
Modified: 2011-05-19 09:45 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previous versions of virt-install checked the first bytes of the disk image's master boot to ensure the disk image was valid. However, this check only worked with raw disk. This update skips the check on non-raw disks.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-19 09:45:53 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)
XML file for domain in question (1.41 KB, text/xml)
2010-08-17 13:21 EDT, David Knierim
no flags Details
List of package versions for for host (248 bytes, application/octet-stream)
2010-08-17 13:24 EDT, David Knierim
no flags Details

  None (edit)
Description David Knierim 2010-08-17 10:42:42 EDT
Description of problem:
Installing RHEL 5.5 to a KVM guest using virt-install.   If the target disk for the guest is a qcow2 disk, an error is generated when rebooting after successfully completing the kickstart:
rebooting system
md: stopping all md devices.
Restarting system.
.
machine restart

Domain installation does not appear to have been
 successful.  If it was, you can restart your domain
 by running 'virsh start dave-b'; otherwise, please
 restart your installation.

The same install on the same host but with a raw disk or LVM LV for the disk does NOT fail.

Here is a sample of the virt-install that I executed:
# virt-install --accelerate --hvm --connect qemu:///system --network=bridge:installation --cdrom=/images/rhel-server-5.5-i386-dvd.iso --name dave-b --ram=4096 --vcpus=4 --mac=54:52:00:00:03:02 --os-type=linux --os-variant=rhel5 --nographics --disk /var/lib/libvirt/images/dave-b.qcow2,size=20,format=qcow2

Version-Release number of selected component (if applicable):
RHEL 6 beta2 refresh

How reproducible:
100% reproducible.

Steps to Reproduce:
1.  Use virt-install to kickstart install RHEL 5.5 to a guest using a qcow2 disk
2.  After kickstart completes, witness error message when guest reboots.
3.
  
Actual results:
Error shown above occurs.   Guest ends in a "shut off" state.
After manually starting guest, the guest boots and runs normally with no issues.

Expected results:
Guest should reboot with no errors.

Additional info:
Comment 2 Daniel Veillard 2010-08-17 10:57:07 EDT
Can you provide the XML which was generated for the guest ?
virsh dumpxml dave-b

 thanks,

Daniel
Comment 3 Daniel Veillard 2010-08-17 10:58:06 EDT
as well as installed versions for libvirt and python-virtinst, please

Daniel
Comment 4 RHEL Product and Program Management 2010-08-17 10:58:24 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 5 David Knierim 2010-08-17 13:21:48 EDT
Created attachment 439171 [details]
XML file for domain in question
Comment 6 David Knierim 2010-08-17 13:24:04 EDT
Created attachment 439172 [details]
List of package versions for for host
Comment 7 Daniel Berrange 2010-08-17 13:29:51 EDT
Actually the XML was a red-herring. The problem is easy

> Error shown above occurs.   Guest ends in a "shut off" state.
> After manually starting guest, the guest boots and runs normally with no
> issues.

This shows that installation was successfull. 

> Domain installation does not appear to have been
>  successful.  If it was, you can restart your domain
>  by running 'virsh start dave-b'; otherwise, please
>  restart your installation.

This message is the result of a hueristic that virt-install does. It checks the first bytes of the disk image to see if they are 0xaa55  which is what the DOS MBR has as a signature. This is great with a raw disk. Not so great with a qcow2 disk, because virt-install will read the qcow2 magic instead of the actual guest data !

Virt-install's post_install_check() needs to skip this check on non-raw disks.
Comment 8 RHEL Product and Program Management 2010-08-18 17:29:30 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 9 Cole Robinson 2010-08-23 16:39:43 EDT
Should be fixed now upstream:

http://hg.fedorahosted.org/hg/python-virtinst/rev/312e23391971
Comment 10 Cole Robinson 2011-01-14 17:10:48 EST
Fix built in python-virtinst-0.500.5-1.el6
Comment 12 koka xiong 2011-01-21 02:35:38 EST
Verified with python-virtinst-0.500.5-1.el6 and libvirt-0.8.7-1.el6.x86_64
1.Run virt-install --accelerate --hvm --connect qemu:///system
 --cdrom=/dev/cdrom --name dave --ram=4096 --vcpus=1 -os-type=linux
--os-variant=rhel5  --disk
/var/lib/libvirt/images/dave-b.qcow2,size=20,format=qcow2
2.After the completion of the installation of the guest,the guest can be started up.
So when the guest image is qcow2 format,the installation is correct.

Verification is passed.
Comment 13 zhe peng 2011-04-19 02:06:57 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 15 Michael Hideo 2011-05-15 22:44:38 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:
* Previous versions of virt-install checked the first bytes of the disk image's master boot to ensure the disk image was valid. However, this check only worked with raw disk. This update skips the check on non-raw disks. (BZ#624714)
Comment 16 Michael Hideo 2011-05-16 17:42:38 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 @@
-* Previous versions of virt-install checked the first bytes of the disk image's master boot to ensure the disk image was valid. However, this check only worked with raw disk. This update skips the check on non-raw disks. (BZ#624714)+Previous versions of virt-install checked the first bytes of the disk image's master boot to ensure the disk image was valid. However, this check only worked with raw disk. This update skips the check on non-raw disks.
Comment 17 errata-xmlrpc 2011-05-19 09:45:53 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.