Ignore:
Timestamp:
Oct 22, 2010, 1:13:42 PM (14 years ago)
Author:
rock
Message:

Modify: KVM smp support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/drbl_PXE_KVM-VM_deploy

    r219 r220  
    2020vm_ram="256"
    2121vm_mac=""
    22 
     22vm_cpu="1"
    2323vm_dir="/home/domains"
    2424
     
    2929echo "-h|--host      deploy vm to which host"
    3030echo "-v|--vm        vm name"
     31echo "-c|--cpu       vm cpu (default: 1)"
    3132echo "-r|--ram       vm ram size(M) (default: 256)"
    3233echo "Example:"
     
    6869            fi
    6970            ;;
     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
    7081        -r|--ram)
    7182            shift
     
    152163vnc_nus=$(ssh -o StrictHostKeyChecking=no $host_IP "netstat -tunlp | grep kvm | wc -l")
    153164vnc_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 &"
     165ssh -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 &"
    155166
Note: See TracChangeset for help on using the changeset viewer.