Bug 577511
Summary: | Grub2 guest support for RHEL5 Xen pygrub | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Pasi Karkkainen <pasik> | ||||||||
Component: | xen | Assignee: | Michal Novotny <minovotn> | ||||||||
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | ||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | low | ||||||||||
Version: | 5.5 | CC: | areis, div, llim, minovotn, mrezanin, tom, xen-maint, yuzhang | ||||||||
Target Milestone: | rc | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | All | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | xen-3.0.3-111.el5 | Doc Type: | Bug Fix | ||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2011-01-13 22:21:08 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: | |||||||||||
Bug Blocks: | 514499 | ||||||||||
Attachments: |
|
Description
Pasi Karkkainen
2010-03-27 17:53:21 UTC
(In reply to comment #0) > Description of problem: > pygrub in RHEL5 Xen only supports PV guests using grub1 config files. > Distributions like Ubuntu have been already using grub2 on multiple distro > releases, and Debian is changing to Grub2 for their next 6.0 "Squeeze" release. > Fedora is planning to switch to grub2 aswell. > > Upstream Xen 4.0.0 pygrub supports Grub2 config file formats. > Grub2 pygrub support should be backported to RHEL5 pygrub. > > Version-Release number of selected component (if applicable): > Xen pygrub in RHEL5.4 and 5.5 beta. > > How reproducible: > Always. > > Steps to Reproduce: > 1. Install RHEL5 Xen dom0 > 2. Install a PV guest using Grub2 > 3. Try to boot it using pygrub > > Actual results: > pygrub fails to parse guest grub2 config. > > Expected results: > pygrub is able parse guest grub2 cfgfile and boot the guest. > > Additional info: Pasi, where can I get PV guest installer for Ubuntu or any other distro using Grub2 by default? I did try to download it but it's HVM guest only. Michal Created attachment 403682 [details]
Grub2 support for pyGrub
This is the backport of xen-unstable c/s 20485, 20486, 20487, 20858, 21002 and 21033 but like stated in comment above, I don't know where to get any PV guest that would be using Grub2 configuration by default but I did try to test it using the HVM guest and comparing the kernel and ramdisk file size and contents transferred via SSH to those that were automatically extracted by pygrub utility. The sizes were the same and diff-ing those files shows that the files are the same so it should be working but I can't be sure until I have the option to test it using any PV guest that uses Grub2 bootloader.
Michal
Thanks! I'm busy right now, but I'll get back to you and provide an image that can be used for testing. (In reply to comment #4) > Thanks! > > I'm busy right now, but I'll get back to you and provide an image that can be > used for testing. Ok, great, it will be necessary for testing because I don't know where to get PV image using Grub2 bootloader. Michal Pasi, could you please provide me some information where to download those PV images or what location to install from? Thanks, Michal Try this: virt-install --name=grub2 --paravirt --location=http://ftp.us.debian.org/debian/dists/squeeze/main/installer-amd64/ --disk path=/dev/srv112/vm-grub2 --nographics --ram=512 Created attachment 407518 [details] Grub2 support for pyGrub with c/s 21188 (In reply to comment #7) > Try this: > > virt-install --name=grub2 --paravirt > --location=http://ftp.us.debian.org/debian/dists/squeeze/main/installer-amd64/ > --disk path=/dev/srv112/vm-grub2 --nographics --ram=512 Ok. I did install this version of Xen but also I added unstable c/s 21188 which is about Grub2 configuration matching for both grub2 version used in Ubuntu 10.04 and previous versions so this one is good to have as well. Before my patch applied, it was returning error that bootloader (grub2) didn't return any data but now it's not returning an error and it's booting the system. Current version of my patch, including c/s 21188 is attached now. Michal Sounds good! Michal: Sorry I've been really busy lately. Do you still need more images? To me it sounds ok, since you have the latest ubuntu 10.04 patch included already. (In reply to comment #9) > Sounds good! > > Michal: Sorry I've been really busy lately. Do you still need more images? To > me it sounds ok, since you have the latest ubuntu 10.04 patch included already. Pasi: Yeah, I have a subscription for upstream xen-devel list as well and when I saw that patch that is about grub2 support in pygrub too, I added it as well. I don't need more images any longer but feel free to apply this patch and try it yourself. Michal Ok, I finally found the time to test the pygrub grub2 patch. I started with EL 5.5 and applied the grub2 patch you provided. Then I downloaded http://fi.archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/xm-debian.cfg configuration file and edited it. I set the following options: memory = 1024 name = ubuntu01 vcpus = 1 vif = ['bridge=virbr0'] disk = ['phy:vg01/ubuntu01,xvda,w'] and also edited the "bootloader" line and corrected the filename by adding the path to it: /usr/bin/pygrub Then I started the installation like this: xm create -f xm-debian.cfg -c install=true install-kernel="http://fi.archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/vmlinuz" install-ramdisk="http://fi.archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/initrd.gz" install-mirror="http://fi.archive.ubuntu.com/ubuntu" The installation went smoothly, no problems appeared. After the installation I started the guest like this: xm create -f xm-debian.cfg -c And it seems to work OK, I can see the pygrub menu, I can choose the kernel and it boots fine! So the patch seems all fine to me! I assume it can be applied for RHEL 5.6 ? Thanks! (In reply to comment #11) > Ok, I finally found the time to test the pygrub grub2 patch. > I started with EL 5.5 and applied the grub2 patch you provided. > > Then I downloaded > http://fi.archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/xm-debian.cfg > configuration file and edited it. > > I set the following options: > memory = 1024 > name = ubuntu01 > vcpus = 1 > vif = ['bridge=virbr0'] > disk = ['phy:vg01/ubuntu01,xvda,w'] > > and also edited the "bootloader" line and corrected the filename by adding the > path to it: /usr/bin/pygrub > > Then I started the installation like this: > > xm create -f xm-debian.cfg -c install=true > install-kernel="http://fi.archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/vmlinuz" > install-ramdisk="http://fi.archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/initrd.gz" > install-mirror="http://fi.archive.ubuntu.com/ubuntu" > > The installation went smoothly, no problems appeared. > After the installation I started the guest like this: > > xm create -f xm-debian.cfg -c > > And it seems to work OK, I can see the pygrub menu, I can choose the kernel and > it boots fine! > > So the patch seems all fine to me! > > I assume it can be applied for RHEL 5.6 ? > > Thanks! Hi Pasi, yeah, I did some modifications to the patch since there were some issues to be fixed (not that much connected to grub2 boot loader but with manually entering the boot commands that was *not* using the proper bootloader configuration and it was treating everything as grub1 image etc. I had to fix it upstream first since upstream was having the same issues with that). It should be applied for RHEL 5.6, that's right. Michal (In reply to comment #11) > Ok, I finally found the time to test the pygrub grub2 patch. > I started with EL 5.5 and applied the grub2 patch you provided. > > Then I downloaded > http://fi.archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/xm-debian.cfg > configuration file and edited it. > > I set the following options: > memory = 1024 > name = ubuntu01 > vcpus = 1 > vif = ['bridge=virbr0'] > disk = ['phy:vg01/ubuntu01,xvda,w'] > > and also edited the "bootloader" line and corrected the filename by adding the > path to it: /usr/bin/pygrub > > Then I started the installation like this: > > xm create -f xm-debian.cfg -c install=true > install-kernel="http://fi.archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/vmlinuz" > install-ramdisk="http://fi.archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/initrd.gz" > install-mirror="http://fi.archive.ubuntu.com/ubuntu" > > The installation went smoothly, no problems appeared. > After the installation I started the guest like this: > > xm create -f xm-debian.cfg -c > > And it seems to work OK, I can see the pygrub menu, I can choose the kernel and > it boots fine! > > So the patch seems all fine to me! > > I assume it can be applied for RHEL 5.6 ? > > Thanks! Yeah, I did some modifications to the patch but the functionality of Grub2 should be unaffected. It was mainly fixing some things so I had to fix upstream first since it was not fixed there yet. It should be applied for RHEL 5.6. Michal Sorry, there was some bugzilla error so I didn't know the comment was already posted so sorry for 2 repeated comments. Michal Created attachment 416763 [details]
New version of my patch
Hi,
this is the patch to add Grub2 support to pyGrub to be able to install
and boot e.g. Debian and/or Ubuntu guests. Sooner or later even Fedora
will be using the Grub2 boot loader so this backport is really needed.
Also, fixes for isconfig support and entering boot loader commands
manually has been added to this patch (backported from my upstream patch
available for c/s 21461) to use the proper boot loader image instead
of old behaviour to use GrubImage in all cases (even Lilo case on ia64).
Upstream: xen-unstable c/s 20485, 20486, 20487, 20858, 21002, 21188 and 21461
Testing: I did testing on x86_64 dom0 both without and with this patch
applied. Testing was done for PV guests using both grub and grub2 and both
guests were working fine.
Michal
Hi Pasi, could you please try retesting with patch in comment #15 ? It should work the same and also you could try entering the command manually to grub and grub2 and it should be treated as the good image class instead of old behaviour of treating it as GrubImage always. Thanks, Michal Yep, I'll try the new patch and let you know how it goes. (In reply to comment #17) > Yep, I'll try the new patch and let you know how it goes. Ok, thanks Pasi. I just applied the latest version of the patch and it seems to work! I booted Ubuntu 10.04 guest (grub2) and fedora 13 guest (grub1) and both worked OK. I could also edit the kernel parameters on the pygrub prompt, if that's what you meant with the "entering the command manually".. ? Thanks! (In reply to comment #19) > I just applied the latest version of the patch and it seems to work! > > I booted Ubuntu 10.04 guest (grub2) and fedora 13 guest (grub1) and both worked > OK. I could also edit the kernel parameters on the pygrub prompt, if that's > what you meant with the "entering the command manually".. ? > > Thanks! Yeah Pasi, exactly. By "entering the boot commands manually" I meant to edit the kernel parameters inside of the grub bootloader. It was treated like grub1 always (i.e. it was not even treated like Lilo bootloader on ia64) so I did the patch to use proper bootloader (i.e. grub for grub1, grub2 for grub2 and lilo for lilo bootloader on ia64) - it's been already merged upstream. Michal QA verified this bug on xen-3.0.3-115.el5: Install latest ubuntu PV guest with the following command: #xm create -f xm-debian.cfg -c install=true install-kernel="http://mirrors.sohu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/vmlinuz" install-ramdisk="http://mirrors.sohu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/initrd.gz" install-mirror="http://mirrors.sohu.com/ubuntu" After OS Installation, we could boot the guest with successfully with pygrub. Also, just using pygrub command line to check the image, grub manual could be reflected well. Change this bug VERIFIED. 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-0031.html |