diff options
author | Michael Janczyk | 2010-04-20 20:44:28 +0200 |
---|---|---|
committer | Michael Janczyk | 2010-04-20 20:44:28 +0200 |
commit | bdf81fac4346f25eb11ce4834afc5d918a6f92d1 (patch) | |
tree | b8ebafb5fdb32aa77dfe43be3b85eb11c450d373 /os-plugins | |
parent | Merge branch 'master' into vmgrid (diff) | |
download | core-bdf81fac4346f25eb11ce4834afc5d918a6f92d1.tar.gz core-bdf81fac4346f25eb11ce4834afc5d918a6f92d1.tar.xz core-bdf81fac4346f25eb11ce4834afc5d918a6f92d1.zip |
now different port forwards can be submitted via xml, to be tested
Diffstat (limited to 'os-plugins')
5 files changed, 38 insertions, 19 deletions
diff --git a/os-plugins/plugins/virtualbox/files/run-virt.include b/os-plugins/plugins/virtualbox/files/run-virt.include index b2c55c0d..119b1e16 100644 --- a/os-plugins/plugins/virtualbox/files/run-virt.include +++ b/os-plugins/plugins/virtualbox/files/run-virt.include @@ -340,19 +340,21 @@ if [ ${diskless} -eq 1 ]; then sed -i "/<!-- PLEASE DO NOT REMOVE THIS COMMENT!!! -->/d" ${machconfig} fi -# add ssh port if Linux26* and NAT -if echo "${vmostype}" | grep -q "Linux26" && [ "${network_kind}" = "NAT" ]; then - vmsshport="220${VM_ID}" - extradataitem='<ExtraDataItem name="VBoxInternal/Devices' \ - extradataitem="${extradataitem}/${network_card}/0/LUN#0/Config/ssh/" - extradataguestport='GuestPort" value="22"/>' - extradatahostport="HostPort\" value=\"${vmsshport}\"/>" - extradataprotocol='Protocol" value="TCP"/>' - sed -i "s,</ExtraData>, ${extradataitem}${extradataguestport}\n\ - ${extradataitem}${extradatahostport}\n\ - ${extradataitem}${extradataprotocol}\n\ - </ExtraData>," "${machconfig}" - writelog "\tGuest SSH port:\t\t${vmsshport}" +# define redirects +if [ -n "${redirects}" ]; then + (( i=1 )) + while [ ${i} -le ${redirects} ]; do + extradataitem='<ExtraDataItem name="VBoxInternal/Devices' + extradataitem="${extradataitem}/${network_card}/0/LUN#0/Config" + extradataitem="${extradataitem}/${redirect_name[$i]}/" + extradataprotocol="Protocol\" value=\"${redirect_proto[$i]}\"/>" + extradatahostport="HostPort\" value=\"${redirect_hport[$i]}\"/>" + extradataguestport="GuestPort\" value=\"${redirect_gport[$i]}\"/>" + sed -i "s,</ExtraData>, ${extradataitem}${extradataguestport}\n\ + ${extradataitem}${extradatahostport}\n\ + ${extradataitem}${extradataprotocol}\n\ + </ExtraData>," "${machconfig}" + writelog "\tGuest ${redirect_name[$i]} port:\t\t${redirect_hport[$i]}" fi ################################################################################ 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 400075cd..a1da2e63 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 @@ -30,7 +30,7 @@ active=0 [ ${vmgrid_active} -ne 0 ] && active=1 [ $DEBUGLEVEL -gt 0 ] \ - && echo -e "Executing the virtual 'virtualization' plugin ... \c" + && echo -e "Executing the 'virtualization' plugin ... \c" if [ ${active} -ne 0 ] ; then diff --git a/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm b/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm index 401a2151..c3542274 100644 --- a/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm +++ b/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm @@ -72,9 +72,9 @@ sub getAttrInfo description => unshiftHereDoc(<<' End-of-Here'), which virtualization technique schould be used? End-of-Here - content_regex => qr{^(vmware|virtualbox|qemukvm|xen)$}, + content_regex => qr{^(virtualbox|qemukvm|xen)$}, #openvz|vserver - content_descr => 'vmware, virtualbox, qemukvm, xen', + content_descr => 'virtualbox, qemukvm, xen', #openvz, vserver default => undef, }, diff --git a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh index a684310b..4fdd4af0 100644 --- a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh +++ b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh @@ -289,11 +289,28 @@ vmostype=$(grep -io '<os param=.*"' ${xmlfile} | awk -F '"' '{ print $2 }' \ | tr [A-Z] [a-z]) # definition of the networking the client system is connected to -network_kind=$(grep -io 'network param=.*"' ${xmlfile} \ +network_kind=$(grep -io '<network param=.*"' ${xmlfile} \ | awk -F '"' '{ print $2 }' | tr [A-Z] [a-z]) -network_card=$(grep -io 'netcard param=.*"' ${xmlfile} \ +network_card=$(grep -io '<netcard param=.*"' ${xmlfile} \ | awk -F '"' '{ print $2 }'| tr [A-Z] [a-z]) +# define redirects +redirects=$(grep -ic '<redirect name=.*"' ${xmlfile}) +[ -z "${redirects}" ] && redirects=0 +(( i=1 )) +while [ ${i} -le ${redirects} ]; do + # get only the $i-th line + redirect_name[$i]=$(grep -m ${i} -io '<redirect.*' ${xmlfile} | tail -n 1 \ + | grep -o "name=\".*" | awk -F '"' '{ print $2 }') + redirect_proto[$i]=$(grep -m ${i} -io '<redirect.*' ${xmlfile} | tail -n 1 \ + | grep -o "proto=\".*" | awk -F '"' '{ print $2 }') + redirect_hport[$i]=$(grep -m ${i} -io '<redirect.*' ${xmlfile} | tail -n 1 \ + | grep -o "hostport=\".*" | awk -F '"' '{ print $2 }') + redirect_gport[$i]=$(grep -m ${i} -io '<redirect.*' ${xmlfile} | tail -n 1 \ + | grep -o "guestport=\".*" | awk -F '"' '{ print $2 }') + (( i=$i+1 )) +done + writelog "\tVirtualization:\t\t$xmlvirt" writelog "\tVM name:\t\t$vm_name" writelog "\tVM short name:\t\t$vm_shortname" 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 400075cd..a1da2e63 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 @@ -30,7 +30,7 @@ active=0 [ ${vmgrid_active} -ne 0 ] && active=1 [ $DEBUGLEVEL -gt 0 ] \ - && echo -e "Executing the virtual 'virtualization' plugin ... \c" + && echo -e "Executing the 'virtualization' plugin ... \c" if [ ${active} -ne 0 ] ; then |