Changeset 215 for drbl-virt


Ignore:
Timestamp:
Oct 19, 2010, 11:14:46 AM (14 years ago)
Author:
rock
Message:

Add: KVM support (check KVM kernel)

Location:
drbl-virt/sbin
Files:
5 edited

Legend:

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

    r214 r215  
    1616# = 1. Patch DRBL xen env for client =
    1717# == Shutdown all drbl client ==
    18 echo ""
    19 echo "Please check all client are shutdown !!!"
    20 echo "you can use /opt/drbl/sbin/dcs to shutdown."
     18echo -e "\nPlease shutdown all drbl client !!!"
     19echo "You can use /opt/drbl/sbin/dcs to shutdown."
    2120read -p "Push [Enter] to continue......"
    2221
     
    7170    fi
    7271# for CentOS & Fedora
    73 elif [ -e /etc/sysconfig/modules ]
     72elif [ -e /etc/sysconfig/modules ]; then
    7473    grep -r "modprobe kvm" /etc/sysconfig/modules/
    7574    if [ $? -eq 1 ]; then
     
    8483fi
    8584EOF
    86 
    8785    chmod +x /etc/sysconfig/modules/kvm.modules
    8886    fi
  • drbl-virt/sbin/drbl_virt.sh

    r213 r215  
    3030    $Work_Path/kvm_install.sh
    3131    # patch drbl to suuport KVM environment
    32     $Work_Path/drbl_xen_patch.sh
     32    $Work_Path/drbl_kvm_patch.sh
    3333    # drbl re-push KVM environment
    3434fi
  • drbl-virt/sbin/drbl_xen_patch.sh

    r213 r215  
    1717# = 1. Patch DRBL xen env for client =
    1818# == Shutdown all drbl client ==
    19 echo ""
    20 echo "Please check all client are shutdown !!!"
    21 echo "you can use /opt/drbl/sbin/dcs to shutdown."
     19echo -e "\nPlease shutdown all drbl client !!!"
     20echo "You can use /opt/drbl/sbin/dcs to shutdown."
    2221read -p "Push [Enter] to continue......"
    2322
  • drbl-virt/sbin/functions_drbl_virt

    r213 r215  
    22# Program:
    33#   DRBL virt module
    4 # Author: 
     4# Author:
    55#   Jazz, Rock {jazz, rock}@nchc.org.tw
    66# Version:
     
    1818
    1919# [Check Root]
    20 function check_root(){     
     20function check_root(){
    2121  if [ $USER != "root" ]; then
    2222    echo -e "Please change root to run it!"
    2323    exit
    2424  fi
    25 } 
     25}
    2626
    2727# [Change root to run]
     
    7171    VMM_select=1
    7272    echo "Xen" > $Work_Home/etc/hypervisior
    73 fi 
    74 }   
     73fi
     74}
    7575
    7676
    7777# [Check Hypervisior]
    7878function check_hypervisior(){
    79     hypervisior=$(cat $Work_Home/etc/hypervisior)   
     79    hypervisior=$(cat $Work_Home/etc/hypervisior)
    8080}
    8181
     
    116116        for Kernel in $Kernels
    117117        do
    118             echo "($i) $Kernel" 
     118            echo "($i) $Kernel"
    119119            i=i+1
    120120        done
     
    207207    echo "Input VM number/IP range for $eth (ex. 40)."
    208208    echo "default is the same numbers of drbl clients"
    209    
     209
    210210
    211211    jude_2="no"
     
    233233
    234234# [Get VM prefix name]
    235 #function get_VM_prefix_name(){ 
     235#function get_VM_prefix_name(){
    236236#jude="no"
    237237#while [ $jude != "yes" -a $jude != "y" ];
     
    357357function delete_duplicating_MAC(){
    358358drbl_mac_file="/etc/drbl/macadr-$eth.txt"
    359 # if macadr-ethX.txt.drbl-virt_bak already have, backup it 
     359# if macadr-ethX.txt.drbl-virt_bak already have, backup it
    360360# else cp default backup
    361361if [ -e $drbl_mac_file.drbl-virt_bak ]; then
    362362    cp $drbl_mac_file $drbl_mac_file.$(date +%Y-%m-%d-%H-%M-%S).drbl-virt_bak
    363363    cp -f $drbl_mac_file.drbl-virt_bak $drbl_mac_file
    364 else 
     364else
    365365    cp $drbl_mac_file $drbl_mac_file.drbl-virt_bak
    366366fi
     
    380380        fi
    381381    done
    382 } 
     382}
    383383
    384384
     
    424424
    425425
    426 # [Download tomcat and mv drbl-virt.wat to wepapps]                           
     426# [Download tomcat and mv drbl-virt.wat to wepapps]
    427427function install_tomcat_and_mv_drbl-virt(){
    428428if [ ! -e $Work_Home/tomcat-7.0.2.tar.gz ]; then
    429429wget http://drbl-virt.googlecode.com/files/tomcat-7.0.2.tar.gz -P $Work_Home
    430 fi                         
     430fi
    431431tar zxvf $Work_Home/tomcat-7.0.2.tar.gz -C $Work_Home/
    432432mv $Work_Home/drbl-virt.war $Work_Home/tomcat-7.0.2/webapps/
     
    440440# [Cehck KVM kernel & version]
    441441function check_kvm(){
     442echo -e "\nCheck this kernel..."
    442443KVM_Kernel=$(uname -r)
    443 }
    444 
    445 
     444
     445grep -E '(CONFIG_KVM=m|CONFIG_KVM=y)' /boot/config-${KVM_Kernel} >> /dev/null
     446if [ $? -eq 0 ]; then
     447    echo "This Kernel supportes KVM !!!"
     448else
     449    echo "This Kernel doesn't support KVM !!!"
     450    echo "Please change Kernel."
     451    exit
     452fi
     453}
     454
  • drbl-virt/sbin/kvm_install.sh

    r213 r215  
    1212source $Work_Path/functions_drbl_virt
    1313
    14 # [ Intall ]
     14#  [ Main ]
     15check_systemInfo
     16
     17# = 1. Intall KVM =
    1518case $Linux_Distribution in
    1619    # for Ubuntu
Note: See TracChangeset for help on using the changeset viewer.