summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins
diff options
context:
space:
mode:
authorMichael Janczyk2010-03-31 22:44:38 +0200
committerMichael Janczyk2010-03-31 22:44:38 +0200
commitb61aa15b79765c51afc35946867e17ecc4ff8704 (patch)
tree567208b6b8e52209c277c6f37e3da5dc3cccea67 /os-plugins/plugins
parentdiskless boot + minor modifications, virtualization.conf /w freemem (diff)
downloadcore-b61aa15b79765c51afc35946867e17ecc4ff8704.tar.gz
core-b61aa15b79765c51afc35946867e17ecc4ff8704.tar.xz
core-b61aa15b79765c51afc35946867e17ecc4ff8704.zip
xen bridge change + xennet TODO: load xennet
Diffstat (limited to 'os-plugins/plugins')
-rw-r--r--os-plugins/plugins/vmgrid/files/run-vmgrid.sh36
-rw-r--r--os-plugins/plugins/xen/OpenSLX/OSPlugin/xen.pm6
-rw-r--r--os-plugins/plugins/xen/XX_xen.sh2
-rwxr-xr-xos-plugins/plugins/xen/init-hooks/20-nw-bridge-config/xen-bridge.sh42
4 files changed, 23 insertions, 63 deletions
diff --git a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh
index e1b2ffe6..4c5ecbb9 100644
--- a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh
+++ b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh
@@ -164,12 +164,12 @@ writelog "\tXML file:\t\t$xmlfile"
writelog "VM config:"
# name of the virt image or dir
-imgname=$(grep -io '<image_name param=.*"' ${xmlfile} | \
- sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')
+imgname=$(grep -io '<image_name param=.*"' ${xmlfile} \
+ | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')
# image mode
-imgmode=$(grep -io '<image_mode param=.*"' ${xmlfile} | \
- sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')
+imgmode=$(grep -io '<image_mode param=.*"' ${xmlfile} \
+ | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')
# get boot attr
boot=$(grep -io 'boot param=.*"' ${xmlfile} | awk -F '"' '{ print $2 }')
@@ -207,8 +207,8 @@ then
fi
# 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}')
+vm_name=$(grep -o 'short_description param=.*"' ${xmlfile} \
+ | sed -e "s/&.*;/; /g" | awk -F '"' '{print $2}')
# define vm_shortname since vm_name can be very long
if [ -n "${imgname}" ]; then
@@ -216,8 +216,8 @@ if [ -n "${imgname}" ]; then
vm_name=${vm_name:-"${imgname%.*}"}
vm_shortname=$(basename ${imgname%.*} | sed -e "s, ,-,g")
elif [ -n "${vm_name}" ]; then
- vm_shortname=$(echo ${vm_name} | awk '{print $1" "$2" "$3}' \
- | sed -e "s, ,-,g;s,-$,,;s,-$,,")
+ vm_shortname=$(echo ${vm_name} | awk '{print $1"-"$2"-"$3}' \
+ | sed -e "s,-$,,;s,-$,,")
else
vm_name=$(date | md5sum | awk '{print $1}')
vm_shortname=${vm_name}
@@ -230,12 +230,12 @@ displayname=${vm_name}
writelog "\tVM file/dir:\t\t$vmpath"
# is there an additional configuration provided?
-additional_config=$(grep -o 'additional_config param=.*"' ${xmlfile} | \
- sed -e "s/&.*;/; /g" | awk -F '"' '{print $2}')
+additional_config=$(grep -o 'additional_config param=.*"' ${xmlfile} \
+ | sed -e "s/&.*;/; /g" | awk -F '"' '{print $2}')
# image is for the following virtual machine
-xmlvirt=$(grep -o 'virtualmachine param=.*"' ${xmlfile} | \
- sed -e "s/&.*;/; /g" | awk -F '"' '{print $2}')
+xmlvirt=$(grep -o 'virtualmachine param=.*"' ${xmlfile} \
+ | sed -e "s/&.*;/; /g" | awk -F '"' '{print $2}')
# make a guess from the filename extension if ${xmlvirt} is empty
# (not set within the XML file)
@@ -285,10 +285,10 @@ fi
vmostype=$(grep -io '<os param=.*"' ${xmlfile} | awk -F '"' '{ print $2 }')
# definition of the networking the client system is connected to
-network_kind=$(grep -io 'network param=.*"' ${xmlfile} | \
- awk -F '"' '{ print $2 }')
-network_card=$(grep -io 'netcard param=.*"' ${xmlfile} | \
- awk -F '"' '{ print $2 }')
+network_kind=$(grep -io 'network param=.*"' ${xmlfile} \
+ | awk -F '"' '{ print $2 }')
+network_card=$(grep -io 'netcard param=.*"' ${xmlfile} \
+ | awk -F '"' '{ print $2 }')
writelog "\tVirtualization:\t\t$xmlvirt"
writelog "\tVM name:\t\t$vm_name"
@@ -318,8 +318,8 @@ 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=$($(which ifconfig) br0 | grep br0 | sed -e "s/ //g" | \
- awk -F ":" '{print $(NF-1)":"$NF}')
+machostpart=$($(which ifconfig) br0 | grep br0 | sed -e "s/ //g" \
+ | 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
diff --git a/os-plugins/plugins/xen/OpenSLX/OSPlugin/xen.pm b/os-plugins/plugins/xen/OpenSLX/OSPlugin/xen.pm
index 7ab55d4a..99993e23 100644
--- a/os-plugins/plugins/xen/OpenSLX/OSPlugin/xen.pm
+++ b/os-plugins/plugins/xen/OpenSLX/OSPlugin/xen.pm
@@ -72,8 +72,10 @@ sub suggestAdditionalKernelModules
my @suggestedModules;
- # Xen needs bridge module and netloop
- push @suggestedModules, qw( bridge netloop );
+ # Xen needs bridge module, for guests xennet and maybe xenblk
+ # earlier versions needed netloop
+ # TODO: xennet laden
+ push @suggestedModules, qw( bridge xennet xenblk );
return @suggestedModules;
}
diff --git a/os-plugins/plugins/xen/XX_xen.sh b/os-plugins/plugins/xen/XX_xen.sh
index d3620c76..610a3cfb 100644
--- a/os-plugins/plugins/xen/XX_xen.sh
+++ b/os-plugins/plugins/xen/XX_xen.sh
@@ -29,7 +29,7 @@ if [ -e ${CONFFILE} ]; then
# TODO: disable for testing purposes. suse 11.0 kills network
# rllinker "xendomains" 14 8
# rllinker "xend" 13 9
-
+ # TODO: in xen-slx start
modprobe loop max_loop=64
fi
fi
diff --git a/os-plugins/plugins/xen/init-hooks/20-nw-bridge-config/xen-bridge.sh b/os-plugins/plugins/xen/init-hooks/20-nw-bridge-config/xen-bridge.sh
deleted file mode 100755
index 8ee244b9..00000000
--- a/os-plugins/plugins/xen/init-hooks/20-nw-bridge-config/xen-bridge.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/ash
-# Copyright (c) 2009 - OpenSLX GmbH
-#
-# This program is free software distributed under the GPL version 2.
-# See http://openslx.org/COPYING
-#
-# If you have any feedback please consult http://openslx.org/feedback and
-# send your feedback to feedback@openslx.org
-#
-# General information about OpenSLX can be found at http://openslx.org
-#
-# XEN specific init hook to create a bridge on the active network interface
-#############################################################################
-
-# configure Xen bridge xenbr0 (would it be possible to make it just br0?)
-
-modprobe ${MODPRV} netloop
-local ipls
-local vifnum="0"
-local bridge="xenbr${vifnum}"
-local netdev="eth${vifnum}" # should be ${nwif}
-local pdev="p${netdev}"
-local vdev="veth${vifnum}"
-local vif0="vif0.${vifnum}"
-# fixme: that is the mac address of main ethernet device
-local mac=${macaddr}
-
-brctl addbr ${bridge}
-brctl stp ${bridge} off
-brctl setfd ${bridge} 0.000000000001
-brctl addif ${bridge} ${vif0}
-for ipls in "${netdev} name ${pdev}" "${vdev} name ${netdev}" \
- "${pdev} down arp off" "${pdev} addr fe:ff:ff:ff:ff:ff" \
- "${netdev} addr ${mac} arp on" "${bridge} up" "${vif0} up" \
- "${pdev} up" "${netdev} up"; do
- ip link set ${ipls}
-done
-brctl addif ${bridge} ${pdev}
-
-# fixme: sending back the variable to init does not work properly at the
-# moment
-nwif=${bridge}