wiki:Xen_Lustre

Version 42 (modified by rock, 16 years ago) (diff)

--

【Build Xen & Lustre enabled kernel】

  • Our OS: Dbian etch / ubuntu 8.04
  • Our Method: Xen 和 Lustre 都需 patch kernel 來達到彼此特有的功能。
    我們使用較簡單但較笨的方法來 Merge Xen 和 Lustre ,主要步驟可分為:
    (1)安裝 XEN image (2)產生 XEN 和 Lustre 相容的 Kernel (3)建立 Lustre 模組


1.Requirement packages

  • 1.1 Kernel Packages
    sudo aptitude install build-essential libncurses5-dev kernel-package
    
  • 1.2 XEN Packages
    $ sudo apt-get install iproute bridge-utils python-twisted gcc binutils make zlib1g-dev python-dev transfig \
    bzip2 screen ssh debootstrap libcurl3-dev libncurses5-dev x-dev libsdl1.2-dev bin86 bcc python-pam patch \
    latex-make qemu qemu-launcher qemuctl graphviz graphviz-dev lvm2 libvncserver-dev libjpeg62-dev libjpeg62 \
    gettext python-xml gawk tetex-extra tetex-base openssl libssl-dev mercurial libc6-dev-i386
    
    • libcurl3-dev 在新的版本以 libcurl4-openssl-dev 取代
  • 1.3 Lustre Packages
    $ sudo aptitude install bzip2 debhelper dpatch libsnmp-dev module-assistant quilt libxml2 python-xml
    


2.Download XEN & Lustre

  • 2.1 Download XEN
    $ cd /usr/src
    $ sudo wget http://bits.xensource.com/oss-xen/release/3.1.4/xen-3.1.4.tar.gz
    $ sudo tar zxvf xen-3.1.4.tar.gz
    
  • 2.2 Download Lustre
    • Lustre
      $ cd /usr/src
      $ tar zxvf lustre-1.6.5.1.tar.gz
      


3.Build Xen Image

$ cd /usr/src/xen-3.2.1
$ sudo make -j 4 world
$ sudo make install
$ sudo rm /boot/vmlinuz-2.6.18.8-xen /boot/System.map-2.6.18.8-xen ; sudo rm -fr /lib/modules/2.6.18.8-xen/


4.Build Xen & Lustre Kernel

  • 4.1 Use Lustre's Patch File to Patch Xen Kernel
    $ cd /usr/src/xen-3.1.4/linux-2.6.18.8-xen
    $ sudo ln -s /usr/src/lustre-1.6.5.1/lustre/kernel_patches/series/2.6.18-vanilla.series series
    $ sudo ln -s /usr/src/lustre-1.6.5.1/lustre/kernel_patches/patches/ .
    $ sudo quilt -av push
    $ sudo cp /boot/config-2.6.18.8-xen .config
    
    // Config  Kernel Option : 
    //(1)建議將未來需要的 driver build-in 
    //(2)在Local version - append to kernel release 加上 -xen 
    //(3)把相關網路屬性選上 (Nat, Bridge...)
    //(4)File System 的 quota support (Lustre 需要的功能),關掉 automount
    //(5)CONFIG_SCSI_PROC_FS 和 CONFIG_SD_IOSTATS 需選上
    $ sudo make menuconfig
    
  • 4.2 Install XEN & Lustre Patched Kernel
    $ sudo make ; sudo make modules ; sudo make install ; sudo make modules_install
    $ sudo mkinitramfs -o /boot/initrd.img-2.6.18.8-xen 2.6.18.8-xen
    $ sudo update-grub
    $ sudo reboot
    


5.Make Lustre Modules

$ cd /usr/src/lustre-1.6.5.1
$ ln -s  /usr/src/xen-3.1.4/linux-2.6.18.8-xen/ /usr/src/linux
$ sudo ./configure --with-linux=/usr/src/xen-3.1.4/linux-2.6.18.8-xen/
$ sudo make -j 4
$ sudo make install
$ sduo depmod -a
$ sudo reboot


6.Using DRBL to massively deploy(option)


7.Test Xen & Lustre

  • 7.1 Config Lustre module
    $ sudo vim /etc/modules
    ldiskfs
    lnet networks=tcp
    
    $ sudo sync ; sudo reboot
    
  • 7.2 Config Xend
    $ sudo vim /boot/grub/menu.lst
    netloop.nloopbacks=150
    
    $ sudo vim /etc/xen/xend-config.sxp
    $ sudo xend start
    $ sudo xm list
    
  • 7.3 Setup Lsutre
    • Meta Data & Management Server
      $ sudo mkfs.lustre --fsname=testfs --mdt --mgs /dev/sdb1
      $ sudo mount -t lustre /dev/sdb1 /home/mdt
      
    • Object Storage Machine
      $ sudo mkfs.lustre --fsname=testfs --ost --mgsnode=virt@tcp0 /dev/sda
      $ sudo mount -t lustre /dev/sda /home/ost
      $ sudo dmesg
      Lustre: flyfs-OST0000: received MDS connection from 140.X.X.X@tcp
      
    • Mount Lustre FS
      $ sudo mount -t lustre virt@tcp0:/testfs /home/testfs
      $ mount
      $ df -h
      
    • Auto mount Lustre FS
      $ mount -l -t lustre
      /dev/sdb1 on /home/mdt type lustre (rw) [flyfs-MDT0000]
      /dev/sdb2 on /home/ost type lustre (rw) [flyfs-OST0000]
      
      $ vim /etc/fstab 
      LABEL=flyfs-MDT0000 /home/mdt   lustre  defaults,_netdev,noauto 0 0
      LABEL=flyfs-OST0000 /home/ost   lustre  defaults,_netdev,noauto 0 0
      


8.Install xen-tools

  • xen-tools
    $ sudo aptitude install libconfig-inifiles-perl libtext-template-perl
    $ wget http://www.xen-tools.org/software/xen-tools/xen-tools-4.1.tar.gz
    $ tar zxvf xen-tools-4.1.tar.gz
    $ cd xen-tools-4.1
    $ sudo make install
    
    // Config xen-tools : (1)印象檔存放於 Lustre FS /home/testfs (2)網路設定 //
    $ sudo vim /etc/xen-tools/xen-tools.conf
    


Problem

  • Lustre 1.6.6 無法相容與 XEN ,再 make lustre modules 會有錯誤產生,建議改用 Lustre 1.6.5.1


Reference

Attachments (3)