Index: drbl-virt/install.sh
===================================================================
--- drbl-virt/install.sh	(revision 206)
+++ drbl-virt/install.sh	(revision 207)
@@ -45,5 +45,5 @@
 
 # = 2. Move war =
-mv drbl-virt.war $Work_Home/
+#mv drbl-virt.war $Work_Home/
 
 # = 4. Install completion =
Index: drbl-virt/sbin/check_drbl_client
===================================================================
--- drbl-virt/sbin/check_drbl_client	(revision 207)
+++ drbl-virt/sbin/check_drbl_client	(revision 207)
@@ -0,0 +1,53 @@
+#!/bin/bash
+# Program:
+#   Check DRBL client status
+# Author: 
+#   Jazz, Rock {jazz, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:                                                                                          
+#   2010/08/29  Rock    First release (1.0) 
+
+source /opt/drbl-virt/conf/drbl-virt.conf
+source $Work_Path/functions_drbl_virt
+
+
+# [Varliables]
+client_IPs=$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | awk '{print $1}')
+drbl_client_file="/tmp/drbl_client_status.$$"
+drbl_client_top_file="/tmp/drbl_client_top.$$"
+
+
+# [Main] 
+drbl_sshkey
+for client_IP in $client_IPs
+do
+    # local variables
+    client_hostname="$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | grep $client_IP | awk '{print $2}')"
+    IP_status="online"
+    client_CPU_core=""
+    client_Ram=""
+    client_idle_CPU=""
+    client_unused_Ram=""
+    # check network status
+    ping -c1 -w1 $client_IP > /dev/null 2>&1 || IP_status="offline"
+
+    if [ $IP_status == "online" ]; then
+        # check CPU core
+        client_CPU_core=$(ssh -o StrictHostKeyChecking=no $client_IP "cat /proc/cpuinfo |grep processor | wc -l")
+        # check top information
+        ssh -o StrictHostKeyChecking=no $client_IP "top -b -n2 -d1 | awk '/^top/{i++}i==2'" > $drbl_client_top_file
+IP_VM_right_line=""
+        client_idle_CPU=$(cat $drbl_client_top_file | grep ^Cpu | sed 's/^.*ni,//' | sed 's/id,.*$//'  | awk '{print $1}')
+        client_Ram=$(cat $drbl_client_top_file | grep ^Mem | sed 's/total.*$//' | sed 's/^Mem://' | awk '{print $1}')
+        client_unused_Ram=$(cat $drbl_client_top_file | grep ^Mem | sed 's/^.*used,//' | sed 's/free.*$//' | awk '{print $1}')
+    
+    fi
+
+echo "[$client_hostname $client_IP] $IP_status CPU_Core=$client_CPU_core Ram=$client_Ram idle_CPU=$client_idle_CPU unused_Ram=$client_unused_Ram"
+#echo "[$client_hostname $client_IP] $IP_status $client_CPU_core $client_Ram $client_idle_CPU $client_unused_Ram" >> $drbl_client_file
+
+done
+
+# delete tmp file
+rm -f $drbl_client_top_file
Index: drbl-virt/sbin/check_drbl_client.sh
===================================================================
--- drbl-virt/sbin/check_drbl_client.sh	(revision 206)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#!/bin/bash
-# Program:
-#   Check DRBL client status
-# Author: 
-#   Jazz, Rock {jazz, rock}@nchc.org.tw
-# Version:
-#    1.0
-# History:                                                                                          
-#   2010/08/29  Rock    First release (1.0) 
-
-source /opt/drbl-virt/conf/drbl-virt.conf
-source $Work_Path/functions_drbl_virt
-
-
-# [Varliables]
-client_IPs=$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | awk '{print $1}')
-drbl_client_file="/tmp/drbl_client_status.$$"
-drbl_client_top_file="/tmp/drbl_client_top.$$"
-
-
-# [Main] 
-drbl_sshkey
-for client_IP in $client_IPs
-do
-    # local variables
-    client_hostname="$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | grep $client_IP | awk '{print $2}')"
-    IP_status="online"
-    client_CPU_core=""
-    client_Ram=""
-    client_idle_CPU=""
-    client_unused_Ram=""
-    # check network status
-    ping -c1 -w1 $client_IP > /dev/null 2>&1 || IP_status="offline"
-
-    if [ $IP_status == "online" ]; then
-        # check CPU core
-        client_CPU_core=$(ssh -o StrictHostKeyChecking=no $client_IP "cat /proc/cpuinfo |grep processor | wc -l")
-        # check top information
-        ssh -o StrictHostKeyChecking=no $client_IP "top -b -n2 -d1 | awk '/^top/{i++}i==2'" > $drbl_client_top_file
-IP_VM_right_line=""
-        client_idle_CPU=$(cat $drbl_client_top_file | grep ^Cpu | sed 's/^.*ni,//' | sed 's/id,.*$//'  | awk '{print $1}')
-        client_Ram=$(cat $drbl_client_top_file | grep ^Mem | sed 's/total.*$//' | sed 's/^Mem://' | awk '{print $1}')
-        client_unused_Ram=$(cat $drbl_client_top_file | grep ^Mem | sed 's/^.*used,//' | sed 's/free.*$//' | awk '{print $1}')
-    
-    fi
-
-echo "[$client_hostname $client_IP] $IP_status CPU_Core=$client_CPU_core Ram=$client_Ram idle_CPU=$client_idle_CPU unused_Ram=$client_unused_Ram"
-#echo "[$client_hostname $client_IP] $IP_status $client_CPU_core $client_Ram $client_idle_CPU $client_unused_Ram" >> $drbl_client_file
-
-done
-
-# delete tmp file
-rm -f $drbl_client_top_file
Index: drbl-virt/sbin/check_drbl_total_vm
===================================================================
--- drbl-virt/sbin/check_drbl_total_vm	(revision 207)
+++ drbl-virt/sbin/check_drbl_total_vm	(revision 207)
@@ -0,0 +1,44 @@
+#!/bin/bash
+# Program:
+#   Check DRBL total vm status
+# Author: 
+#   Jazz, Rock {jazz, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:                                                                                          
+#   2010/09/09  Rock    First release (1.0) 
+
+source /opt/drbl-virt/conf/drbl-virt.conf
+source $Work_Path/functions_drbl_virt
+
+
+# [Varliables]
+vm_total_status_file=/tmp/vm_totoal_status.$$
+vm_IP_files=$(ls $Work_Home/etc/IP_VM_eth[0-9]*)
+
+# [Main] 
+check_root
+
+echo -e "VM_IP       VM_Hostname \t VM_Status" >> $vm_total_status_file
+echo "------------------------------------------------------" >> $vm_total_status_file
+
+for vm_IP_file in $vm_IP_files
+do
+    # local variables
+    vm_IPs=$(cat $vm_IP_file | awk '{print $1}')
+    IP_status="online"
+
+    for vm_IP in $vm_IPs
+    do
+        # check network status
+        ping -c1 -w1 $vm_IP > /dev/null 2>&1 || IP_status="offline"
+        vm_IP_Hostname=$(sed -n "/$vm_IP/p" $vm_IP_file)
+        echo -e "$vm_IP_Hostname \t\t $IP_status" >> $vm_total_status_file
+    done
+
+done
+   
+cat $vm_total_status_file
+
+# dlete tmp file
+rm -f $vm_total_status_file
Index: drbl-virt/sbin/check_drbl_total_vm.sh
===================================================================
--- drbl-virt/sbin/check_drbl_total_vm.sh	(revision 206)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#!/bin/bash
-# Program:
-#   Check DRBL total vm status
-# Author: 
-#   Jazz, Rock {jazz, rock}@nchc.org.tw
-# Version:
-#    1.0
-# History:                                                                                          
-#   2010/09/09  Rock    First release (1.0) 
-
-source /opt/drbl-virt/conf/drbl-virt.conf
-source $Work_Path/functions_drbl_virt
-
-
-# [Varliables]
-vm_total_status_file=/tmp/vm_totoal_status.$$
-vm_IP_files=$(ls $Work_Home/etc/IP_VM_eth[0-9]*)
-
-# [Main] 
-check_root
-
-echo -e "VM_IP       VM_Hostname \t VM_Status" >> $vm_total_status_file
-echo "------------------------------------------------------" >> $vm_total_status_file
-
-for vm_IP_file in $vm_IP_files
-do
-    # local variables
-    vm_IPs=$(cat $vm_IP_file | awk '{print $1}')
-    IP_status="online"
-
-    for vm_IP in $vm_IPs
-    do
-        # check network status
-        ping -c1 -w1 $vm_IP > /dev/null 2>&1 || IP_status="offline"
-        vm_IP_Hostname=$(sed -n "/$vm_IP/p" $vm_IP_file)
-        echo -e "$vm_IP_Hostname \t\t $IP_status" >> $vm_total_status_file
-    done
-
-done
-   
-cat $vm_total_status_file
-
-# dlete tmp file
-rm -f $vm_total_status_file
Index: drbl-virt/sbin/check_drbl_vm
===================================================================
--- drbl-virt/sbin/check_drbl_vm	(revision 207)
+++ drbl-virt/sbin/check_drbl_vm	(revision 207)
@@ -0,0 +1,69 @@
+#!/bin/bash
+# Program:
+#   Check DRBL client status
+# Author: 
+#   Jazz, Rock {jazz, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:                                                                                          
+#   2010/08/29  Rock    First release (1.0) 
+
+source /opt/drbl-virt/conf/drbl-virt.conf
+source $Work_Path/functions_drbl_virt
+
+
+# [Varliables]
+client_IPs=$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | awk '{print $1}')
+drbl_vm_file="/tmp/drbl_vm_status.$$"
+drbl_vm_xentop_file="/tmp/drbl_vm_xentop.$$"
+
+# [Main] 
+check_root
+for client_IP in $client_IPs
+do
+    # local variables
+    IP_status="online"
+    client_hostname="$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | grep $client_IP | awk '{print $2}')"
+    vm_numbers=""
+    vm_hostnames=""
+    vm_IP=""
+    vm_CPU_core=""
+    vm_Ram=""
+    vm_CPU_loading=""
+    vm_Ram_loading=""
+    # check network status
+    ping -c1 -w1 $client_IP > /dev/null 2>&1 || IP_status="offline"
+    
+    if [ $IP_status == "online" ]; then
+        ssh -o StrictHostKeyChecking=no $client_IP "xentop -d1 -b -i2 | awk '/^.*NAME/{i++}i==2'" > $drbl_vm_xentop_file
+        vm_hostnames="$(cat $drbl_vm_xentop_file | sed -n '3,$p' | awk '{print $1}')"
+    
+#        printf "[$client_hostname] " >> $drbl_vm_file
+        printf "[$client_hostname] "
+        declare -i i=1
+
+        vm_numbers=$(echo $vm_hostnames | wc -w)
+
+#        printf "[Running VM: $vm_numbers]\n" >> $drbl_vm_file
+        printf "[Running VM: $vm_numbers]\n"
+
+        for vm_hostname in $vm_hostnames
+        do  
+            vm_CPU_core="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $9}')"
+            vm_Ram="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $5}')"
+            vm_CPU_loading="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $4}')"
+            vm_Ram_loading="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $6}')"
+#            printf "VM$i: $vm_hostname $vm_CPU_core ${vm_Ram}K $vm_CPU_loading%% $vm_Ram_loading%%\n" >> $drbl_vm_file
+            printf "VM$i: $vm_hostname VCPU=$vm_CPU_core Mem=${vm_Ram}K VCPU_loading=$vm_CPU_loading%% Mem_usage=$vm_Ram_loading%%\n"
+            i=i+1
+        done
+        echo "" 
+    else
+        echo "[Error] $client_hostname $client_IP is offline !"
+
+    fi
+
+done
+
+# dlete tmp file
+rm -f $drbl_vm_xentop_file
Index: drbl-virt/sbin/check_drbl_vm.sh
===================================================================
--- drbl-virt/sbin/check_drbl_vm.sh	(revision 206)
+++ 	(revision )
@@ -1,69 +1,0 @@
-#!/bin/bash
-# Program:
-#   Check DRBL client status
-# Author: 
-#   Jazz, Rock {jazz, rock}@nchc.org.tw
-# Version:
-#    1.0
-# History:                                                                                          
-#   2010/08/29  Rock    First release (1.0) 
-
-source /opt/drbl-virt/conf/drbl-virt.conf
-source $Work_Path/functions_drbl_virt
-
-
-# [Varliables]
-client_IPs=$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | awk '{print $1}')
-drbl_vm_file="/tmp/drbl_vm_status.$$"
-drbl_vm_xentop_file="/tmp/drbl_vm_xentop.$$"
-
-# [Main] 
-check_root
-for client_IP in $client_IPs
-do
-    # local variables
-    IP_status="online"
-    client_hostname="$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | grep $client_IP | awk '{print $2}')"
-    vm_numbers=""
-    vm_hostnames=""
-    vm_IP=""
-    vm_CPU_core=""
-    vm_Ram=""
-    vm_CPU_loading=""
-    vm_Ram_loading=""
-    # check network status
-    ping -c1 -w1 $client_IP > /dev/null 2>&1 || IP_status="offline"
-    
-    if [ $IP_status == "online" ]; then
-        ssh -o StrictHostKeyChecking=no $client_IP "xentop -d1 -b -i2 | awk '/^.*NAME/{i++}i==2'" > $drbl_vm_xentop_file
-        vm_hostnames="$(cat $drbl_vm_xentop_file | sed -n '3,$p' | awk '{print $1}')"
-    
-#        printf "[$client_hostname] " >> $drbl_vm_file
-        printf "[$client_hostname] "
-        declare -i i=1
-
-        vm_numbers=$(echo $vm_hostnames | wc -w)
-
-#        printf "[Running VM: $vm_numbers]\n" >> $drbl_vm_file
-        printf "[Running VM: $vm_numbers]\n"
-
-        for vm_hostname in $vm_hostnames
-        do  
-            vm_CPU_core="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $9}')"
-            vm_Ram="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $5}')"
-            vm_CPU_loading="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $4}')"
-            vm_Ram_loading="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $6}')"
-#            printf "VM$i: $vm_hostname $vm_CPU_core ${vm_Ram}K $vm_CPU_loading%% $vm_Ram_loading%%\n" >> $drbl_vm_file
-            printf "VM$i: $vm_hostname VCPU=$vm_CPU_core Mem=${vm_Ram}K VCPU_loading=$vm_CPU_loading%% Mem_usage=$vm_Ram_loading%%\n"
-            i=i+1
-        done
-        echo "" 
-    else
-        echo "[Error] $client_hostname $client_IP is offline !"
-
-    fi
-
-done
-
-# dlete tmp file
-rm -f $drbl_vm_xentop_file
Index: drbl-virt/sbin/drbl_PXE_PV-VM_create
===================================================================
--- drbl-virt/sbin/drbl_PXE_PV-VM_create	(revision 207)
+++ drbl-virt/sbin/drbl_PXE_PV-VM_create	(revision 207)
@@ -0,0 +1,181 @@
+#!/bin/bash
+# Program:
+#   Create PXE PV VM
+# Author: 
+#   Jazz, Rock {jazz, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:                                                                                          
+#   2010/08/27  Rock    First release (1.0) 
+
+# [Source]
+source /opt/drbl-virt/conf/drbl-virt.conf
+source $Work_Path/functions_drbl_virt
+#source ./functions_drbl_PXE_PV-VM_create
+
+
+# [Declation]
+# = 1. Varibales declation =
+vm_name=""
+vm_cpu="1"
+vm_ram="128"
+#vm_host=""
+vm_mac=""
+
+vm_dir="/home/domains"
+# = 2. Functions declation =
+Usage(){
+echo "Usage: drbl_PXE_PV-VM_create.sh options"
+echo "Options: "
+echo "-v|--vm      vm name"
+echo "-c|--cpu     cpu number (default: 1)"
+echo "-r|--ram     ram size(M) (default: 128)"
+echo "Examples: "
+echo "drbl_PXE_PV-VM_create.sh options -v drbl131 -c 2 -r 512"
+}
+
+
+# [Main]
+check_root
+# = 1. Parse parameters = 
+if [ $# -eq 0 ]; then
+Usage && exit
+fi
+
+while [ $# -gt 0 ]; do
+    case "$1" in
+        -v|--vm)
+            shift
+            if [ -z "$(echo $1 |grep ^-.)" ]; then
+                if [ -n "$(echo $1)" ]; then
+                    vm_name=$1
+                else
+                    echo "-v vm_name is null"
+                    Usage && exit 2
+                fi
+            shift
+            fi
+            ;;
+        -c|--cpu)
+            shift
+            if [ -z "$(echo $1 |grep ^-.)" ]; then
+                if [ -n "$(echo $1)" ]; then 
+                    vm_cpu=$1
+                else
+                    echo "-c cpu_value is null"
+                    Usage && exit 2
+                fi
+            shift
+            fi
+            ;;
+        -r|--ram)
+            shift 
+            if [ -z "$(echo $1 |grep ^-.)" ]; then
+                if [ -n "$(echo $1)" ]; then
+                    vm_ram=$1
+                else
+                    echo "-r ram_value is null"
+                    Usage && exit 2
+                fi
+            shift 
+            fi 
+            ;;  
+#        -h|--host)
+#            shift 
+#            if [ -z "$(echo $1 |grep ^-.)" ]; then
+#                if [ -n "$(echo $1)" ]; then
+#                vm_host=$1
+#                else
+#                    echo "-h host_value is null"
+#                    Usage && exit 2
+#                fi
+#            shift 
+#            fi 
+#            ;; 
+        -*)
+            echo "$0 $1 invalid option" >&2
+            echo ""
+            Usage >&2
+            exit 2
+            ;;
+        *)  Usage >&2
+            exit 2
+            ;;
+    esac
+done
+
+# check null value
+[ -z $vm_name ] && echo "[Error] no VM name" && Usage && exit 2
+# check vm_name exist
+vm_IP_files=$(ls $Work_Home/etc/IP_VM_eth*)
+vm_exist_jude="no"
+for vm_IP_file in $vm_IP_files
+do
+    if [ -n "$(grep "$vm_name" $vm_IP_file)" ]; then
+        vm_exist_jude="yes"
+    fi
+    
+done
+
+if [ $vm_exist_jude == "no" ]; then
+    echo "[Error] This VM name isn't DRBL PXE VM"
+    exit 2
+fi
+
+
+# = 2. Get VM MAC address =
+#IP_MAC_files=$(ls $Work_Home/etc | grep 'macadr-VM-eth[0-9]*.txt')
+
+IP_VM_files=$(ls $Work_Home/etc | grep 'IP_VM_eth[0-9]*')
+IP_VM_right_file=""
+IP_VM_right_line=""
+IP_VM_eth=""
+for IP_VM_file in $IP_VM_files
+do
+    IP_VM_line=$(cat -n $Work_Home/etc/$IP_VM_file | grep "$vm_name" | awk '{print $1}') 
+    if [ -n $IP_VM_line ]; then
+        IP_VM_right_file=$IP_VM_file
+        IP_VM_right_line=$IP_VM_line
+    fi
+done
+
+# if no value, exit and check IP_VM_ethX
+if [ -z $IP_VM_right_file ]; then
+    echo ""
+    echo "[Error] don't fine ${vm_name}'s IP address"
+    echo "Please check $Wokr_Home/etc/"
+    exit 2
+fi
+
+# start get mac address
+IP_VM_eth=$(echo $IP_VM_right_file | sed 's/IP_VM_//g' )
+vm_mac=$(cat $Work_Home/etc/macadr-VM-${IP_VM_eth}.txt | sed -n "${IP_VM_right_line}p")
+
+# = 3. Generate PXE PV-VM configuration  =
+if [ ! -e $vm_dir ]; then
+    mkdir $vm_dir
+fi
+
+vm_cfg=${vm_dir}/${vm_name}_PXE_PV-VM.cfg
+
+if [ -e $vm_cfg ]; then
+rm $vm_cfg
+fi
+
+# start to generate 
+echo "kernel      = '/home/domains/vmlinuz-pxe'" > $vm_cfg
+echo "ramdisk     = '/home/domains/initrd-pxe.img'" >> $vm_cfg
+echo "memory      = '$vm_ram'" >> $vm_cfg
+echo "name        = '$vm_name'" >> $vm_cfg
+echo "vcpus        = '$vm_cpu'" >> $vm_cfg
+echo "dhcp        = 'dhcp'" >> $vm_cfg
+echo "vif         = [ 'mac=$vm_mac']" >> $vm_cfg
+echo "on_poweroff = 'destroy'" >> $vm_cfg
+echo "on_reboot   = 'restart'" >> $vm_cfg
+echo "on_crash    = 'restart'" >> $vm_cfg
+echo "vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncunused=1' ]" >> $vm_cfg
+echo "extra = 'console=hvc0 xencons=tty'" >> $vm_cfg
+
+#
+echo "$vm_cfg is completion"
+echo "Use this command drbl_PXE_PV-VM_deploy.sh to deploy vm"
Index: drbl-virt/sbin/drbl_PXE_PV-VM_create.sh
===================================================================
--- drbl-virt/sbin/drbl_PXE_PV-VM_create.sh	(revision 206)
+++ 	(revision )
@@ -1,181 +1,0 @@
-#!/bin/bash
-# Program:
-#   Create PXE PV VM
-# Author: 
-#   Jazz, Rock {jazz, rock}@nchc.org.tw
-# Version:
-#    1.0
-# History:                                                                                          
-#   2010/08/27  Rock    First release (1.0) 
-
-# [Source]
-source /opt/drbl-virt/conf/drbl-virt.conf
-source $Work_Path/functions_drbl_virt
-#source ./functions_drbl_PXE_PV-VM_create
-
-
-# [Declation]
-# = 1. Varibales declation =
-vm_name=""
-vm_cpu="1"
-vm_ram="128"
-#vm_host=""
-vm_mac=""
-
-vm_dir="/home/domains"
-# = 2. Functions declation =
-Usage(){
-echo "Usage: drbl_PXE_PV-VM_create.sh options"
-echo "Options: "
-echo "-v|--vm      vm name"
-echo "-c|--cpu     cpu number (default: 1)"
-echo "-r|--ram     ram size(M) (default: 128)"
-echo "Examples: "
-echo "drbl_PXE_PV-VM_create.sh options -v drbl131 -c 2 -r 512"
-}
-
-
-# [Main]
-check_root
-# = 1. Parse parameters = 
-if [ $# -eq 0 ]; then
-Usage && exit
-fi
-
-while [ $# -gt 0 ]; do
-    case "$1" in
-        -v|--vm)
-            shift
-            if [ -z "$(echo $1 |grep ^-.)" ]; then
-                if [ -n "$(echo $1)" ]; then
-                    vm_name=$1
-                else
-                    echo "-v vm_name is null"
-                    Usage && exit 2
-                fi
-            shift
-            fi
-            ;;
-        -c|--cpu)
-            shift
-            if [ -z "$(echo $1 |grep ^-.)" ]; then
-                if [ -n "$(echo $1)" ]; then 
-                    vm_cpu=$1
-                else
-                    echo "-c cpu_value is null"
-                    Usage && exit 2
-                fi
-            shift
-            fi
-            ;;
-        -r|--ram)
-            shift 
-            if [ -z "$(echo $1 |grep ^-.)" ]; then
-                if [ -n "$(echo $1)" ]; then
-                    vm_ram=$1
-                else
-                    echo "-r ram_value is null"
-                    Usage && exit 2
-                fi
-            shift 
-            fi 
-            ;;  
-#        -h|--host)
-#            shift 
-#            if [ -z "$(echo $1 |grep ^-.)" ]; then
-#                if [ -n "$(echo $1)" ]; then
-#                vm_host=$1
-#                else
-#                    echo "-h host_value is null"
-#                    Usage && exit 2
-#                fi
-#            shift 
-#            fi 
-#            ;; 
-        -*)
-            echo "$0 $1 invalid option" >&2
-            echo ""
-            Usage >&2
-            exit 2
-            ;;
-        *)  Usage >&2
-            exit 2
-            ;;
-    esac
-done
-
-# check null value
-[ -z $vm_name ] && echo "[Error] no VM name" && Usage && exit 2
-# check vm_name exist
-vm_IP_files=$(ls $Work_Home/etc/IP_VM_eth*)
-vm_exist_jude="no"
-for vm_IP_file in $vm_IP_files
-do
-    if [ -n "$(grep "$vm_name" $vm_IP_file)" ]; then
-        vm_exist_jude="yes"
-    fi
-    
-done
-
-if [ $vm_exist_jude == "no" ]; then
-    echo "[Error] This VM name isn't DRBL PXE VM"
-    exit 2
-fi
-
-
-# = 2. Get VM MAC address =
-#IP_MAC_files=$(ls $Work_Home/etc | grep 'macadr-VM-eth[0-9]*.txt')
-
-IP_VM_files=$(ls $Work_Home/etc | grep 'IP_VM_eth[0-9]*')
-IP_VM_right_file=""
-IP_VM_right_line=""
-IP_VM_eth=""
-for IP_VM_file in $IP_VM_files
-do
-    IP_VM_line=$(cat -n $Work_Home/etc/$IP_VM_file | grep "$vm_name" | awk '{print $1}') 
-    if [ -n $IP_VM_line ]; then
-        IP_VM_right_file=$IP_VM_file
-        IP_VM_right_line=$IP_VM_line
-    fi
-done
-
-# if no value, exit and check IP_VM_ethX
-if [ -z $IP_VM_right_file ]; then
-    echo ""
-    echo "[Error] don't fine ${vm_name}'s IP address"
-    echo "Please check $Wokr_Home/etc/"
-    exit 2
-fi
-
-# start get mac address
-IP_VM_eth=$(echo $IP_VM_right_file | sed 's/IP_VM_//g' )
-vm_mac=$(cat $Work_Home/etc/macadr-VM-${IP_VM_eth}.txt | sed -n "${IP_VM_right_line}p")
-
-# = 3. Generate PXE PV-VM configuration  =
-if [ ! -e $vm_dir ]; then
-    mkdir $vm_dir
-fi
-
-vm_cfg=${vm_dir}/${vm_name}_PXE_PV-VM.cfg
-
-if [ -e $vm_cfg ]; then
-rm $vm_cfg
-fi
-
-# start to generate 
-echo "kernel      = '/home/domains/vmlinuz-pxe'" > $vm_cfg
-echo "ramdisk     = '/home/domains/initrd-pxe.img'" >> $vm_cfg
-echo "memory      = '$vm_ram'" >> $vm_cfg
-echo "name        = '$vm_name'" >> $vm_cfg
-echo "vcpus        = '$vm_cpu'" >> $vm_cfg
-echo "dhcp        = 'dhcp'" >> $vm_cfg
-echo "vif         = [ 'mac=$vm_mac']" >> $vm_cfg
-echo "on_poweroff = 'destroy'" >> $vm_cfg
-echo "on_reboot   = 'restart'" >> $vm_cfg
-echo "on_crash    = 'restart'" >> $vm_cfg
-echo "vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncunused=1' ]" >> $vm_cfg
-echo "extra = 'console=hvc0 xencons=tty'" >> $vm_cfg
-
-#
-echo "$vm_cfg is completion"
-echo "Use this command drbl_PXE_PV-VM_deploy.sh to deploy vm"
Index: drbl-virt/sbin/drbl_PXE_PV-VM_deploy
===================================================================
--- drbl-virt/sbin/drbl_PXE_PV-VM_deploy	(revision 207)
+++ drbl-virt/sbin/drbl_PXE_PV-VM_deploy	(revision 207)
@@ -0,0 +1,101 @@
+#!/bin/bash
+# Program:
+#   Deploy PXE PV VM to DRBL client
+# Author: 
+#   Jazz, Rock {jazz, rock}@nchc.org.tw
+# Version:
+#    1.0
+# History:                                                                                          
+#   2010/08/27  Rock    First release (1.0) 
+
+# [Source]
+source /opt/drbl-virt/conf/drbl-virt.conf
+source $Work_Path/functions_drbl_virt
+#source ./functions_drbl_PXE_PV-VM_create
+
+
+# [Declation]
+# = 1. Varibales declation =
+#vm_dir="/home/domains"
+
+
+# = 2. Functions declation =
+Usage(){
+echo "Usage: drbl_PXE_PV-VM_deploy.sh options"
+echo "Options:"
+echo "-h|--host      deploy vm to which host"
+echo "-v|--vm_cfg    vm configuration file"
+echo "Example:"
+echo "drbl_PXE_PV-VM_create.sh -h drbl101 -v /home/domains/drbl131_PXE_PV-VM.cfg"
+}
+
+
+# [Main]
+check_root
+# = 1. Parse parameters = 
+if [ $# -eq 0 ]; then
+Usage && exit
+fi
+
+while [ $# -gt 0 ]; do
+    case "$1" in
+        -h|--host)
+            shift 
+            if [ -z "$(echo $1 |grep ^-.)" ]; then
+                if [ -n "$(echo $1)" ]; then
+                    client_name=$1
+                else
+                    echo "-h host_value is null"
+                    Usage && exit 2
+                fi
+            shift 
+            fi 
+            ;; 
+        -v|--vm_cfg)
+            shift
+            if [ -z "$(echo $1 |grep ^-.)" ]; then
+                if [ -n "$(echo $1)" ]; then
+                    vm_conf_file=$1
+                else
+                    echo "-v vm_name is null"
+                    Usage && exit 2
+                fi
+            shift
+            fi
+            ;;
+ 
+        -*)
+            echo "$0 $1 invalid option" >&2
+            echo ""
+            Usage >&2
+            exit 2
+            ;;
+        *)  Usage >&2
+            exit 2
+            ;;
+    esac
+done
+
+
+# = 2. Check null value =
+[ -z $client_name ] && echo "[Error] no host" && Usage && exit 2
+[ -z $vm_conf_file ] && echo "[Error] no VM configuration file" && Usage && exit 2
+
+
+# = 3. Check exist
+# VM configuration
+[ ! -e "$vm_conf_file" ] && echo "[Error] Don't find $vm_conf_file" && exit 2
+cat $Work_Home/etc/IP_HOST_TABLE | grep $client_name
+if [ $? -ne 0 ]; then
+    echo "[Error] This host is not DRBL client"
+    exit 2
+fi
+
+
+# = 4. ssh host to deploy VM  =
+# local varibales
+host_IP=$(cat $Work_Home/etc/IP_HOST_TABLE | grep $client_name | awk '{print $1}')
+
+# start ssh
+ssh -o StrictHostKeyChecking=no $host_IP "xm create $vm_conf_file"
+
Index: drbl-virt/sbin/drbl_PXE_PV-VM_deploy.sh
===================================================================
--- drbl-virt/sbin/drbl_PXE_PV-VM_deploy.sh	(revision 206)
+++ 	(revision )
@@ -1,101 +1,0 @@
-#!/bin/bash
-# Program:
-#   Deploy PXE PV VM to DRBL client
-# Author: 
-#   Jazz, Rock {jazz, rock}@nchc.org.tw
-# Version:
-#    1.0
-# History:                                                                                          
-#   2010/08/27  Rock    First release (1.0) 
-
-# [Source]
-source /opt/drbl-virt/conf/drbl-virt.conf
-source $Work_Path/functions_drbl_virt
-#source ./functions_drbl_PXE_PV-VM_create
-
-
-# [Declation]
-# = 1. Varibales declation =
-#vm_dir="/home/domains"
-
-
-# = 2. Functions declation =
-Usage(){
-echo "Usage: drbl_PXE_PV-VM_deploy.sh options"
-echo "Options:"
-echo "-h|--host      deploy vm to which host"
-echo "-v|--vm_cfg    vm configuration file"
-echo "Example:"
-echo "drbl_PXE_PV-VM_create.sh -h drbl101 -v /home/domains/drbl131_PXE_PV-VM.cfg"
-}
-
-
-# [Main]
-check_root
-# = 1. Parse parameters = 
-if [ $# -eq 0 ]; then
-Usage && exit
-fi
-
-while [ $# -gt 0 ]; do
-    case "$1" in
-        -h|--host)
-            shift 
-            if [ -z "$(echo $1 |grep ^-.)" ]; then
-                if [ -n "$(echo $1)" ]; then
-                    client_name=$1
-                else
-                    echo "-h host_value is null"
-                    Usage && exit 2
-                fi
-            shift 
-            fi 
-            ;; 
-        -v|--vm_cfg)
-            shift
-            if [ -z "$(echo $1 |grep ^-.)" ]; then
-                if [ -n "$(echo $1)" ]; then
-                    vm_conf_file=$1
-                else
-                    echo "-v vm_name is null"
-                    Usage && exit 2
-                fi
-            shift
-            fi
-            ;;
- 
-        -*)
-            echo "$0 $1 invalid option" >&2
-            echo ""
-            Usage >&2
-            exit 2
-            ;;
-        *)  Usage >&2
-            exit 2
-            ;;
-    esac
-done
-
-
-# = 2. Check null value =
-[ -z $client_name ] && echo "[Error] no host" && Usage && exit 2
-[ -z $vm_conf_file ] && echo "[Error] no VM configuration file" && Usage && exit 2
-
-
-# = 3. Check exist
-# VM configuration
-[ ! -e "$vm_conf_file" ] && echo "[Error] Don't find $vm_conf_file" && exit 2
-cat $Work_Home/etc/IP_HOST_TABLE | grep $client_name
-if [ $? -ne 0 ]; then
-    echo "[Error] This host is not DRBL client"
-    exit 2
-fi
-
-
-# = 4. ssh host to deploy VM  =
-# local varibales
-host_IP=$(cat $Work_Home/etc/IP_HOST_TABLE | grep $client_name | awk '{print $1}')
-
-# start ssh
-ssh -o StrictHostKeyChecking=no $host_IP "xm create $vm_conf_file"
-
Index: drbl-virt/sbin/drbl_virt.sh
===================================================================
--- drbl-virt/sbin/drbl_virt.sh	(revision 206)
+++ drbl-virt/sbin/drbl_virt.sh	(revision 207)
@@ -32,4 +32,5 @@
 
 # = 4. Create User(drbl-virter) and mv drbl-virt.wat to tomcat =
-creat_drbl-virter
-install_tomcat_and_mv_drbl-virt
+#creat_drbl-virter
+#install_tomcat_and_mv_drbl-virt
+
