summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorSimon Rettberg2013-11-20 17:13:23 +0100
committerSimon Rettberg2013-11-20 17:13:23 +0100
commitf0c7869833bb949e5af2a8c5f70c6d836414c97e (patch)
treeb61a48b895d4fbe12628645c6ace427ac45a2eda /remote
parent[rfs-stage32] Add delay when stage4 fails before next try (diff)
downloadtm-scripts-f0c7869833bb949e5af2a8c5f70c6d836414c97e.tar.gz
tm-scripts-f0c7869833bb949e5af2a8c5f70c6d836414c97e.tar.xz
tm-scripts-f0c7869833bb949e5af2a8c5f70c6d836414c97e.zip
[vmchooser] run-virt: dnbd3 compatibility
Diffstat (limited to 'remote')
-rwxr-xr-xremote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt19
1 files changed, 13 insertions, 6 deletions
diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
index 4396ffaa..eb284192 100755
--- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
+++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
@@ -244,11 +244,6 @@ else
vmpath="${imgpath}/${imgname}"
fi
-# Check if virtual machine container file exists
-if ! [ -e "${vmpath}" ]; then
- writelog "Virtual machine image ${vmpath} not found!"
- exit 1
-fi
# Name of the virt machine, sed because of Windows formatting
vm_name=$(grep -o 'short_description param=.*"' "${xmlfile}" \
@@ -481,6 +476,7 @@ if [ -n "$SLX_DNBD3_SERVERS" -o -n "$SLX_DNBD3_PRIO_SERVERS" ] && [ "x$SLX_VM_DN
vm_revision=$(cat "/sys/block/${dnbd3#/dev/}/net/rid")
writelog "DNBD3: $vm_diskfile on $dnbd3 with rid $vm_revision"
vm_diskfile="$dnbd3"
+ vmpath="$vm_diskfile"
break
fi
done
@@ -491,7 +487,18 @@ if [ -n "$SLX_DNBD3_SERVERS" -o -n "$SLX_DNBD3_PRIO_SERVERS" ] && [ "x$SLX_VM_DN
else
writelog "Won't use dnbd3 as no servers are given in config"
fi
-[ -z "$vm_diskfile" ] && vm_diskfile="$vmpath"
+
+if [ -z "$vm_diskfile" ]; then
+ vmpath=$(ls "${vmpath}.r"* | grep -E '\.r[0-9]+$' | sort --version-sort | tail -1)
+ vm_diskfile="$vmpath"
+fi
+
+# Check if virtual machine container file exists
+if ! [ -e "${vmpath}" ]; then
+ writelog "Virtual machine image ${vmpath} not found!"
+ exit 1
+fi
+
writelog "Used diskfile: $vm_diskfile"
# Get all virtual machine specific stuff from the respective include file