Changeset 220
- Timestamp:
- Oct 22, 2010, 1:13:42 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
drbl-virt/sbin/drbl_PXE_KVM-VM_deploy
r219 r220 20 20 vm_ram="256" 21 21 vm_mac="" 22 22 vm_cpu="1" 23 23 vm_dir="/home/domains" 24 24 … … 29 29 echo "-h|--host deploy vm to which host" 30 30 echo "-v|--vm vm name" 31 echo "-c|--cpu vm cpu (default: 1)" 31 32 echo "-r|--ram vm ram size(M) (default: 256)" 32 33 echo "Example:" … … 68 69 fi 69 70 ;; 71 -c|--cpu) 72 if [ -z "$(echo $1 |grep ^-.)" ]; then 73 if [ -n "$(echo $1)" ]; then 74 vm_cpu=$1 75 else 76 echo "-c vm cpu is null" 77 Usage && exit 2 78 fi 79 shift 80 fi 70 81 -r|--ram) 71 82 shift … … 152 163 vnc_nus=$(ssh -o StrictHostKeyChecking=no $host_IP "netstat -tunlp | grep kvm | wc -l") 153 164 vnc_nus=$((vnc_nus+1)) 154 ssh -o StrictHostKeyChecking=no $host_IP "kvm -name $vm_name - m $vm_ram -net nic,macaddr=$vm_mac -net tap -vnc :$vnc_nus -boot n &"165 ssh -o StrictHostKeyChecking=no $host_IP "kvm -name $vm_name -smp $vm_cpu -m $vm_ram -net nic,macaddr=$vm_mac -net tap -vnc :$vnc_nus -boot n &" 155 166
Note: See TracChangeset
for help on using the changeset viewer.