Changeset 208


Ignore:
Timestamp:
Oct 3, 2010, 1:19:59 PM (14 years ago)
Author:
rock
Message:

Modify: 精簡化
Add: 一次產生全部DRBL Clinet VM 設定檔(drbl_PXE_PV-VM_create_all)

Location:
drbl-virt/sbin
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/check_drbl_total_vm

    r207 r208  
    1515# [Varliables]
    1616vm_total_status_file=/tmp/vm_totoal_status.$$
    17 vm_IP_files=$(ls $Work_Home/etc/IP_VM_eth[0-9]*)
     17vm_IP_files=$(ls $Work_Home/etc/IP_VM_eth[0-9])
    1818
    1919# [Main]
  • drbl-virt/sbin/drbl_PXE_PV-VM_create

    r207 r208  
    2626# = 2. Functions declation =
    2727Usage(){
    28 echo "Usage: drbl_PXE_PV-VM_create.sh options"
     28echo "Usage: drbl_PXE_PV-VM_create [options]"
    2929echo "Options: "
    3030echo "-v|--vm      vm name"
     
    3232echo "-r|--ram     ram size(M) (default: 128)"
    3333echo "Examples: "
    34 echo "drbl_PXE_PV-VM_create.sh options -v drbl131 -c 2 -r 512"
     34echo "drbl_PXE_PV-VM_create -v drbl131 -c 2 -r 512"
    3535}
    3636
     
    3939check_root
    4040# = 1. Parse parameters =
    41 if [ $# -eq 0 ]; then
    42 Usage && exit
    43 fi
    44 
    4541while [ $# -gt 0 ]; do
    4642    case "$1" in
     
    108104[ -z $vm_name ] && echo "[Error] no VM name" && Usage && exit 2
    109105# check vm_name exist
    110 vm_IP_files=$(ls $Work_Home/etc/IP_VM_eth*)
     106IP_VM_files=$(ls $Work_Home/etc | grep 'IP_VM_eth[0-9]$')
    111107vm_exist_jude="no"
    112 for vm_IP_file in $vm_IP_files
     108for vm_IP_file in $IP_VM_files
    113109do
    114     if [ -n "$(grep "$vm_name" $vm_IP_file)" ]; then
     110    if [ -n "$(grep "$vm_name" $Work_Home/etc/$vm_IP_file)" ]; then
    115111        vm_exist_jude="yes"
    116112    fi
     
    126122# = 2. Get VM MAC address =
    127123#IP_MAC_files=$(ls $Work_Home/etc | grep 'macadr-VM-eth[0-9]*.txt')
    128 
    129 IP_VM_files=$(ls $Work_Home/etc | grep 'IP_VM_eth[0-9]*')
    130124IP_VM_right_file=""
    131125IP_VM_right_line=""
  • drbl-virt/sbin/drbl_PXE_PV-VM_deploy

    r207 r208  
    1717# [Declation]
    1818# = 1. Varibales declation =
    19 #vm_dir="/home/domains"
     19vm_dir="/home/domains"
    2020
    2121
    2222# = 2. Functions declation =
    2323Usage(){
    24 echo "Usage: drbl_PXE_PV-VM_deploy.sh options"
     24echo "Usage: drbl_PXE_PV-VM_deploy [options]"
    2525echo "Options:"
    2626echo "-h|--host      deploy vm to which host"
    27 echo "-v|--vm_cfg    vm configuration file"
     27echo "-v|--vm        vm name"
    2828echo "Example:"
    29 echo "drbl_PXE_PV-VM_create.sh -h drbl101 -v /home/domains/drbl131_PXE_PV-VM.cfg"
     29echo "drbl_PXE_PV-VM_deploy -h drbl101 -v drbl131"
    3030}
    3131
     
    5656            if [ -z "$(echo $1 |grep ^-.)" ]; then
    5757                if [ -n "$(echo $1)" ]; then
    58                     vm_conf_file=$1
     58                    vm_conf_file=${vm_dir}/${1}_PXE_PV-VM.cfg
    5959                else
    6060                    echo "-v vm_name is null"
  • drbl-virt/sbin/functions_drbl_virt

    r205 r208  
    214214        jude_2="yes"
    215215        echo "(If you have 10 PCs(4-core), suggestion is 30): "
     216        VM_IP_range=$drbl_original_clients_nu
    216217        read -p "[$drbl_original_clients_nu] " VM_IP_range
    217218        if [ $((${VM_IP_range}+${Host_last_IP_4})) -ge 254 ]; then
Note: See TracChangeset for help on using the changeset viewer.