Changeset 200 for drbl-virt/sbin


Ignore:
Timestamp:
Aug 30, 2010, 11:11:57 AM (14 years ago)
Author:
rock
Message:

Bugfix: var error

Location:
drbl-virt/sbin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/check_drbl_client.sh

    r199 r200  
    4040        client_Ram=$(cat $drbl_client_top_file | grep ^Mem | sed 's/total.*$//' | sed 's/^Mem://' | awk '{print $1}')
    4141        client_unused_Ram=$(cat $drbl_client_top_file | grep ^Mem | sed 's/^.*used,//' | sed 's/free.*$//' | awk '{print $1}')
     42   
    4243    fi
    4344
  • drbl-virt/sbin/check_drbl_vm.sh

    r199 r200  
    1919
    2020# [Main]
     21check_root
    2122for client_IP in $client_IPs
    2223do
     
    4243        declare -i i=1
    4344
    44         vm_numbers=$(echo vm_hostnames | wc -w)
    45        
     45        vm_numbers=$(echo $vm_hostnames | wc -w)
     46
    4647        printf "[Running VM: $vm_numbers]\n" >> $drbl_vm_file
    4748        printf "[Running VM: $vm_numbers]\n"
     
    5354            vm_CPU_loading="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $4}')"
    5455            vm_Ram_loading="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $6}')"
    55             printf "VM$i: $vm_hostname $vm_CPU_core ${vm_Ram}M $vm_CPU_loading%% $vm_Ram_loading%%\n" >> $drbl_vm_file
    56             printf "VM$i: $vm_hostname VCPU=$vm_CPU_core Mem=${vm_Ram}M VCPU_loading=$vm_CPU_loading%% Mem_usage=$vm_Ram_loading%%\n"
     56            printf "VM$i: $vm_hostname $vm_CPU_core ${vm_Ram}K $vm_CPU_loading%% $vm_Ram_loading%%\n" >> $drbl_vm_file
     57            printf "VM$i: $vm_hostname VCPU=$vm_CPU_core Mem=${vm_Ram}K VCPU_loading=$vm_CPU_loading%% Mem_usage=$vm_Ram_loading%%\n"
    5758            i=i+1
    5859        done
    5960   
     61    else
     62        echo "[Error] $client_hostname $client_IP is offline !" && exit 2
     63
    6064    fi
     65
    6166done
    6267
  • drbl-virt/sbin/drbl_PXE_PV-VM_create.sh

    r199 r200  
    107107# check null value
    108108[ -z $vm_name ] && echo "[Error] no VM name" && Usage && exit 2
     109# check vm_name exist
     110vm_IP_files=$(ls $Work_Home/etc/IP_VM_eth*)
     111vm_exist_jude="no"
     112for vm_IP_file in $vm_IP_files
     113do
     114    if [ -n "$(grep "$vm_name" $vm_IP_file)" ]; then
     115        vm_exist_jude="yes"
     116    fi
     117   
     118done
     119
     120if [ $vm_exist_jude == "no" ]; then
     121    echo "[Error] This VM name isn't DRBL PXE VM"
     122    exit 2
     123fi
     124
    109125
    110126# = 2. Get VM MAC address =
     
    149165echo "kernel      = '/home/domains/vmlinuz-pxe'" > $vm_cfg
    150166echo "ramdisk     = '/home/domains/initrd-pxe.img'" >> $vm_cfg
    151 echo "memory      = '512'" >> $vm_cfg
     167echo "memory      = '$vm_ram'" >> $vm_cfg
    152168echo "name        = '$vm_name'" >> $vm_cfg
    153169echo "vcpus        = '$vm_cpu'" >> $vm_cfg
  • drbl-virt/sbin/drbl_xen_repush.sh

    r195 r200  
    3535    cp /etc/drbl/IP_HOST_TABLE /opt/drbl-virt/etc/IP_HOST_TABLE
    3636fi 
     37
     38# back mac address file
     39cp /etc/drbl/macadr*eth*[0-9].txt /opt/drbl-virt/etc/
    3740
    3841for eth in $eths
Note: See TracChangeset for help on using the changeset viewer.