Index: drbl-virt/sbin/check_drbl_client.sh
===================================================================
--- drbl-virt/sbin/check_drbl_client.sh	(revision 198)
+++ drbl-virt/sbin/check_drbl_client.sh	(revision 199)
@@ -47,3 +47,4 @@
 done
 
-
+# delete tmp file
+rm -f $drbl_client_top_file
Index: drbl-virt/sbin/check_drbl_vm.sh
===================================================================
--- drbl-virt/sbin/check_drbl_vm.sh	(revision 198)
+++ drbl-virt/sbin/check_drbl_vm.sh	(revision 199)
@@ -16,5 +16,5 @@
 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] 
@@ -22,7 +22,7 @@
 do
     # local variables
-    drbl_vm_xentop_file="/tmp/drbl_vm_xentop.$client_IP.$$"
     IP_status="online"
     client_hostname="$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | awk '{print $2}')"
+    vm_numbers=""
     vm_hostnames=""
     vm_IP=""
@@ -38,7 +38,12 @@
         vm_hostnames="$(cat $drbl_vm_xentop_file | sed -n '3,$p' | awk '{print $1}')"
     
-        printf "[$client_hostname]\n" >> $drbl_vm_file
-        printf "[$client_hostname]\n"
+        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
@@ -56,2 +61,4 @@
 done
 
+# dlete tmp file
+rm -f $drbl_vm_xentop_file
Index: drbl-virt/sbin/drbl_PXE_PV-VM_create.sh
===================================================================
--- drbl-virt/sbin/drbl_PXE_PV-VM_create.sh	(revision 198)
+++ drbl-virt/sbin/drbl_PXE_PV-VM_create.sh	(revision 199)
@@ -18,7 +18,7 @@
 # = 1. Varibales declation =
 vm_name=""
-vm_cpu=""
-vm_ram=""
-vm_host=""
+vm_cpu="1"
+vm_ram="128"
+#vm_host=""
 vm_mac=""
 
@@ -29,9 +29,8 @@
 echo "Options: "
 echo "-v|--vm      vm name"
-echo "-c|--cpu     cpu number"
-echo "-r|--ram     ram size"
-echo "-h|--host    deploy vm to which host"
+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 drbl110 -c 2 -r 512 -h drbl101"
+echo "drbl_PXE_PV-VM_create.sh options -v drbl131 -c 2 -r 512"
 }
 
@@ -82,16 +81,16 @@
             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 
-            ;; 
+#        -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
@@ -105,4 +104,7 @@
     esac
 done
+
+# check null value
+[ -z $vm_name ] && echo "[Error] no VM name" && Usage && exit 2
 
 # = 2. Get VM MAC address =
Index: drbl-virt/sbin/drbl_PXE_PV-VM_deploy.sh
===================================================================
--- drbl-virt/sbin/drbl_PXE_PV-VM_deploy.sh	(revision 199)
+++ drbl-virt/sbin/drbl_PXE_PV-VM_deploy.sh	(revision 199)
@@ -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"
+
