zoukankan      html  css  js  c++  java
  • Xen PV Bootloader为什么选择PyGrub

    Xen PV Bootloader为什么选择bootloader = '/usr/bin/pygrub' 

    Why?

     

    PyGrub enables you to start Linux DomUs with the kernels that lie in the filesystem of the DomU instead of with a Kernel that lies in the filesystem of the Dom0. This enables easier kernel update from DomU or migration of HVM'ed Linuxes.  

     

    Concept

     

    It is used as a Bootloader and provided with Xen. PyGrub behaves like Grub and reads the standard Grub menu.lst to provide the xen create process with the required parameters and SXP stanzas.   

    • Question is: Does it copy the req'd kernel and initd temporarily out to Dom0 for it to access it there or does Dom0 access the kernel and initd in their filesystem? Anyone?  

    Therefore usage is quite easy.   

    How?

     
    1. Install Grub
    2. Install a linux-image-xen of your choice.
    3. Create the /boot/grub directory if it is not present.
    4. Let it create its default menu.lst (update-grub in Debian)
    5. Change your domU.cfg in the Dom0 like this:

    - remove kernel and initd stanza - add bootloader stanza, e.g.

    • bootloader = '/usr/bin/pygrub' 
      
      You need to see where in the filesystem pygrub lies, debian does not use this path but /usr/lib/xen-$version/bin/pygrub or something like this.

    Important Tip / Caveat

     

    On your disk line, e.g.

    disk = ['file:/vserver/mail/guest_base2G.img,hda1,w','file:/vserver/mail/guest_swap256M.img,hda2,w','phy:data/mail,hda3,w']
    
     

    make sure that the partition/lvm/container that contains the kernel and initrd comes first. Xend passes the *first* entry to pyGrub. (At least for Version 3.2.1) If the first disk entry does not contain a kernel you will most likely get

     

    设置menu.lst

     
     
    Error: Boot loader didn't return any data 
    

    If you get this error have a look at /var/log/xen/xend.log . You can read here which parameters were given to pyGrub, try them by Hand and see if pyGrub outputs the right stanzas for domU startup. (They look a little like grub entries LISPified, SXP-Format).

    Thanks to (The following is taken from http://lists.xensource.com/archives/html/xen-users/2007-09/msg00524.html and own experience) for first pyGrub Reference.

  • 相关阅读:
    python 学习笔记7(类/对象的属性;特性,__getattr__)
    linux 误删文件恢复
    python 学习笔记6(数据库 sqlite)
    hive 函数 Cube
    边标志法填充多边形
    tolua#代码简要分析
    CocoaAsyncSocket + Protobuf 处理粘包和拆包问题
    【设计模式】适配器模式
    【设计模式】外观模式
    【操作系统】进程管理(二)
  • 原文地址:https://www.cnblogs.com/feisky/p/2264321.html
Copyright © 2011-2022 走看看