Add new HELPER_MEMORY parameter
authorNikos Skalkotos <skalkoto@grnet.gr>
Tue, 4 Feb 2014 09:08:10 +0000 (11:08 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Tue, 4 Feb 2014 09:08:10 +0000 (11:08 +0200)
This can be used to overwrite the size of the virtual RAM that will
be given to the helper VM

snf-image-host/common.sh.in
snf-image-host/defaults.in
snf-image-host/kvm-common.sh
snf-image-host/xen-common.sh

index a16c8c7..37affab 100644 (file)
@@ -452,6 +452,7 @@ fi
 : ${HELPER_SOFT_TIMEOUT:=120}
 : ${HELPER_HARD_TIMEOUT:=5}
 : ${HELPER_USER:="nobody"}
+: ${HELPER_MEMORY:="256"}
 : ${PITHOS_DB:="sqlite:////@localstatedir@/lib/pithos/backend.db"}
 : ${PITHOS_DATA:="@localstatedir@/lib/pithos/data/"}
 : ${PROGRESS_MONITOR:="@PROGRESS_MONITOR@"}
index f99a435..596a5d7 100644 (file)
@@ -38,6 +38,9 @@
 # HELPER_USER imeddiately before starting execution of the helper VM.
 # HELPER_USER="nobody"
 
+# HELPER_MEMORY: Virtual RAM size in megabytes to be given to the helper VM.
+# HELPER_MEMORY="256"
+
 # MULTISTRAP_CONFIG: Configuration file to be used with multistrap to create
 # the rootfs of the helper image.
 # MULTISTRAP_CONFIG="@MULTISTRAP_CONFIG@"
index f73cf31..777a55e 100644 (file)
@@ -35,7 +35,7 @@ launch_helper() {
 
     $TIMEOUT -k "$HELPER_HARD_TIMEOUT" "$HELPER_SOFT_TIMEOUT" \
       kvm -runas "$HELPER_USER" -drive file="$HELPER_DIR/image",format=raw,if=virtio,readonly \
-      -drive file="$blockdev",format=raw,if=virtio,cache=none \
+      -drive file="$blockdev",format=raw,if=virtio,cache=none -m "$HELPER_MEMORY" \
       -boot c -serial stdio -serial "file:$(printf "%q" "$result_file")" \
       -serial file:>(./helper-monitor.py ${MONITOR_FD}) \
       -fda "$floppy" -vga none -nographic -parallel none -monitor null \
index 63397d6..8c35f70 100644 (file)
@@ -32,7 +32,7 @@ launch_helper() {
 
     xm create /dev/null \
       kernel="$HELPER_DIR/kernel" ramdisk="$HELPER_DIR/initrd" \
-      root="/dev/xvda1" memory="256" boot="c" vcpus=1 name="$name" \
+      root="/dev/xvda1" memory="$HELPER_MEMORY" boot="c" vcpus=1 name="$name" \
       extra="console=hvc0 hypervisor=$HYPERVISOR snf_image_activate_helper \
          ipv6.disable=1 rules_dev=/dev/xvdc ro boot=local helper_ip=10.0.0.1 \
           monitor_port=48888 init=/usr/bin/snf-image-helper" \