From eec193967f7aca562f7d99eaf5d6177f08e9a99e Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Sun, 11 Apr 2010 23:08:47 +0200 Subject: virtualization plugin, now with calculation of mem, run-vmgrid and run-virt uses it --- os-plugins/plugins/vmchooser/files/run-virt.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'os-plugins/plugins/vmchooser/files/run-virt.sh') diff --git a/os-plugins/plugins/vmchooser/files/run-virt.sh b/os-plugins/plugins/vmchooser/files/run-virt.sh index adfc737e..771ebef4 100644 --- a/os-plugins/plugins/vmchooser/files/run-virt.sh +++ b/os-plugins/plugins/vmchooser/files/run-virt.sh @@ -121,22 +121,21 @@ cpu_cores="${cpu_cores}" # check for CPU virtualization flags -# get total amount of memory installed in your machine -totalmem=$(expr $(grep -i "memtotal" /proc/meminfo | awk '{print $2}') / 1024) +# total amount of memory defined in stage 3 permem=60 +# get a result which can be divided through 4 mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4) +[ -n "${mainvirtmem}" ] && forcemem=$(expr ${mainvirtmem} / 4 \* 4) # configuring ethernet mac address: first 3 bytes are fixed (00:50:56) # 4th byte is the VM-ID (0D) # 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=$(echo ${machostaddr} | awk -F ":" '{print $(NF-1)":"$NF}') macaddr=$(echo "${macguestpart}:${machostpart}" | tr [a-z] [A-Z]) #TODO: remove when vmware modified -mac=$(/sbin/ifconfig eth0 | grep eth0 | sed -e "s/ //g" \ - | awk -F ":" '{print $(NF-1)":"$NF}') +mac=${machostpart} # virtual fd/cd/dvd and drive devices, floppy b: for configuration # if $floppy_0 from run-virt.include set then fdtest="TRUE" -- cgit v1.2.3-55-g7522