summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os-plugins/plugins/vmchooser/files/run-virt.sh2
-rw-r--r--os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh11
-rw-r--r--os-plugins/plugins/vmgrid/files/run-vmgrid.sh37
-rw-r--r--os-plugins/plugins/vmgrid/files/vmgrid2
-rw-r--r--os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh11
5 files changed, 50 insertions, 13 deletions
diff --git a/os-plugins/plugins/vmchooser/files/run-virt.sh b/os-plugins/plugins/vmchooser/files/run-virt.sh
index 771ebef4..df2a7404 100644
--- a/os-plugins/plugins/vmchooser/files/run-virt.sh
+++ b/os-plugins/plugins/vmchooser/files/run-virt.sh
@@ -132,7 +132,7 @@ mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4)
# last two bytes are taken from the bridge of the host
# define one MAC per guest
macguestpart="00:50:56:${VM_ID}"
-machostpart=$(echo ${machostaddr} | awk -F ":" '{print $(NF-1)":"$NF}')
+machostpart=$(echo ${hostmacaddr} | awk -F ":" '{print $(NF-1)":"$NF}')
macaddr=$(echo "${macguestpart}:${machostpart}" | tr [a-z] [A-Z])
#TODO: remove when vmware modified
mac=${machostpart}
diff --git a/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh b/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh
index 37576331..23095abf 100644
--- a/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh
+++ b/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh
@@ -109,7 +109,11 @@ EOF
fi
# write mac
- echo "machostaddr=${macaddr}" >> ${PLUGINCONFDIR}/virtualization.conf
+ echo "hostmacaddr=${macaddr}" >> ${PLUGINCONFDIR}/virtualization.conf
+ # ip addr
+ echo "hostip=${clientip}" >> ${PLUGINCONFDIR}/virtualization.conf
+ # hostname
+ echo "hostname=${host_name}" >> ${PLUGINCONFDIR}/virtualization.conf
# get further hw information
waitfor /etc/hwinfo.cdrom
@@ -126,6 +130,11 @@ EOF
j=$(expr $j + 1)
done
+ # copy host information to rwshare of vmgrid plugin
+ if [ "x${vmgrid_active}" = "x1" ]; then
+ cp ${PLUGINCONFDIR}/virtualization.conf ${vmgrid_rwmnt}/host.conf
+ fi
+
# finished ...
[ $DEBUGLEVEL -gt 0 ] \
&& echo "ok"
diff --git a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh
index 9e3cbf0a..376e8182 100644
--- a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh
+++ b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh
@@ -64,13 +64,14 @@ cleanexit () {
### Get XML file and dir
################################################################################
-# check if mem or graphical mode set
+# check if mem, nice or graphical mode set
headless=1
+unice=19
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
echo -e "Usage: run-vmgrid.sh [-g] [--mem <memory size in MB>] \c"
- echo -e "[/path/]filename[.xml]"
+ echo -e "[--nice <nice level>] [/path/]filename[.xml]"
exit
;;
-g)
@@ -78,8 +79,24 @@ while [ $# -gt 0 ]; do
;;
--mem)
# get a result which can be divided through 4
- forcemem=$2
- echo $2 | grep -q '[1-9][0-9]\{2,3\}$' && forcemem=$(expr $2 / 4 \* 4)
+ if echo $2 | grep -qE \
+ '^[2-9][0-9][0-9]$|^[1-9][0-9][0-9][0-9]$|^1[0-9][0-9][0-9][0-9]$';
+ then
+ forcemem=$(expr $2 / 4 \* 4)
+ else
+ echo "memory $2 not supported (200-19999)!"
+ exit 1
+ fi
+ shift
+ ;;
+ --nice)
+ # set nice level
+ if echo $2 | grep -qE '^-[1-9]$|-1[0-9]$|^-20$|^[0-9]$|^1[0-9]$'; then
+ unice=$2
+ else
+ echo "nice level $2 does not exist!"
+ exit 1
+ fi
shift
;;
*)
@@ -350,7 +367,7 @@ mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4)
# last two bytes are taken from the bridge of the host
# define one MAC per guest
macguestpart="00:50:56:${VM_ID}"
-machostpart=$(echo ${machostaddr} | awk -F ":" '{print $(NF-1)":"$NF}')
+machostpart=$(echo ${hostmacaddr} | awk -F ":" '{print $(NF-1)":"$NF}')
macaddr=$(echo "${macguestpart}:${machostpart}" | tr [a-z] [A-Z])
# ide is expected default, test for the virtual disk image type should
@@ -398,12 +415,14 @@ if [ ${headless} -eq 0 ]; then
writelog "Grapical mode not available, exiting!"
cleanexit 1
fi
- writelog "Starting ${vmgrid_virt} in graphical mode..."
- ${VIRTCMD} ${VIRTCMDOPTS} 2>/dev/null
+ writelog "Starting ${vmgrid_virt} in graphical mode /w nice level ${unice}..."
+ # start /w low nice level
+ nice -n ${unice} ${VIRTCMD} ${VIRTCMDOPTS} 2>/dev/null
# start headless
elif [ -n "${VIRTCMDHL}" ]; then
- writelog "Starting ${vmgrid_virt} in headless mode..."
- ${VIRTCMDHL} ${VIRTCMDOPTSHL} 2>/dev/null
+ writelog "Starting ${vmgrid_virt} in headless mode /w nice level ${unice}..."
+ # start /w low nice level
+ nice -n ${unice} ${VIRTCMDHL} ${VIRTCMDOPTSHL} 2>/dev/null
else
writelog "${vmgrid_virt}: No headless mode defined, exiting!"
cleanexit 1
diff --git a/os-plugins/plugins/vmgrid/files/vmgrid b/os-plugins/plugins/vmgrid/files/vmgrid
index 2ddfc5a0..9450ecf7 100644
--- a/os-plugins/plugins/vmgrid/files/vmgrid
+++ b/os-plugins/plugins/vmgrid/files/vmgrid
@@ -25,7 +25,7 @@
if [ -n "$1" ]; then
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo -e "Usage: vmgrid [[-g] [--mem <memory size in MB>] \c"
- echo -e "[/path/]filename[.xml]]"
+ echo -e "[--nice <nice level>] [/path/]filename[.xml]]"
exit 0
else
echo "Starting run-vmgrid.sh with options '$@'"
diff --git a/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh b/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh
index 37576331..23095abf 100644
--- a/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh
+++ b/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh
@@ -109,7 +109,11 @@ EOF
fi
# write mac
- echo "machostaddr=${macaddr}" >> ${PLUGINCONFDIR}/virtualization.conf
+ echo "hostmacaddr=${macaddr}" >> ${PLUGINCONFDIR}/virtualization.conf
+ # ip addr
+ echo "hostip=${clientip}" >> ${PLUGINCONFDIR}/virtualization.conf
+ # hostname
+ echo "hostname=${host_name}" >> ${PLUGINCONFDIR}/virtualization.conf
# get further hw information
waitfor /etc/hwinfo.cdrom
@@ -126,6 +130,11 @@ EOF
j=$(expr $j + 1)
done
+ # copy host information to rwshare of vmgrid plugin
+ if [ "x${vmgrid_active}" = "x1" ]; then
+ cp ${PLUGINCONFDIR}/virtualization.conf ${vmgrid_rwmnt}/host.conf
+ fi
+
# finished ...
[ $DEBUGLEVEL -gt 0 ] \
&& echo "ok"