wiki:GTD_Cloud_One_oper

OpenNEbula Operation

1. Requirement


2. System Configuration

  • 2.1 NIS Setup
    // Server
    $ sudo groupadd xen
    $ sudo useradd -m -G xen oneadmin
    $ cd /var/yp ; sudo make
    $ id oneadmin
    uid=1001(oneadmin) gid=1002(oneadmin) groups=1002(oneadmin),1001(xen)
    
    // Client, create local group "rootxen" include local root & shared GID 
    $ echo "rootxen:x:<xen_gid>:root >> /etc/group
    ($ echo "rootxen:x:1001:root >> /etc/group)
    
  • 2.2 SSH Setup
    // Server
    $ su oneadmin
    $ ssh-keygen
    
    // Client (cp id_rsa.pub from Server)
    $ echo /home/oneadmin/.ssh/id_rsa.pub >> authorized_keys
    
  • 2.3 Stroage
    • Storage Guide 1.2
    • We used Lustre to be image stroage, set VM_DIR={Lustre_Path}
      $ vim $ONE_LOCATIOB/etc/oned.conf
      25 VM_DIR=/home/xenfs
      
  • 2.4 Network
  • 2.5 Virtualizer


3. ONE startup

  • ONE Start
    (Two processes: (1)oned (2)mm_sched. Three drivers:(1)IM (2)VM (3)TM)
    $ one start
    oned and scheduler started 
    
    $ ps -aux | grep one
    root     32507  0.0  0.0 238100  4564 pts/5    Sl   16:51   0:00 /home/one/bin/oned -f
    root     32522  0.0  0.0 106816  4192 pts/5    Sl   16:51   0:00 /home/one/bin/mm_sched -p 2633
    root     32526  0.0  0.0  35500  4592 pts/5    SNl  16:51   0:00 ruby /home/one/lib/mads/one_im_ssh.rb im_xen/im_xen.conf
    root     32540  0.0  0.0  28116  3552 pts/5    SNl  16:51   0:00 ruby /home/one/lib/mads/one_vmm_xen.rb
    root     32551  0.0  0.0  28120  3636 pts/5    SNl  16:51   0:00 ruby /home/one/lib/mads/one_tm.rb tm_ssh/tm_ssh.conf
    
  • Log File:
    • Processes: $ONE_LOCATION/var/oned.log & $ONE_LOCATION/var/sched.log
    • Drivers: $ONE_LOCATION/var/name-of-the-driver-executable.log


4. Host Add & VM submit

  • 4.1 Add Host
    $ onehost create xen101 im_xen vmm_xen tm_ssh
    $ onehost list
     HID NAME                      RVM   TCPU   FCPU   ACPU    TMEM    FMEM STAT
       0 xen101                      0    400    400    400 6216704  130048   on
    
  • 4.2 Submit VM
    • Create Image (Using xen-tools)
      $ sudo vim /etc/xen-tools
      $ sudo xen-create-image --hostname test1 --ip 140.X.X.X 
      
    • Configuration
      $ vim /home/images/domains/test1/test1.cfg
      MEMORY=128
      CPU=4
      OS=[
           kernel="/boot/vmlinuz-2.6.18.8",
           initrd="/boot/initrd.img-2.6.18.8",
           root="sda1",
           boot="hd"]
      DISK=[
           source="/home/images/domains/vm01/disk.img",
           target="sda1",
           readonly=no]
      NIC=[mac="00:16:3e:01:01:03"]
      
      
    • Submit VM
      $ sudo onevm submit test1.cfg
      $ sudo onevm list
        ID     NAME STAT CPU     MEM        HOSTNAME        TIME
         0    one-0 runn   0  131072             one 00 00:05:24
      
      $ sudo xm list
      Name                                        ID   Mem VCPUs      State   Time(s)
      Domain-0                                     0  5840     4     r-----    307.8
      one-0                                        2   128     1     -b----      1.6
      
      $ sudo xm console one-0
      
    • VM Log File ($ONE_LOCATION/var/<VID>)


5. 指令介紹

  • OpenNEbula 提供類似XEN指令的方式來管理虛擬機器,OpenNEbula也可以支援Amazon EC2和KVM(Kenrel-based Virtual Machine)的虛擬機器,不過在此處是以OpenNEbula來管理Cluster環境上得XEN虛擬機器。OpenNEbula主要有三個指令:
    • onehost: 用來增加、刪除和監控實體機器 (也就是可以監控所有位於Cluster上的Dom0)
    • onevm: 用來submit、控制和監控位於實體機器上的虛擬機器 (也就是可以監控所有位於Cluster上Dom0的虛擬機器)
    • pnevnet: to add, delete and monitor hosts (尚未使用過)


6. Programming with OpenNEbula

  • OpenNEbula 提供一些API讓Client可以透過自行撰寫的程式碼來管理虛擬機器,它採用XML-RPC機制來完成動作。


7. Reference

Last modified 16 years ago Last modified on Mar 17, 2009, 5:01:34 PM