Bug 746602

Summary: pygrub cannot start F16 PV guests (GPT partition) under Xen 4.1.1
Product: Red Hat Enterprise Linux 5 Reporter: Paolo Bonzini <pbonzini>
Component: xenAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.8CC: herrold, john.haxby, leiwang, mrezanin, ngaywood, pasik, pbonzini, qguan, qwan, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: xen-3.0.3-135.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 745335 Environment:
Last Closed: 2012-02-21 05:56:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 745335    
Bug Blocks:    

Description Paolo Bonzini 2011-10-17 08:24:04 UTC
+++ This bug was initially created as a clone of Bug #745335 +++

Description of problem:

After installing F16 PV guest under Xen 4.1.1 the extracting of the kernel and initrd.img can't complete. The error throw is:

[2011-10-11 22:43:20 12890] DEBUG (XendBootloader:113) Launching bootloader as ['/usr/bin/pygrub', '--output=/var/run/xend/boot/xenbl.27453', '/var/lib/libvirt/images/nfs/F16.img'].
[2011-10-11 22:43:20 6427] ERROR (XendBootloader:214) Boot loader didn't return any data!
[2011-10-11 22:43:20 6427] ERROR (XendDomainInfo:488) VM start failed
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendDomainInfo.py", line 474, in start
    XendTask.log_progress(31, 60, self._initDomain)
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendTask.py", line 209, in log_progress
    retval = func(*args, **kwds)
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendDomainInfo.py", line 2838, in _initDomain
    self._configureBootloader()
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendDomainInfo.py", line 3285, in _configureBootloader
    bootloader_args, kernel, ramdisk, args)
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendBootloader.py", line 215, in bootloader
    raise VmError, msg
VmError: Boot loader didn't return any data!
[2011-10-11 22:43:20 6427] DEBUG (XendDomainInfo:3071) XendDomainInfo.destroy: domid=18
[2011-10-11 22:43:20 6427] DEBUG (XendDomainInfo:2406) No device model
[2011-10-11 22:43:20 6427] DEBUG (XendDomainInfo:2408) Releasing devices
[2011-10-11 22:43:20 6427] ERROR (SrvBase:88) Request start failed.
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/xen/web/SrvBase.py", line 85, in perform
    return op_method(op, req)
  File "/usr/lib64/python2.7/site-packages/xen/xend/server/SrvDomain.py", line 77, in op_start
    return self.xd.domain_start(self.dom.getName(), paused)
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendDomain.py", line 1072, in domain_start
    dominfo.start(is_managed = True)
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendDomainInfo.py", line 474, in start
    XendTask.log_progress(31, 60, self._initDomain)
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendTask.py", line 209, in log_progress
    retval = func(*args, **kwds)
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendDomainInfo.py", line 2838, in _initDomain
    self._configureBootloader()
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendDomainInfo.py", line 3285, in _configureBootloader
    bootloader_args, kernel, ramdisk, args)
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendBootloader.py", line 215, in bootloader
    raise VmError, msg
VmError: Boot loader didn't return any data!
error: Failed to start domain F16
error: POST operation failed: xend_post: error from xen daemon: (xend.err "Boot loader didn't return any data!")

A bit of debugging and I found out that the /boot partition on the image file is not right after the GPT partition:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  526MB   524MB   ext4         ext4  boot
 3      526MB   16.1GB  15.6GB                     lvm

There's a workaround in F16 final TC1 (and later) for older Xen versions, such as RHEL5 Xen dom0: You can use "nogpt" boot option for F16 anaconda installer to force creation of old MSDOS partition tables instead of GPT.  However for RHEL7 we probably should get it to install as much out-of-the-box as possible.

Comment 1 Paolo Bonzini 2011-10-17 08:43:42 UTC
*** Bug 746426 has been marked as a duplicate of this bug. ***

Comment 2 Paolo Bonzini 2011-10-18 07:21:57 UTC
Setting devel-ack repro because there are other problems in F16 installation.

Comment 3 Miroslav Rezanina 2011-10-18 08:40:24 UTC
Granting devel_ack, as F16 installion process is ok. However, additional patch for grub2 config file patching is needed to be able boot f16.

Comment 6 Pasi Karkkainen 2011-10-22 13:42:13 UTC
Related rhel5 Xen pygrub bug:

"pygrub fails to boot Fedora 16 PV guest using MSDOS partition table and GRUB2":
https://bugzilla.redhat.com/show_bug.cgi?id=748149

Comment 7 Miroslav Rezanina 2011-10-24 04:36:35 UTC
*** Bug 748149 has been marked as a duplicate of this bug. ***

Comment 9 Miroslav Rezanina 2011-10-26 14:07:02 UTC
Fix built into xen-3.0.3-135.el5

Comment 10 Miroslav Rezanina 2011-10-26 14:07:07 UTC
Fix built into xen-3.0.3-135.el5

Comment 11 Miroslav Rezanina 2011-10-26 14:07:13 UTC
Fix built into xen-3.0.3-135.el5

Comment 12 Miroslav Rezanina 2011-10-26 14:07:21 UTC
Fix built into xen-3.0.3-135.el5

Comment 14 Pasi Karkkainen 2011-10-26 14:18:23 UTC
Thanks!

It's good to test both of these usecases:

- F16 PV domU with GPT partition table and GRUB2 (the default for fresh F16 installs).
- F16 PV domU with MSDOS partition table and GRUB2 (F16 installed with "nogpt" boot option, or F16 domU upgraded from earlier Fedora versions, or manually partitioned disk).

"nogpt" boot option for anaconda works in F16 Final TC2 and later versions.
example: virt-install -d -n f16test64 -r 1024 --vcpus=2 -f /dev/VolGroup00/f16test64 --vnc -p -l "http://web.server.tld/fedora/mount-f16-final-tc2-x64/" -x "nogpt"

Comment 15 Qixiang Wan 2011-12-16 03:32:51 UTC
Verified with xen-3.0.3-135.el5.

[1] Installed a Fedora 16 x86_64 guest with gpt partition, after the installation finished, reboot the guest and use pygrub to boot up the guest, the new pygrub can boot up the PV guest successfully.
[2] Installed a Fedora 16 x86_64 guest with msdos partition (append "nogpt" boot option for anaconda installer), the new pygrub can boot up the guest successfully.

But user can't edit the kernel arguments in pygrub, Bug 766483 was created for that.

Comment 16 errata-xmlrpc 2012-02-21 05:56:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0160.html