wiki:jazz/09-03-19

Version 11 (modified by jazz, 16 years ago) (diff)

--

2009-03-19

  • 10:30-11:30 主任至中群業務訪談

Xen VNC

  • 基本步驟請參考使用 DRBL 部署 Xen 虛擬叢集
  • [備忘] 從 xm console 跳離的快速鍵為 CTRL + ]
  • [狀況] 發現一個小小的問題,xen-tools 其實是採用 dom0 的 kernel 跟 initrd.img,所以 debootstrap 也是拷貝 dom0 的 /lib/modules/。加上如果我們要求 xen-tools 把 domU 的 image 檔案系統改為 reiserfs,而 dom0 自己是使用 ext3,會因為 dom0 initrd.img 沒有加入 reiserfs 的支援而致使 domU 開機時無法掛載 root filesystem。
  • 在 Lenny x86_64 上的安裝步驟
    lenny:~# echo "loop max_loop=255" >> /etc/modules
    lenny:~# apt-get install xen-hypervisor-3.2-1-amd64 linux-image-2.6.26-1-xen-amd64 xen-tools libc6-xen bridge-utils lsb-release
    lenny:~# update-grub
    lenny:~# reboot
    --------- Boot with "Xen 3.2-1-amd64 / Debian GNU/Linux, kernel 2.6.26-1-xen-amd64" ---------
    lenny:~# lsb_release -a
    No LSB modules are available.
    Distributor ID: Debian
    Description:    Debian GNU/Linux 5.0 (lenny)
    Release:        5.0
    Codename:       lenny
    lenny:~# uname -a
    Linux lenny 2.6.26-1-xen-amd64 #1 SMP Sat Jan 10 20:39:26 UTC 2009 x86_64 GNU/Linux
    --------- "Install DRBL, configure DRBL services and client settings" ---------
    lenny:~# wget http://drbl.nchc.org.tw/GPG-KEY-DRBL
    lenny:~# apt-key add GPG-KEY-DRBL
    lenny:~# echo "deb http://free.nchc.org.tw/drbl-core drbl stable" > /etc/apt/sources.list.d/drbl-sources.list
    lenny:~# apt-get update
    lenny:~# apt-get install drbl
    lenny:~# /opt/drbl/sbin/drblsrv -i
    
    (... skip ...)
    
    *****************************************************.
    Trying to upgrade some necessary packages if available...
    *****************************************************.
    In ayo repository, searching the latest  kernel ...
    The latest kernel in the ayo repository is linux-image-2.6.26-1-openvz-amd64
    There are 2 kernels available for clients, which one do you prefer ?
    [1]: kernel 2.6.26-1-xen-amd64 x86_64 (from this DRBL server)
    [2]: linux-image-2.6.26-1-openvz-amd64 (from apt repository)
    [1]
    
    (... skip ...)
    
    lenny:~# /opt/drbl/sbin/drblpush -i
    
    --------- "Configure Xend" --------- 
    lenny:~# vi /etc/xen/xend-config.sxp
    lenny:~# /etc/init.d/xend restart
    --------- "Create Xen Image" --------- 
    lenny:~# xen-create-image -dir /home/xen --dist lenny --kernel /boot/vmlinuz-2.6.26-1-xen-amd64 --initrd /boot/initrd.img-2.6.26-1-xen-amd64 --hostname lenny1 --dhcp --mirror http://free.nchc.org.tw/debian
    --------- "Enable Xen Image VNC ports" --------- 
    lenny:~# echo "vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncdisplay=1' ]" >> /etc/xen/lenny1.cfg
    lenny:~# xm create lenny1.cfg
    lenny:~# xm list
    Name                                        ID   Mem VCPUs      State   Time(s)
    Domain-0                                     0   357     1     r-----    106.4
    lenny1                                       3   128     1     -b----      8.7
    lenny:~# netstat -nap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 0.0.0.0:5901            0.0.0.0:*               LISTEN      2682/qemu-dm
    
    • xend-config.sxp

      old new  
      136136# two fake interfaces per guest domain.  To do things like this, write
      137137# yourself a wrapper script, and call network-bridge from it, as appropriate.
      138138#
      139 (network-script network-dummy)
       139#(network-script network-dummy)
      140140
      141141# The script used to control virtual interfaces.  This can be overridden on a
      142142# per-vif basis when creating a domain or a configuring a new vif.  The
       
      151151# If you are using only one bridge, the vif-bridge script will discover that,
      152152# so there is no need to specify it explicitly.
      153153#
      154 (vif-script vif-bridge)
       154#(vif-script vif-bridge)
      155155
      156156
      157157## Use the following if network traffic is routed, as an alternative to the
       
      162162
      163163## Use the following if network traffic is routed with NAT, as an alternative
      164164# to the settings for bridged networking given above.
      165 #(network-script network-nat)
      166 #(vif-script     vif-nat)
       165(network-script network-nat)
       166(vif-script     vif-nat)
      167167
      168168
      169169# Dom0 will balloon out when needed to free memory for domU.
       
      184184# The interface for VNC servers to listen on. Defaults
      185185# to 127.0.0.1  To restore old 'listen everywhere' behaviour
      186186# set this to 0.0.0.0
      187 #(vnc-listen '127.0.0.1')
       187(vnc-listen '0.0.0.0')
      188188
      189189# The default password for VNC console on HVM domain.
      190190# Empty string is no authentication.