- Timestamp:
- Oct 18, 2010, 3:31:18 PM (14 years ago)
- Location:
- drbl-virt/sbin
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
drbl-virt/sbin/drbl_kvm_patch.sh
r178 r213 1 1 #!/bin/bash 2 2 # Program: 3 # Path DRBL evironment to support Xen/KVM4 # Author: 3 # Path DRBL evironment to support KVM 4 # Author: 5 5 # Jazz, Rock {jazz, rock}@nchc.org.tw 6 6 # Version: 7 7 # 1.0 8 # History: 9 # 2010/ 07/20 Rock First release (1.0)8 # History: 9 # 2010/10/18 Rock First release (1.0) 10 10 11 11 # [Source] … … 14 14 15 15 # [Main] 16 # = 1. Patch DRBL xen env for client = 17 # == 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." 21 read -p "Push [Enter] to continue......" 22 23 # == check KVM Kernel version 24 check_kvm 25 26 # == Modify PXE booting menu == 27 # if menu doesn't has drbl-virt, then add it 28 cat /opt/drbl/sbin/generate-pxe-menu | grep "label drbl-virt" >> /dev/null 29 if [ $? != 0 ]; then 30 # backup generate-pxe-menu 31 cp /tftpboot/nbi_img/pxelinux.cfg/default /tftpboot/nbi_img/pxelinux.cfg/default.drbl-virt_bak 32 cp /opt/drbl/sbin/generate-pxe-menu /opt/drbl/sbin/generate-pxe-menu.drbl-virt_bak 33 34 generate_PXE_menu="/opt/drbl/sbin/generate-pxe-menu" 35 declare -i modify_line=$(cat -n $generate_PXE_menu | grep 'label drbl' | awk 'NR==1 {print $1}') 36 # delete default 37 sed -i 's/^ MENU DEFAULT/ # MENU DEFAULT/g' $generate_PXE_menu 38 # modify menu 39 sed -i "${modify_line}i\label drbl-virt" $generate_PXE_menu 40 modify_line=$modify_line+1 41 sed -i "${modify_line}i\ MENU DEFAULT" $generate_PXE_menu 42 modify_line=$modify_line+1 43 sed -i "${modify_line}i\ # MENU HIDE" $generate_PXE_menu 44 modify_line=$modify_line+1 45 sed -i "${modify_line}i\ MENU LABEL DRBL-Virtualization ($KVM_Kernel)" $generate_PXE_menu 46 modify_line=$modify_line+1 47 sed -i "${modify_line}i\ kernel vmlinuz-pxe" $generate_PXE_menu 48 modify_line=$modify_line+1 49 sed -i "${modify_line}i\ append initrd=initrd-pxe.img devfs=nomount drblthincli=off selinux=0 nomodeset" 50 modify_line=$modify_line+1 51 sed -i "${modify_line}i\ TEXT HELP" $generate_PXE_menu 52 modify_line=$modify_line+1 53 sed -i "${modify_line}i\ ENDTEXT" $generate_PXE_menu 54 modify_line=$modify_line+1 55 sed -i "${modify_line}i\ " $generate_PXE_menu 56 fi 16 57 17 58 59 # = 2. Patch DRBL initrd to support bridge = 60 # == Patch /usr/bin/mkpxeinitrd-net (1)Xen network scripts (2)command (3)modules == 61 # backup mkpxeinitrd-net. if already has "drbl-virt add", dones't sed 62 source $Work_Path/drbl_bridge_patch.sh 18 63 19 # [DRBL Environment Configuration]20 64 65 # = 3. Load KVM module when booting = 66 if [ -e /etc/modules ]; then 67 grep kvm /etc/modules 68 if [ $? -eq 1 ]; then 69 echo "kvm" >> /etc/modules 70 fi 71 elif [ -e /etc/modules.conf ] 72 grep kvm /etc/modules.conf 73 if [ $? -eq 1 ]; then 74 echo "kvm" >> /etc/modules.conf 75 fi 76 fi 77 78 # = 4. Copy xen kernel & initrd to /home/domains = 79 if [ ! -e /home/domains ]; then 80 mkdir /home/domains 81 fi 82 cp /tftpboot/nbi_img/vmlinuz-pxe /home/domains 83 cp /tftpboot/nbi_img/initrd-pxe.img /home/domains 84 85 -
drbl-virt/sbin/drbl_virt.sh
r207 r213 20 20 # = 1.[Install VMM/Hypervisior] 1=Xen, 2=KVM = 21 21 if [ $VMM_select == 1 ]; then 22 # install Xen 22 23 $Work_Path/xen_install.sh start 24 # patch drbl to suuport Xen environment 25 $Work_Path/drbl_xen_patch.sh 26 # drbl re-push Xen environment 27 $Work_Path/drbl_xen_repush.sh 23 28 else 29 # install KVM 24 30 $Work_Path/kvm_install.sh 31 # patch drbl to suuport KVM environment 32 $Work_Path/drbl_xen_patch.sh 33 # drbl re-push KVM environment 25 34 fi 26 35 27 # = 2. Patch DRBL =28 $Work_Path/drbl_xen_patch.sh29 30 # = 3. drbl_xen_repush.sh =31 $Work_Path/drbl_xen_repush.sh32 36 33 # = 4. Create User(drbl-virter) and mv drbl-virt.wat to tomcat =37 # = 2. Create User(drbl-virter) and mv drbl-virt.wat to tomcat = 34 38 #creat_drbl-virter 35 39 #install_tomcat_and_mv_drbl-virt -
drbl-virt/sbin/drbl_xen_patch.sh
r210 r213 20 20 echo "Please check all client are shutdown !!!" 21 21 echo "you can use /opt/drbl/sbin/dcs to shutdown." 22 read -p "Push 'Enter'to continue......"22 read -p "Push [Enter] to continue......" 23 23 24 24 # == Change xen kernel for drbl client == -
drbl-virt/sbin/functions_drbl_virt
r208 r213 436 436 echo "[Go to http://{server_IP}:8080/drbl-virt/ to check !]" 437 437 } 438 439 440 # [Cehck KVM kernel & version] 441 function check_kvm(){ 442 KVM_Kernel=$(uname -r) 443 } 444 445 -
drbl-virt/sbin/kvm_install.sh
r175 r213 16 16 # for Ubuntu 17 17 "Ubuntu") 18 aptitude update ; aptitude install kvm 18 echo "please check kernel (KVM enabled)" 19 echo "Push [Enetr] to install KVM package..." 20 aptitude update ; aptitude install kvm bridge-utils 19 21 ;; 20 22 # for Debian 21 23 "Debian") 22 aptitude update ; aptitude install kvm 24 echo "please check kernel (KVM enabled)" 25 echo "Push [Enetr] to install KVM package..." 26 aptitude update ; aptitude install kvm bridge-utils 23 27 ;; 24 28 # for Fedora 25 29 "Fedora") 26 echo "Only support Debain & Debian" 30 echo "Only support Debain." 31 exit 27 32 ;; 28 33 *) 29 echo "Only support Debain & Debian" 34 echo "Only support Debain." 35 exit 30 36 ;; 31 37 esac -
drbl-virt/sbin/xen_install.sh
r202 r213 21 21 "Ubuntu") 22 22 echo "Only support Debain" 23 exit 23 24 ;; 24 25 # for Debian … … 80 81 "Fedora") 81 82 echo "Only support Debain" 83 exit 82 84 ;; 83 85 *) 84 86 echo "Only support Debain" 87 exit 85 88 ;; 86 89 esac
Note: See TracChangeset
for help on using the changeset viewer.