summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmgrid
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/vmgrid
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/vmgrid')
-rw-r--r--os-plugins/plugins/vmgrid/files/run-vmgrid.sh36
1 files changed, 18 insertions, 18 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