Changeset 178 for drbl-virt


Ignore:
Timestamp:
Aug 13, 2010, 3:37:28 PM (14 years ago)
Author:
rock
Message:

Add: (1)client xend enabled (2)setup VM IP range

Location:
drbl-virt/sbin
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/drbl_kvm_patch.sh

    r171 r178  
    1010
    1111# [Source]
    12 source functions_drbl_virt
    1312source /opt/drbl-virt/conf/drbl-virt.conf
     13source $Work_Path/functions_drbl_virt
     14
    1415# [Main]
     16
    1517
    1618
  • drbl-virt/sbin/drbl_virt.sh

    r175 r178  
    2121# [Install VMM/Hypervisior] 1=Xen, 2=KVM
    2222if [ $VMM_select == 1 ]; then
    23     source xen_install.sh
     23    bash "xen_install.sh start"
    2424else
    25     source kvm_install.sh
     25    bash "kvm_install.sh"
    2626fi
    2727
  • drbl-virt/sbin/drbl_xen_patch.sh

    r177 r178  
    3939declare -i modify_line=$(cat -n $generate_PXE_menu | grep 'label drbl' | awk 'NR==1 {print $1}')
    4040# delete default
    41 sed -i '/^ MENU DEFAULT/d' $generate_PXE_menu
     41sed -i 's/^  MENU DEFAULT/  # MENU DEFAULT/d' $generate_PXE_menu
    4242# modify menu
    4343sed -i "${modify_line}i\label drbl-virt" $generate_PXE_menu
    4444modify_line=$modify_line+1
    4545sed -i "${modify_line}i\  MENU DEFAULT" $generate_PXE_menu
     46modify_line=$modify_line+1
     47sed -i "${modify_line}i\  # MENU HIDE" $generate_PXE_menu
    4648modify_line=$modify_line+1
    4749sed -i "${modify_line}i\  MENU LABEL DRBL-Virtualization ($Xen, $Xen_Kernel)" $generate_PXE_menu
     
    8789NIC=""
    8890
    89 if [ \$NICs_nu -lt 1  ];
     91if [ \$NICs_nu -lt 1  ]; then
    9092    for (( i=0 ; i<\$NICs_nu ; i++ ))
    9193    do
     
    111113sed -i "${modify_line}ibash /bin/start_xen_bridge.sh" $modify_file
    112114
     115# = 3. enable xend xendomains daemon in DRBL Client =
     116if [ -e /opt/drbl/conf/client-extra-service ]; then
     117    echo 'service_extra_added="xend xendomains"' >> /opt/drbl/conf/client-extra-service
     118else
     119    echo 'service_extra_added="xend xendomains"' > /opt/drbl/conf/client-extra-service
     120fi
    113121
    114 # = 3. Re-deploy drbl client =
     122# = 4. Re-deploy drbl client =
    115123# == Cheange Xen Kernel ==
    116124echo "/opt/drbl/sbin/drblsrv-offline -s $Xen_Kernel"
     
    123131echo ""
    124132
     133# = 5. enable xend xendomains daemon afterr drblpush =
     134# /opt/drbl/sbin/drbl-client-service xend on
     135
  • drbl-virt/sbin/functions_drbl_virt

    r172 r178  
    142142done
    143143
     144#echo "debug: Xen_Kernel=$Xen_Kernel"
     145}
    144146
    145 #echo "debug: Xen_Kernel=$Xen_Kernel"
     147
     148function get_Host_IP_range(){
     149cat /etc/drbl/IP_HOST_TABLE | sed "${Host_first_Line}p"
     150cat /etc/drbl/IP_HOST_TABLE | sed "${Host_final_Line}p"                   
     151declare -i Host_first_Line=$(cat -n /etc/drbl/IP_HOST_TABLE  | grep "# Created by DRBL (drblpush), begin" | awk '{print $1}')
     152Host_first_Line=$((${Host_first_Line}+1))
     153                       
     154declare -i Host_final_Line=$(cat -n /etc/drbl/IP_HOST_TABLE  | grep "# Created by DRBL (drblpush), end" | awk '{print $1}')
     155Host_final_Line=$((${Host_final_Line}-1))
     156#echo "$Host_first_Line"
     157#echo "$Host_final_Line"
     158                                                                           
     159Host_first_IP=$(cat /etc/drbl/IP_HOST_TABLE | sed -n "${Host_first_Line}p"| awk '{print $1}')
     160Host_final_IP=$(cat /etc/drbl/IP_HOST_TABLE | sed -n "${Host_final_Line}p"| awk '{print $1}')
     161#echo $Host_first_IP                                                                                                                                                 
     162#echo $Host_final_IP
     163}
     164
     165function get_VM_IP_range(){
     166echo ""       
     167echo "Your drbl client IP range $Host_first_IP ~ $Host_final_IP"
     168declare -i Host_final_IP_4=$(echo $Host_final_IP | cut -d "." -f4)
     169Host_final_IP_4=$(($Host_final_IP_4+1))                       
     170VM_first_IP=$(echo $Host_final_IP | cut -d "." -f 1-3)
     171VM_first_IP="${VM_first_IP}.${Host_final_IP_4}"       
     172echo "The VM IP Range will start from $VM_first_IP"   
     173while [ $jude != "yes" -a $jude != "y" ];             
     174do             
     175    read "Input your IP range for VM: " VM_IP_range   
     176done           
     177echo "VM_first_IP=$VM_first_IP" > $Work_Home/.tmp/IP_VM_TABLE
     178echo "VM_IP_range=$VM_IP_range" >> $Work_Home/.tmp/IP_VM_TABLE
     179
    146180}
    147181
  • drbl-virt/sbin/xen_install.sh

    r175 r178  
    5050            if [ $hypervisior == "Xen" ]; then
    5151                aptitude install xen-linux-system-2.6.26-2-xen-${Linux_bit} xen-tools bridge-utils
     52                if [ $1 == "stop" ]; then
     53                    update-rc.d xend remove
     54                    update-rc.d xendomains remove
     55                elif [ $1 == "start" ]; then
     56                    update-rc.d xend defaults
     57                    update-rc.d xendomains defaults
     58                fi
     59           
    5260            else
    5361                aptitude install kvm
    5462            fi
     63
    5564        fi 
    5665    ;;
Note: See TracChangeset for help on using the changeset viewer.