summaryrefslogtreecommitdiffstats
path: root/src/os-plugins/plugins/vmchooser/files/run-virt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/os-plugins/plugins/vmchooser/files/run-virt.sh')
-rw-r--r--src/os-plugins/plugins/vmchooser/files/run-virt.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/os-plugins/plugins/vmchooser/files/run-virt.sh b/src/os-plugins/plugins/vmchooser/files/run-virt.sh
index f796271d..bf62b404 100644
--- a/src/os-plugins/plugins/vmchooser/files/run-virt.sh
+++ b/src/os-plugins/plugins/vmchooser/files/run-virt.sh
@@ -283,6 +283,8 @@ writelog "\tVM short name:\t\t$vm_shortname"
# VM-ID static (00)
VM_ID="00"
+# take last two digits of current pid...
+VM_ID=$(expr substr $$ $(expr ${#$} - 1) 2)
# Make sure cpu_cores is not empty
cpu_cores=${cpu_cores:-"1"}
@@ -290,6 +292,9 @@ cpu_cores=${cpu_cores:-"1"}
# Total amount of memory defined in stage 3
# TODO: Should be dependent on the setup (if diff is written to RAM ...)
permem=60
+if [ "x${VMCHOOSER_FORCE_HALF_MEM}" == "x1" ]; then
+ permem=30
+fi
# Get a result which can be divided through 4
mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4)
if [ -n "${mainvirtmem}" ]; then