Changeset 185 for drbl-virt/sbin


Ignore:
Timestamp:
Aug 26, 2010, 3:19:26 PM (14 years ago)
Author:
rock
Message:

Modify: the same

Location:
drbl-virt/sbin
Files:
2 added
1 deleted
4 edited

Legend:

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

    r178 r185  
    1313source $Work_Path/functions_drbl_virt
    1414# [Main]
    15 install_drbl-virt_dir
    1615cpu_check
    1716check_systemInfo
  • drbl-virt/sbin/drbl_xen_patch.sh

    r184 r185  
    3535# == Modify PXE booting menu ==
    3636# if menu doesn't has drbl-virt, then add it
    37 cat /opt/drbl/sbin/generate-pxe-menu | grep drbl-virt
     37cat /opt/drbl/sbin/generate-pxe-menu | grep "label drbl-virt"
    3838if [  $? != 0 ]; then
    3939# backup generate-pxe-menu
     
    6868# == Patch /usr/bin/mkpxeinitrd-net (1)Xen network scripts (2)command (3)modules ==
    6969# backup mkpxeinitrd-net. if already has "drbl-virt add", dones't sed
    70 cat /usr/bin/mkpxeinitrd-net | grep "drbl-virt add"
     70cat /usr/bin/mkpxeinitrd-net | grep "# drbl-virt add"
    7171if [ $? != 0 ]; then
    7272cp /usr/bin/mkpxeinitrd-net /usr/bin/mkpxeinitrd-net.drbl-virt_bak
     
    133133fi
    134134
    135 # = 4. Re-deploy drbl client =
    136 # == Cheange Xen Kernel ==
    137 echo "/opt/drbl/sbin/drblsrv-offline -s $Xen_Kernel"
    138 /opt/drbl/sbin/drblsrv-offline -s $Xen_Kernel                                                                                                                       
    139 echo ""
    140 # == Re-delpoy drbl client ==
    141 echo "Re-delpoy drbl client"
    142 echo "/opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf"
    143 /opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf
    144 echo ""
    145 
    146 # = 5. enable xend xendomains daemon afterr drblpush =
     135# = 4. enable xend xendomains daemon afterr drblpush =
    147136# /opt/drbl/sbin/drbl-client-service xend on
    148137
     138# = 5. cp xen kernel & initrd to /home/domains =
     139if [ ! -e /home/domains ]; then
     140    mkdir /home/domains
     141fi
     142cp /boot/*{Xen_Kernel}* /home/domains
     143
  • drbl-virt/sbin/drbl_xen_repush.sh

    r184 r185  
    1515# [Main]
    1616
    17 # = 0. Variables setup =
     17# = 1. Variables setup =
    1818# == Get DRBL eth ==
    1919eths=""
     
    5252    generate_Xen_MAC_address
    5353     
    54     # == Add VM IP to dhcpd.conf  ==
     54    # == Add VM IP to /etc/drbl/IP_HOST_TABLE  ==
    5555    VM_IPs=$(cat /opt/drbl-virt/etc/IP_VM_$eth | awk '{print $1}')
     56    VM_IPs_nu=$(cat /opt/drbl-virt/etc/IP_VM_eth1 | awk '{print $1}' | wc -w)
    5657    VM_hosts=$(cat /opt/drbl-virt/etc/IP_VM_$eth | awk '{print $2}')
    5758    VM_MACs=$(cat /opt/drbl-virt/etc/macadr-VM-$eth.txt)
    58     add_VM_dhcpd_conf
    59      
    60     # == Add VM IP to exports  ==
    61     #add_VM_nfs_exportd
    62      
    63     # == Add VM IP to ypserv.securenets  ==
    64     #add_VM_ypserv_securenets
    65      
    66      
     59    # delete duplicating value(ip,hostname) in IP_HOST_TABLE
     60    if [ -e /etc/drbl/IP_HOST_TABLE ]; then
     61    $Work_Path/duplicate_del /etc/drbl/IP_HOST_TABLE
     62    fi
     63    # add ip & hostname
     64    $Work_Path/add_value /opt/drbl-virt/etc/IP_VM_$eth /etc/drbl/IP_HOST_TABLE
     65   
     66    # == Add Mac address to macadr-ethX.txt ==
     67    if [ -e /etc/drbl/macadr-$eth.txt ]; then
     68    $Work_Path/duplicate_del_MAC /etc/drbl/macadr-$eth.txt
     69    fi
     70
    6771done
    6872     
    69 # = 1. Copy VM fs =
    70 # Kernel & initrd -> /home/domains
    71      
    72      
    73 # = 2. Add NFS config =
    74    
    75 # = 3. Add DHCP config =
    76      
    77 # = 4. Add hosts and cp it to all drbl client =
    78      
    79 # = 5. generate guest config file =     
     73
     74# = 2. Re-deploy drbl client =
     75# == Cheange Xen Kernel ==   
     76echo "/opt/drbl/sbin/drblsrv-offline -s $Xen_Kernel"
     77/opt/drbl/sbin/drblsrv-offline -s $Xen_Kernel                                                                                                                       
     78echo ""
     79# == Re-delpoy drbl client ==
     80echo "Re-delpoy drbl client"           
     81echo "/opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf"
     82/opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf
     83echo ""
  • drbl-virt/sbin/functions_drbl_virt

    r184 r185  
    7070}   
    7171
    72 
    73 # [Create drbl-virt path]
    74 function install_drbl-virt_dir(){
    75     mkdir -p $Work_Home/.tmp
    76     mkdir -p $Work_Home/etc
    77 }
    78 
    79 
    8072# [Check Hypervisior]
    8173function check_hypervisior(){
     
    219211#echo "VM_IP_range=$VM_IP_range"
    220212}
     213
    221214
    222215#function get_VM_prefix_name(){
     
    317310}
    318311
    319 function add_VM_dhcpd_conf(){
    320 # backup dhcpd.conf
    321 if [ -e /etc/dhcp3/dhcpd.conf ]; then
    322 cp -f /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf.drbl-virt_bak
    323 fi
    324 
    325 subnet_lines=$(cat -n /etc/dhcp3/dhcpd.conf | grep $eth_network | awk '{print $1}')
    326 host_lines=$(cat -n /etc/dhcp3/dhcpd.conf | grep 'host ' | grep '{' | awk '{print $1}')
    327 
    328 for subnet_line in $subnet_lines
    329 do
    330     host_lines cat -n /etc/dhcp3/dhcpd.conf | sed -n "$subnet_line,\$p" | grep 'host .* {' | awk '{print $1}'
    331 
    332 done
    333 
    334 }
     312#function add_VM_dhcpd_conf(){
     313## backup dhcpd.conf
     314#if [ -e /etc/dhcp3/dhcpd.conf ]; then
     315#cp -f /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf.drbl-virt_bak
     316#fi
     317#subnet_lines=$(cat -n /etc/dhcp3/dhcpd.conf | grep $eth_network | awk '{print $1}')
     318#host_lines=$(cat -n /etc/dhcp3/dhcpd.conf | grep 'host ' | grep '{' | awk '{print $1}')
     319#
     320#for subnet_line in $subnet_lines
     321#do
     322#    host_lines cat -n /etc/dhcp3/dhcpd.conf | sed -n "$subnet_line,\$p" | grep 'host .* {' | awk '{print $1}'
     323#done
     324#}
Note: See TracChangeset for help on using the changeset viewer.