[[PageOutline]] = 【0.前言】 = * 已建置好 '''DRBL-Xen 環境''' ([http://trac.nchc.org.tw/grid/wiki/jazz/DRBL_Xen 可參考此篇]) * DRBL Client 需有'''兩張網卡''' (一張為DRBL環境,另一張為 domU 來bridge) * 本測試以 DRBL 來佈署實體的 DRBL Client,同時利用 DRBL 的網路開機機制,讓支援 網路開機的 '''HVM domU''' 和 '''PV domU''' 也能成為 '''DRBL Client'''。 * 優點 - DRBL 實體的 Client 有限,但虛擬的 Client 則可根據使用者需求增加或刪除 * 缺點 - 虛擬 Client 效能沒有實體 Client 強,此平台只適用於一般多用途 (不適用於特定用途) ---- = 【1.DRBL-Xen 環境配置】 = * 將 Server 的 Xen Image 複製到 DRBL Client 的路徑 {{{ $ sudo su $ cp /boot/*xen* /tftpboot/nbi_img $ mv /tftpboot/node_root/boot /tftpboot/node_root/boot.old && mkdir /tftpboot/node_root/boot $ cp /boot/* /tftpboot/node_root/boot/ }}} * DRBL Xen Client 的網路設定 {{{ $ vim /etc/xen/xend-config.sxp (network-script 'network-route netdev=eth1') (vif-script vif-route) $ sudo vim /etc/netwrok/interfaces allow-hotplug eth1 iface eth1 inet static address 192.168.100.X netmask 255.255.255.0 }}} ---- = 【2.HVM DRBL Client】 = [[Image(HVM DRBL Client_1.png,width=450)]] * 只需修改設定檔即可,可參考以下設定檔 {{{ #!sh import os, re arch = os.uname()[4] if re.search('64', arch): arch_libdir = 'lib64' else: arch_libdir = 'lib' # Base kernel='/usr/lib/xen/boot/hvmloader' builder='hvm' memory='512' name='hvm01' device_model='/usr/lib/xen/bin/qemu-dm' boot='n' vif=['type=ioemu,bridge=eth1,mac=00:00:aa:bb:44:ae'] # Graphical vnc=1 sdl=0 # Console vncconsole=1 # Other acpi = 1 apic = 1 serial='pty' # USB Mouse point usbdevice='tablet' # VNC vncviewer=1 vncpasswd="" vnclisten='0.0.0.0' }}} ---- = 【3.PV DRBL Client】 = * 有三種作法: 1. pygrub 2. [http://www.grid.ie/pypxeboot/ pypxeboot] 3. [http://wiki.xensource.com/xenwiki/PvGrub PvGrub] * 目前測試成功,但是有些地方需要人工操作,無法完全自動化 (持續測試中) ---- = 【問題】 = == 未解決 == == 已解決 == 1. Client 開機時,若有三個 eth,會依序使用 eth1 eth2 eth0 透過 udhcpc 來跟 DRBL Server 要 IP,是否有方法來指定 eth0 要即可? * Client開機時, udhcpc 會根據 XEN 的 netloop 的數量抓到多餘的 veth 和 vif 裝置,解決方法可在 kernel command 加上 netloop.nloopbacks=0 或將其編譯成 module * 回報給老大,老大已更新 linuxrc-or-init (/usr/lib/mkpxeinitrd-net/initrd-skel) 在新的 unstable DRBL 版本,預設只會使用 eth0 來抓 IP 2. Client 啟動 xend 時,無法 bridge eth0 (Xend 的服務正常,只是沒有 bridge 裝置) {{{ $ xend restart ifdown: interface eth0 not configured SIOCSIFNAME: Device or resource busy }}} * 推測: DRBL 的邏輯是 須先啟動網路裝置 (在 initrd 階段啟動) 來 mount NFS 作為 rootfs,[[BR]]但 Xend 啟動時,會先 ifdown eth0,在做一些 brctl 的相關動作後載啟動 eth0 * 作法一(x):增加 eth0 內容到 /etc/network/interface 也無法成功 bridge * 作法二(x):自行手動先 ifup eth0 起來,導致系統整個停住 (因網路皆停止、rootfs 無法 mount,終端機也無法控制) * 作法三(x):改用別名 {{{ $ xend restart Error: either "local" is duplicate, or "eth0" is a garbage. }}} * 作法四(?):修改 /etc/xen/script/network-bridge * 作法五(O):官方建議若是使用 NFS roots 可改用 netwrok-route,只是缺點無法抓到 DHCP IP * domU IP 必須設定為 static,DRBL Server 必須 iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE * 作法六(O):多插一張網卡 XD