Changeset 187
- Timestamp:
- Aug 26, 2010, 5:24:32 PM (14 years ago)
- Location:
- drbl-virt/sbin
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
drbl-virt/sbin/add_value
r185 r187 13 13 14 14 # delete 15 sed -i "/# drbl-virt $ ethadd/d" $216 sed -i "/# drbl-virt $ ethend/d" $215 sed -i "/# drbl-virt $3 add/d" $2 16 sed -i "/# drbl-virt $3 end/d" $2 17 17 18 18 # 19 echo "# Crawlzilla $ethadd" >> $219 echo "# drbl-virt $3 add" >> $2 20 20 cat $1 >> $2 21 echo "# Crawlzilla $ethend" >> $221 echo "# drbl-virt $3 end" >> $2 -
drbl-virt/sbin/drbl_virt.sh
r186 r187 18 18 VMM_select 19 19 20 # [Install VMM/Hypervisior] 1=Xen, 2=KVM20 # = 1.[Install VMM/Hypervisior] 1=Xen, 2=KVM = 21 21 if [ $VMM_select == 1 ]; then 22 bash "xen_install.sh start"22 $Work_Path/xen_install.sh start 23 23 else 24 bash "kvm_install.sh"24 $Work_Path/kvm_install.sh 25 25 fi 26 26 27 # [DRBL Environment Configuration] 27 # = 2. Patch DRBL = 28 $Work_Path/drbl_xen_patch.sh 29 30 # = 3. drbl_xen_repush.sh = 31 $Work_Path/drbl_xen_repush.sh 28 32 -
drbl-virt/sbin/drbl_xen_patch.sh
r185 r187 35 35 # == Modify PXE booting menu == 36 36 # if menu doesn't has drbl-virt, then add it 37 cat /opt/drbl/sbin/generate-pxe-menu | grep "label drbl-virt" 37 cat /opt/drbl/sbin/generate-pxe-menu | grep "label drbl-virt" >> /dev/null 38 38 if [ $? != 0 ]; then 39 39 # backup generate-pxe-menu … … 68 68 # == Patch /usr/bin/mkpxeinitrd-net (1)Xen network scripts (2)command (3)modules == 69 69 # backup mkpxeinitrd-net. if already has "drbl-virt add", dones't sed 70 cat /usr/bin/mkpxeinitrd-net | grep "# drbl-virt add" 70 cat /usr/bin/mkpxeinitrd-net | grep "# drbl-virt add" >> /dev/null 71 71 if [ $? != 0 ]; then 72 72 cp /usr/bin/mkpxeinitrd-net /usr/bin/mkpxeinitrd-net.drbl-virt_bak … … 113 113 fi 114 114 # == Run start_xen_bridge.sh when booting == 115 cat linuxrc-or-init | grep "bash /bin/start_xen_bridge.sh"116 if [ $? != 0 ]; then115 cat /usr/lib/mkpxeinitrd-net/initrd-skel/linuxrc-or-init | grep "bash /bin/start_xen_bridge.sh" >> /dev/null 116 if [ $? != 0 ]; then 117 117 # backup linuxrc-or-init 118 118 cp /usr/lib/mkpxeinitrd-net/initrd-skel/linuxrc-or-init /usr/lib/mkpxeinitrd-net/initrd-skel/linuxrc-or-init.drbl-virt_bak … … 140 140 mkdir /home/domains 141 141 fi 142 cp /boot/* {Xen_Kernel}* /home/domains142 cp /boot/*${Xen_Kernel}* /home/domains 143 143 -
drbl-virt/sbin/drbl_xen_repush.sh
r185 r187 57 57 VM_hosts=$(cat /opt/drbl-virt/etc/IP_VM_$eth | awk '{print $2}') 58 58 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 59 62 # delete duplicating value(ip,hostname) in IP_HOST_TABLE 60 63 if [ -e /etc/drbl/IP_HOST_TABLE ]; then … … 62 65 fi 63 66 # add ip & hostname 64 $Work_Path/add_value /opt/drbl-virt/etc/IP_VM_$eth /etc/drbl/IP_HOST_TABLE 67 $Work_Path/add_value /opt/drbl-virt/etc/IP_VM_$eth /etc/drbl/IP_HOST_TABLE $eth 65 68 66 69 # == Add Mac address to macadr-ethX.txt == … … 68 71 $Work_Path/duplicate_del_MAC /etc/drbl/macadr-$eth.txt 69 72 fi 70 73 cat /opt/drbl-virt/etc/macadr-VM-$eth.txt >> /etc/drbl/macadr-$eth.txt 71 74 done 72 75 -
drbl-virt/sbin/duplicate_del_MAC
r185 r187 1 1 #!/bin/bash 2 2 # Program: 3 # Delete duplicating ip & hostname3 # Delete duplicating VM MAC 4 4 # Author: 5 5 # Rock {waue, shunfa, rock}@nchc.org.tw … … 15 15 cp $1 $1.$(date +%Y-%m-%d-%H-%M-%S).drbl-virt_bak 16 16 17 # Delete duplating VM IP18 for vm_ ip in $(echo $VM_IPs)17 # Delete duplating VM MAC 18 for vm_mac in $(echo $VM_MACs) 19 19 do 20 vm_ ip_lines=$(cat -n $1 | grep $vm_ip| awk '{print $1}' )20 vm_mac_lines=$(cat -n $1 | grep $vm_mac | awk '{print $1}' ) 21 21 # no duplicated vlaue, doesn't do it 22 if [ -n $vm_ ip_lines ]; then23 vm_ ip_count=$(echo $vm_ip_lines | wc -w)22 if [ -n $vm_mac_lines ]; then 23 vm_mac_count=$(echo $vm_mac_lines | wc -w) 24 24 25 for (( i=1; i<=${VM_ ip_count}; i++ ))25 for (( i=1; i<=${VM_mac_count}; i++ )) 26 26 do 27 del_line=$(echo $vm_ ip_lines | cut -d " " -f${i})27 del_line=$(echo $vm_mac_lines | cut -d " " -f${i}) 28 28 sed -i "${del_line}d" $1 29 29 done … … 31 31 done 32 32 33 # Dlete duplicating hostname in file34 for vm_host in $(echo $VM_hosts)35 do36 # line numbers37 vm_host_lines=$(cat -n $1 | grep "$vm_host" | awk '{print $1}')38 # no duplicated vlaue, doesn't do it39 if [ -n $vm_host_lines ]; then40 vm_host_count=$(echo $vm_host_lines | wc -w)41 42 for (( i=1; i<=${vm_host_count}; i++ ))43 do44 del_line=$(echo $vm_host_lines | cut -d " " -f${i})45 sed -i "${del_line}d" $146 done47 fi48 done49 33 -
drbl-virt/sbin/functions_drbl_virt
r185 r187 80 80 aptitude update 81 81 check_debian_xen_pkg=$(aptitude search xen-linux-system) 82 if [ -n $check_debian_xen_pkg]; then82 if [ -n "$check_debian_xen_pkg" ]; then 83 83 check_debian_xen_pkg="yes" 84 84 else -
drbl-virt/sbin/xen_install.sh
r186 r187 27 27 check_debian_xen_pkg="" 28 28 check_debian_xen 29 echo $check_debian_xen_pkg29 #echo $check_debian_xen_pkg 30 30 31 31 if [ $check_debian_xen_pkg == "no" ]; then … … 47 47 hypervisior="" 48 48 check_hypervisior 49 echo $hyprtvisior49 #echo $hypervisior 50 50 51 51 if [ $hypervisior == "Xen" ]; then 52 52 echo "" 53 53 echo "Install Xen Hypervisior" 54 aptitude install xen-linux-system-2.6.26-2-xen-${Linux_bit} xen-tools bridge-utils python-xml 54 aptitude install xen-linux-system-2.6.26-2-xen-${Linux_bit} xen-tools bridge-utils python-xml ipcalc 55 55 cp $Work_Home/conf/debian-lenny_xend-config.sxp /etc/xen/xend-config.sxp 56 56 if [ $1 == "stop" ]; then … … 80 80 esac 81 81 82 # = 2. Patch DRBL =83 $Work_Path/drbl_xen_patch.sh84 85 # = 3. drbl_xen_repush.sh =86 $Work_Path/drbl_xen_repush.sh
Note: See TracChangeset
for help on using the changeset viewer.