Changeset 190


Ignore:
Timestamp:
Aug 26, 2010, 10:45:59 PM (14 years ago)
Author:
rock
Message:

Milestone: drbl-virt deployment completion.
Next Milestone: drbl-virt VM management interface.

Location:
drbl-virt/sbin
Files:
3 edited

Legend:

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

    r189 r190  
    2525    echo "DRBL environment has muiltpule netwrok card(NIC)."
    2626fi   
    27      
     27   
     28# backup IP_HOST_TABLE
     29if [ -e /etc/drbl/IP_HOST_TABLE.drbl-virt_bak ]; then
     30    cp /etc/drbl/IP_HOST_TABLE /etc/drbl/IP_HOST_TABLE.$(date +%Y-%m-%d-%H-%M-%S).drbl-virt_bak
     31    cp -f /etc/drbl/IP_HOST_TABLE.drbl-virt_bak /etc/drbl/IP_HOST_TABLE
     32else
     33    cp /etc/drbl/IP_HOST_TABLE /etc/drbl/IP_HOST_TABLE.drbl-virt_bak
     34fi 
     35
    2836for eth in $eths
    2937do   
     
    4553    VM_last_IP=""
    4654    VM_prefix_name=""
     55
    4756    get_VM_IP_range_and_prefix_name
    4857    create_VM_IP_table
     
    5766    VM_hosts=$(cat /opt/drbl-virt/etc/IP_VM_$eth | awk '{print $2}')
    5867    VM_MACs=$(cat /opt/drbl-virt/etc/macadr-VM-$eth.txt)
    59 
    60     #echo -e "VM_IPs=$VM_IPs \n VM_IPs_nu=$VM_IPs_nu \n VM_hosts=$VM_hosts \n VM_MACs=$VM_MACs"
    61 
    62     # delete duplicating value(ip,hostname) in IP_HOST_TABLE
    63     #if [ -e /etc/drbl/IP_HOST_TABLE ]; then
    64     #$Work_Path/duplicate_del /etc/drbl/IP_HOST_TABLE
    65     #fi
    66     # add ip & hostname
    67     #$Work_Path/add_value /opt/drbl-virt/etc/IP_VM_$eth /etc/drbl/IP_HOST_TABLE $eth
    68    
    69     # == delete duplicating MAC ==
    7068   
    7169    # == Add Mac address to macadr-ethX.txt ==
     
    8078# == Cheange Xen Kernel ==   
    8179Xen_Kernel=$(cat $Work_Home/etc/Xen_Kernel)
    82 read -p "Xen_Kernel=$Xen_Kernel"
     80#read -p "Xen_Kernel=$Xen_Kernel"
    8381echo "/opt/drbl/sbin/drblsrv-offline -s $Xen_Kernel"
    8482/opt/drbl/sbin/drblsrv-offline -s $Xen_Kernel                                                                                                                       
  • drbl-virt/sbin/functions_drbl_virt

    r189 r190  
    327327
    328328function delete_duplicating_MAC(){
    329 # backup
    330329drbl_mac_file="/etc/drbl/macadr-$eth.txt"
    331 cp $drbl_mac_file $drbl_mac_file.$(date +%Y-%m-%d-%H-%M-%S).drbl-virt_bak
    332 
    333 read -p "debug $VM_MACs"
    334 # Delete duplating VM MAC
    335 for vm_mac in $(echo $VM_MACs)
    336 do
    337     vm_mac_lines=$(cat -n $drbl_mac_file | grep $vm_mac | awk '{print $1}' )
    338     read -p "DEBUG vm_mac_lines $vm_mac_lines"
    339     # no duplicated vlaue, doesn't do it
    340     if [ -n "$vm_mac_lines" ]; then
    341         vm_mac_count=$(echo $vm_mac_lines | wc -w)
    342         read -p "de vm_mac_count $vm_mac_count"
    343         for (( i=1 ; i<=${vm_mac_count} ; i++ ))
    344         do
    345             del_line=$(echo $vm_mac_lines | cut -d " " -f${i})
    346             sed -i "${del_line}d" $drbl_mac_file
    347         done
    348         bash
    349     fi
    350 done
     330# if macadr-ethX.txt.drbl-virt_bak already have, backup it
     331# else cp default backup
     332if [ -e $drbl_mac_file.drbl-virt_bak ]; then
     333    cp $drbl_mac_file $drbl_mac_file.$(date +%Y-%m-%d-%H-%M-%S).drbl-virt_bak
     334    cp -f $drbl_mac_file.drbl-virt_bak $drbl_mac_file
     335else
     336    cp $drbl_mac_file $drbl_mac_file.drbl-virt_bak
     337fi
     338
     339    # Delete duplating VM MAC
     340    for vm_mac in $(echo $VM_MACs)
     341    do
     342        vm_mac_lines=$(cat -n $drbl_mac_file | grep $vm_mac | awk '{print $1}' )
     343        # no duplicated vlaue, doesn't do it
     344        if [ -n "$vm_mac_lines" ]; then
     345            vm_mac_count=$(echo $vm_mac_lines | wc -w)
     346            for (( i=1 ; i<=${vm_mac_count} ; i++ ))
     347            do
     348                del_line=$(echo $vm_mac_lines | cut -d " " -f${i})
     349                sed -i "${del_line}d" $drbl_mac_file
     350            done
     351        fi
     352    done
    351353
    352354
  • drbl-virt/sbin/xen_install.sh

    r187 r190  
    5151            if [ $hypervisior == "Xen" ]; then
    5252                echo ""
    53                 echo "Install Xen Hypervisior"
     53                echo "[Install Xen Hypervisior]"
     54                echo ""
    5455                aptitude install xen-linux-system-2.6.26-2-xen-${Linux_bit} xen-tools bridge-utils python-xml ipcalc
    5556                cp $Work_Home/conf/debian-lenny_xend-config.sxp /etc/xen/xend-config.sxp
Note: See TracChangeset for help on using the changeset viewer.