From: martin f. krafft Date: Thu, 13 Nov 2014 14:26:03 +0000 (+0100) Subject: add cpus setting X-Git-Url: https://git.madduck.net/code/vinst.git/commitdiff_plain/a421231841b9635bb92e23b0e616b11b80247ec2?ds=sidebyside add cpus setting --- diff --git a/vinst b/vinst index 7d0ad49..a07629a 100755 --- a/vinst +++ b/vinst @@ -5,6 +5,7 @@ set -e # defaults RAM=512 DISK=20 +CPUS=1 STORAGE_POOL=default QEMU_URI=qemu:///system SUITE=wheezy @@ -97,6 +98,14 @@ while [ -n "$1" ]; do fi MAC="$1" ;; + (-c|--cpus) + shift + if [ -z "$1" ]; then + echo >&2 'E: --cpus/-c needs integer argument' + exit 1 + fi + CPUS="$1" + ;; (--debug) DEBUG=1 set -vx @@ -167,6 +176,7 @@ cat >&2 <<_eof suite: $SUITE ram: $RAM MiB disk: $DISK GiB + cpus: $CPUS wipe: $WIPE console: $CONSOLE restart: $RESTART @@ -202,6 +212,7 @@ fi virt-install --connect=$QEMU_URI \ ${DEBUGFLAG:-} \ -n $HOSTNAME \ + --vcpus=$CPUS \ -r $RAM \ --disk vol=$STORAGE_POOL/virt-$HOSTNAME \ --network bridge=$BRIDGE,mac=$MAC \