diff options
-rwxr-xr-x | contractor | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -329,11 +329,18 @@ class CreateWorkerVM(RemoteExecution): """ n="$(grep -c '^processor' /proc/cpuinfo)" n="$(expr "$n" - 1)" +mem="$(awk '/MemTotal/ {{ print $2 }}' /proc/meminfo)" +smaller="$(expr "$mem" - 2097152)" +if [ "$smaller" -lt 0 ] +then + smaller="$mem" +fi +mem="$(expr "$smaller" / 1024)" virt-install \ --connect=qemu:///system \ --quiet \ --name=worker \ - --memory=4096 \ + --memory="$mem" \ --vcpus="$n" \ --cpu=host \ --import \ |