From a421231841b9635bb92e23b0e616b11b80247ec2 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Thu, 13 Nov 2014 15:26:03 +0100 Subject: [PATCH 1/1] add cpus setting --- vinst | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 \ -- 2.39.5