From 1f031fbafab207fe0879217ae9215caea783ed00 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Wed, 24 Mar 2010 20:01:46 +0100 Subject: new run-virt.include for xen plugin. qemukvm modules now loaded via runlevelscript qemukvm, script added to sudoers as well. better ideas? --- os-plugins/plugins/vmgrid/files/run-vmgrid.sh | 36 ++++++++++++++++----------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'os-plugins/plugins/vmgrid') diff --git a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh index 8d199ccf..ce707830 100644 --- a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh +++ b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh @@ -131,10 +131,10 @@ writelog "Starting configuration..." writelog "\tVM-ID:\t\t\t${VM_ID}" writelog "\tLogfile:\t\t${OPENSLX_DEFAULT_LOGDIR}/run-vmgrid.${USER}.$$.log" writelog "\t$(df -h | grep " /tmp$" | awk '{print $2}') \c" -writelog "/tmp info:\t\t$(grep "/tmp " /proc/mounts | sed -e "s,/tmp ,,")" +writelog "\t/tmp info:\t\t$(grep "/tmp " /proc/mounts) $(df -h | \ + grep " /tmp$" | awk '{print $2}')" writelog "\tVM XML dir:\t\t${vmgrid_xmlpath}" writelog "\tVM Image dir:\t\t${vmgrid_imgpath}" -writelog "VM config:" if ! grep '/dev/null 2>&1; then writelog \ @@ -143,13 +143,18 @@ if ! grep '/dev/null 2>&1; then fi writelog "\tXML file:\t\t$xmlfile" +writelog "VM config:" -imgpath=${vmgrid_imgpath} - -# name of the virt image of dir -imgname=$(grep -io 'image_name param=.*"' ${xmlfile} | sed -e "s/&.*;/; /g" | \ - awk -F '"' '{ print $2 }') -# full path +# name of the virt image or dir +imgname=$(grep -io '/dev/null | grep '/' >/dev/null 2>&1; then + imgpath=$(dirname ${imgname}) + imgname=$(basename ${imgname}) +else + imgpath=${vmgrid_imgpath} +fi +# set default v path vmpath=${imgpath}/${imgname} # check if virtual machine container file exists @@ -163,16 +168,17 @@ writelog "\tVM file/dir:\t\t$vmpath" # name of the virt machine, sed because of Windows formatting vm_name=$(grep -o 'short_description param=.*"' ${xmlfile} | \ sed -e "s/&.*;/; /g" | awk -F '"' '{print $2}') +# if ${vm_name} not defined use ${imgname} +vm_name=${vm_name:-"${imgname%.*}"} +# define vm_shortname since vm_name can be very long +vm_shortname=$(echo ${imgname%.*} | sed -e "s, ,-,g") +# vm_name = displayname, define for old scripts +displayname=${vm_name} # is there an additional configuration provided? additional_config=$(grep -o 'additional_config param=.*"' ${xmlfile} | \ sed -e "s/&.*;/; /g" | awk -F '"' '{print $2}') -# if ${vm_name} not defined use ${imgname} -vm_name=${vm_name:-"${imgname%.*}"} -displayname=${vm_name} -# remove blanks - # image is for the following virtual machine xmlvirt=$(grep -o 'virtualmachine param=.*"' ${xmlfile} | \ sed -e "s/&.*;/; /g" | awk -F '"' '{print $2}') @@ -231,8 +237,8 @@ network_card=$(grep -io 'netcard param=.*"' ${xmlfile} | \ awk -F '"' '{ print $2 }') writelog "\tVirtualization:\t\t$xmlvirt" -writelog "\tVM Name:\t\t$vm_name" -writelog "\tVM Displayname:\t\t$displayname" +writelog "\tVM name:\t\t$vm_name" +writelog "\tVM short name:\t\t$vm_shortname" ############################################################################### ### Declaration of default variables -- cgit v1.2.3-55-g7522