Index: drbl-virt/sbin/drbl_PXE_PV-VM_deploy.sh
===================================================================
--- drbl-virt/sbin/drbl_PXE_PV-VM_deploy.sh	(revision 181)
+++ drbl-virt/sbin/drbl_PXE_PV-VM_deploy.sh	(revision 182)
@@ -32,14 +32,12 @@
     Host_last_IP=""
     get_Host_IP_range
-    # == Get VM number & IP range  ==
+    # == Get VM number, IP range & prefix name ==
     declare -i VM_IP_range=""
     declare -i Host_last_IP_4=""
     VM_first_IP=""
     VM_last_IP=""
-    get_VM_IP_range
-    # == Get VM IP prefix hostname  ==
     VM_prefix_name=""
-    get_VM_prefix_name
-    
+    get_VM_IP_range_and_prefix_name
+    create_VM_IP_table 
 
 done
Index: drbl-virt/sbin/functions_drbl_virt
===================================================================
--- drbl-virt/sbin/functions_drbl_virt	(revision 181)
+++ drbl-virt/sbin/functions_drbl_virt	(revision 182)
@@ -158,6 +158,11 @@
 function get_DRBL_eth(){
 eths=$(ls /etc/drbl | grep macadr-eth[0-9] | grep [0-9].txt$ | cut -d "-" -f2 | cut -d "." -f1)
-eths_nu=$(echo $eths | wc -l)
-
+eths_nu=$(echo $eths | wc -w)
+
+if [ $eths_nu -gt 1 ]; then
+    echo ""
+    echo "There are multiple eth for DRBL environment: "
+    echo "$eths"
+fi
 
 }
@@ -181,9 +186,10 @@
 }
 
-function get_VM_IP_range(){
+function get_VM_IP_range_and_prefix_name(){
+
 echo ""
-echo "DRBL client IP range -> $eth [$Host_first_IP ~ $Host_last_IP]"
-
-declare -i Host_last_IP_4=$(echo $Host_last_IP | cut -d "." -f4)
+echo "DRBL client IP range -> $eth: [$Host_first_IP ~ $Host_last_IP]"
+
+Host_last_IP_4=$(echo $Host_last_IP | cut -d "." -f4)
 Host_last_IP_4=$(($Host_last_IP_4+1))
 VM_first_IP=$(echo $Host_last_IP | cut -d "." -f 1-3)
@@ -195,6 +201,18 @@
 do
     echo ""
-    echo "Input VM number/IP range in $eth (ex. 40)."
-    read -p "(If you have 10 PCs(4-core), suggestion is 30): " VM_IP_range
+    echo "Input VM number/IP range for $eth (ex. 40)."
+
+    jude_2="no"
+    while [ $jude_2 != "yes" -a $jude_2 != "y" ]
+    do
+        jude_2="yes"
+        read -p "(If you have 10 PCs(4-core), suggestion is 30): " VM_IP_range
+        if [ $((${VM_IP_range}+${Host_last_IP_4})) -ge 254 ]; then
+            echo "range can't greater than 254"
+            jude_2="no"
+        fi
+    done
+
+    read -p "Input Prefix name for VM for $eth (ex. drblvm): " VM_prefix_name
     read -p "Is it correct? (yes/no): " jude
 done
@@ -204,14 +222,14 @@
 }
 
-function get_VM_prefix_name(){ 
-jude="no"
-while [ $jude != "yes" -a $jude != "y" ];
-do
-    echo ""
-    read -p "Input Prefix name for VM in $eth (ex. drblvm): " VM_prefix_name
-    read -p "Is it correct? (yes/no): " jude
-done
+#function get_VM_prefix_name(){ 
+#jude="no"
+#while [ $jude != "yes" -a $jude != "y" ];
+#do
+#    echo ""
+#    read -p "Input Prefix name for VM for $eth (ex. drblvm): " VM_prefix_name
+#    read -p "Is it correct? (yes/no): " jude
+#done
 #echo "VM_prefix_name=$VM_prefix_name"
-}
+#}
 
 function create_VM_IP_table(){
@@ -230,5 +248,5 @@
 # 2 bit
 if [ $VM_Host_totoal_nu -lt 100 ]; then
-    for (( i=$Host_last_IP_4 ; i<="$VM_IP_range" ; i++ ))
+    for (( i=$Host_last_IP_4 ; i<="$VM_Host_totoal_nu" ; i++ ))
     do
         if [ $i -lt 10 ]; then
@@ -238,10 +256,10 @@
         else
             VM_IP_1=$i
-            echo "${eth_network_f3}.$VM_IP_1 ${VM_prefix_name}${VM_IP_0}${VM_IP_1}" >> /opt/drbl-virt/etc/IP_VM_$et
+            echo "${eth_network_f3}.$VM_IP_1 ${VM_prefix_name}${VM_IP_0}${VM_IP_1}" >> /opt/drbl-virt/etc/IP_VM_$eth
         fi
     done
 # 3 bit
 elif [ $VM_Host_totoal_nu -ge 100 ] && [ $VM_Host_totoal_nu -lt 254 ]; then
-    for (( i=$Host_last_IP_4 ; i<=$VM_IP_range ; i++ ))
+    for (( i=$Host_last_IP_4 ; i<=$VM_Host_totoal_nu ; i++ ))
     do
         if [ $i -lt 10 ]; then
