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

Add: KVM support (check KVM kernel)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.