Commit ca7fae37 authored by Jérome Perrin's avatar Jérome Perrin

software/kvm: use nice/ionice to run import with lower priority

parent 4a9586e7
...@@ -31,7 +31,7 @@ md5sum = 839fc16c112d3b87e2dbd2e382e326de ...@@ -31,7 +31,7 @@ md5sum = 839fc16c112d3b87e2dbd2e382e326de
[template-kvm-import] [template-kvm-import]
filename = instance-kvm-import.cfg.jinja2.in filename = instance-kvm-import.cfg.jinja2.in
md5sum = a463a5e3cd2287d275d6943c2a11b7e4 md5sum = 5540d058f7842466a1fc61bf94239b61
[template-kvm-import-script] [template-kvm-import-script]
filename = template/kvm-import.sh.jinja2 filename = template/kvm-import.sh.jinja2
......
...@@ -61,8 +61,8 @@ cronstamps = ${:etc}/cronstamps ...@@ -61,8 +61,8 @@ cronstamps = ${:etc}/cronstamps
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
url = {{ template_kvm_import }} url = {{ template_kvm_import }}
output = ${directory:bin}/${slap-parameter:namebase}-importer output = ${directory:bin}/${slap-parameter:namebase}-importer
# Resilient stack wants a "wrapper" parameter wrapper =
wrapper = ${:output} nice -19 chrt --idle 0 ionice -c3 ${:output}
context = context =
section directory directory section directory directory
raw zcat_binary {{ zcat_binary }} raw zcat_binary {{ zcat_binary }}
...@@ -77,7 +77,7 @@ input = inline:#!/bin/sh ...@@ -77,7 +77,7 @@ input = inline:#!/bin/sh
if [ ! -s "$QEMU_IMAGE" ]; then if [ ! -s "$QEMU_IMAGE" ]; then
exit 0 exit 0
fi fi
{{ qemu_location }}/bin/qemu-img check $QEMU_IMAGE nice -19 chrt --idle 0 ionice -c3 {{ qemu_location }}/bin/qemu-img check $QEMU_IMAGE
RETURN_CODE=$? RETURN_CODE=$?
if [ $RETURN_CODE -eq 0 ] || [ $RETURN_CODE -eq 3 ]; then if [ $RETURN_CODE -eq 0 ] || [ $RETURN_CODE -eq 3 ]; then
exit 0 exit 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment