summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmgrid/files
diff options
context:
space:
mode:
Diffstat (limited to 'os-plugins/plugins/vmgrid/files')
-rw-r--r--os-plugins/plugins/vmgrid/files/run-vmgrid.sh42
-rw-r--r--os-plugins/plugins/vmgrid/files/vmgrid30
2 files changed, 39 insertions, 33 deletions
diff --git a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh
index 4a09f237..18e62ea0 100644
--- a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh
+++ b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh
@@ -18,23 +18,12 @@
. /etc/opt/openslx/openslx.conf
################################################################################
-### Functions used throughout the script
-################################################################################
-
-# function to write to stdout and logfile
-writelog () {
- # write to stdout
- echo -e "$1"
- # log into file
- echo -e "$1" >> ${OPENSLX_DEFAULT_LOGDIR}/run-vmgrid.${USER}.$$.log
-}
-
-################################################################################
### Define default dirs / get configs
################################################################################
PLUGINCONFROOT=${OPENSLX_DEFAULT_CONFDIR}/plugins
PLUGINCONFVMGRID=${PLUGINCONFROOT}/vmgrid
+RWSHARE=/var/opt/openslx/plugins/vmgrid/share
# include general configuration from vmgrid
[ -f ${PLUGINCONFVMGRID}/vmgrid.conf ] && \
. ${PLUGINCONFVMGRID}/vmgrid.conf
@@ -45,21 +34,36 @@ PLUGINCONFVMGRID=${PLUGINCONFROOT}/vmgrid
. ${PLUGINCONFROOT}/vmchooser/vmchooser.conf
################################################################################
+### Functions used throughout the script
+################################################################################
+
+# function to write to stdout and logfile
+mkdir -p ${RWSHARE}/var/log/openslx 2>/dev/null
+writelog () {
+ # write to stdout
+ echo -e "$1"
+ # log into file
+ echo -e "$1" >> ${OPENSLX_DEFAULT_LOGDIR}/run-vmgrid.${USER}.$$.log
+ # log into share dir, so that log is available in vm as well
+ echo -e "$1" >> ${RWSHARE}/var/log/openslx/run-vmgrid.${USER}.$$.log
+}
+
+################################################################################
### Get XML file and dir
################################################################################
# check if forcemem set
-# TODO: klappt noch nicht immer :(
if [ "$1" = "--forcemem" ]; then
forcemem=$2
- xmlfile=${3##*/}
+ xmlfile=$3
else
- xmlfile=${1##*/}
+ xmlfile=$1
fi
# absolute or relative path?
-if ls ${1} 2>/dev/null | grep '/' >/dev/null 2>&1; then
- xmlpath=$(dirname ${1})
+if ls ${xmlfile} 2>/dev/null | grep '/' >/dev/null 2>&1; then
+ xmlpath=$(dirname ${xmlfile})
+ xmlfile=$(basename ${xmlfile})
else
xmlpath=${vmgrid_xmlpath}
fi
@@ -265,8 +269,6 @@ ide="TRUE"
scsi="FALSE"
hddrv="ide"
-# TODO: vncclient IP:59001 oder Plugin?
-
# add rw share
rwshare="/var/opt/openslx/plugins/vmgrid/share"
@@ -296,7 +298,7 @@ fi
# start headless
if [ -n "${VIRTCMDHL}" ]; then
- writelog "Starting ${vmgrid_virt} head-less..."
+ writelog "Starting ${vmgrid_virt} headless..."
${VIRTCMDHL} ${VIRTCMDOPTSHL}
else
writelog "${vmgrid_virt}: No headless mode defined, exiting!"
diff --git a/os-plugins/plugins/vmgrid/files/vmgrid b/os-plugins/plugins/vmgrid/files/vmgrid
index 66291aea..7257226e 100644
--- a/os-plugins/plugins/vmgrid/files/vmgrid
+++ b/os-plugins/plugins/vmgrid/files/vmgrid
@@ -27,29 +27,18 @@ if [ -n "$1" ]; then
echo "Usage: vmgrid [[/path/]filename[.xml]]"
exit 0
else
- run-vmgrid.sh $1 &
+ run-vmgrid.sh $@ &
exit 0
fi
fi
################################################################################
-### Functions used throughout the script
-################################################################################
-
-# function to write to stdout and logfile
-writelog () {
- # write to stdout
- echo -e "$1"
- # log into file
- echo -e "$1" >> ${OPENSLX_DEFAULT_LOGDIR}/run-vmgrid.${USER}.$$.log
-}
-
-################################################################################
### Define default dirs / get configs
################################################################################
PLUGINCONFROOT=${OPENSLX_DEFAULT_CONFDIR}/plugins
PLUGINCONFDIR=${PLUGINCONFROOT}/vmgrid
+RWSHARE=/var/opt/openslx/plugins/vmgrid/share
# include general configuration from vmgrid
[ -f ${PLUGINCONFDIR}/vmgrid.conf ] && \
. ${PLUGINCONFDIR}/vmgrid.conf
@@ -58,6 +47,21 @@ PLUGINCONFDIR=${PLUGINCONFROOT}/vmgrid
. ${PLUGINCONFROOT}/vmchooser/vmchooser.conf
################################################################################
+### Functions used throughout the script
+################################################################################
+
+# function to write to stdout and logfile
+mkdir -p ${RWSHARE}/var/log/openslx 2>/dev/null
+writelog () {
+ # write to stdout
+ echo -e "$1"
+ # log into file
+ echo -e "$1" >> ${OPENSLX_DEFAULT_LOGDIR}/run-vmgrid.${USER}.$$.log
+ # log into share dir, so that log is available in vm as well
+ echo -e "$1" >> ${RWSHARE}/var/log/openslx/run-vmgrid.${USER}.$$.log
+}
+
+################################################################################
### Configure VMs for autostart and set RAM
################################################################################