wiki:GTD_Cloud_One_oper/xen_conf

Xen 於 OpenNEbual 的配置

1. 前提

  • 已安裝 Xen 和 Xen Kernel
  • /etc/init.d/xend 可以正常執行
  • oneadmin 使用者可以執行 Xen 相關的指令
    $ sudo vim /etc/sudoers
    %xen    ALL=(ALL) NOPASSWD: /usr/sbin/xm *
    %xen    ALL=(ALL) NOPASSWD: /usr/sbin/xentop *
    
    $ sudo /opt/drb/sbin/drbl-cp-host /etc/sudoers /etc/sudoers
    


2. Xen Driver 的檔案

  • 主要有以下4個:
    • $ONE_LOCATION/lib/mads/one_vmm_xen : Shell script wrapper to the driver itself. Sets the environment and other bootstrap tasks.
    • $ONE_LOCATION/lib/mads/one_vmm_xen.rb : The actual XEN driver.
    • $ONE_LOCATION/etc/vmm_xen/vmm_xenrc : environment setup and bootstrap instructions
    • $ONE_LOCATION/etc/vmm_xen/vmm_xen.conf : set here default values for XEN domain definitions.


3.Xen Driver 的配置

  • 告訴 ONE ,使用的 Hypervisior 是 Xen
    $ sudo vim $ONE_LOCATION/etc/oned.conf
        IM_MAD = [
            name       = "im_xen",
            executable = "one_im_ssh",
            arguments  = "im_xen/im_xen.conf",
            default    = "im_xen/im_xen.conf" ]
    	
        VM_MAD = [
            name       = "vmm_xen",
            executable = "one_vmm_xen",
            default    = "vmm_xen/vmm_xen.conf",
            type       = "xen" ]
    
    • 上面設定檔的 IM 是 Information Manager,VM 是 Virtualization Managers
      • name:driver 名稱,當加入 host 時會使用到
      • executable:driver 的執行檔 (位於 $ONE_LOCATION/lib/mads)
      • default:driver 的設定檔 (位於 $ONE_LOCATION/etc)
      • type:視為 xen 的 driver
  • default file ($ONE_LOCATION/etc/vmm_xen/vmm_xen.conf),所有 domU 預設都會使用這些 attribute,也可視為 Template
    • CPU=0.6
    • CERDIT
    • 附加的屬性: RAW = [ type="xen", data="on_crash=destroy" ]
    • 範例檔
      CPU      = 1
      MEMORY   = 128
      OS       = [kernel="/path-to-kernel",initrd= "/path-to-initrd",root="sda1" ]
      DISK     = [source="/path-to-image-file",target="sda",readonly="no"]
      NIC      = [mac="xx.xx.xx.xx.xx.xx", bridg="eth0"]
      GRAPHICS = [type="vnc",listen="127.0.0.1",port="5900"]
      
  • Run command file ($ONE_LOCATION/etc/vmm_xen/vmm_xenrc),包含了一些 Xen 指令路徑 (xm, xentop)
Last modified 16 years ago Last modified on Mar 17, 2009, 3:27:08 PM