diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-05-10 14:26:05 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-05-10 14:26:05 +0000 |
commit | f24c72538183736f63c9f5ca94f1d9045115bd07 (patch) | |
tree | c7d3af2bc94f649f20aba3f46298bcb67fb0ded1 | |
parent | 5162bbdc3244794855adadd8d5ad0205000be8c8 (diff) | |
parent | 3c306b3bffe6ce680f9bf5b0602fead43a9187e7 (diff) | |
download | ick-contractor-f24c72538183736f63c9f5ca94f1d9045115bd07.tar.gz |
Merge branch 'mem' into 'master'
feat: use all the memory on the manager for the worker, sans 2GB
Closes #16
See merge request larswirzenius/contractor!17
-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 \ |