summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmware/files/run-virt.include
diff options
context:
space:
mode:
authorMichael Janczyk2010-04-11 23:08:47 +0200
committerMichael Janczyk2010-04-11 23:08:47 +0200
commiteec193967f7aca562f7d99eaf5d6177f08e9a99e (patch)
tree34bd6d650c2edc705f67769939a58c646492d017 /os-plugins/plugins/vmware/files/run-virt.include
parentqemukvm network configuration (diff)
downloadcore-eec193967f7aca562f7d99eaf5d6177f08e9a99e.tar.gz
core-eec193967f7aca562f7d99eaf5d6177f08e9a99e.tar.xz
core-eec193967f7aca562f7d99eaf5d6177f08e9a99e.zip
virtualization plugin, now with calculation of mem, run-vmgrid and run-virt uses it
Diffstat (limited to 'os-plugins/plugins/vmware/files/run-virt.include')
-rw-r--r--os-plugins/plugins/vmware/files/run-virt.include65
1 files changed, 35 insertions, 30 deletions
diff --git a/os-plugins/plugins/vmware/files/run-virt.include b/os-plugins/plugins/vmware/files/run-virt.include
index dfd07a89..8b91275a 100644
--- a/os-plugins/plugins/vmware/files/run-virt.include
+++ b/os-plugins/plugins/vmware/files/run-virt.include
@@ -301,36 +301,40 @@ case "$parallel" in
esac
# adjust memory available for vmware guests
-case "$vmversion" in
- 2.*)
- permem=30
- ;;
- 3.*)
- permem=25
- ;;
-esac
-if [ "${totalmem}" -ge "2500" ]; then
- permem=40
-fi
-# check if /tmp is on harddisk
-if grep -qe "/dev/.* /tmp " /proc/mounts ; then
- permem=60
- id44="1"
- # Hack, if more than 2,5G RAM use 40% of Ram and write vmem into Ram as well
- # (40% vmware | 40% confdir(vmem...) | 20% host
- # VMplayer 2+ issue
+if [ -n "${forcemem}" ]; then
+ mem="${forcemem}"
+else
+ case "$vmversion" in
+ 2.*)
+ permem=30
+ ;;
+ 3.*)
+ permem=25
+ ;;
+ esac
if [ "${totalmem}" -ge "2500" ]; then
permem=40
- confdir=/dev/shm/vmware/$USER
- conffile=${confdir}/run-vmware.conf
- mkdir -p /dev/shm/vmware/$USER
fi
-fi
-mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4)
-if [ "${id44}" = "1" ]; then
- memhost=$(expr ${totalmem} - ${mem})
-else
- memhost=$(expr ${totalmem} - ${mem} - ${mem})
+ # check if /tmp is on harddisk
+ if grep -qe "/dev/.* /tmp " /proc/mounts ; then
+ permem=60
+ id44="1"
+ # Hack, if more than 2,5G RAM use 40% of Ram and write vmem into Ram as well
+ # (40% vmware | 40% confdir(vmem...) | 20% host
+ # VMplayer 2+ issue
+ if [ "${totalmem}" -ge "2500" ]; then
+ permem=40
+ confdir=/dev/shm/vmware/$USER
+ conffile=${confdir}/run-vmware.conf
+ mkdir -p /dev/shm/vmware/$USER
+ fi
+ fi
+ mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4)
+ if [ "${id44}" = "1" ]; then
+ hostmem=$(expr ${totalmem} - ${mem})
+ else
+ hostmem=$(expr ${totalmem} - ${mem} - ${mem})
+ fi
fi
# check if ide/scsi and hwver of image
@@ -397,8 +401,8 @@ writelog "# File created by $0 (VMversion ${vmversion})\n# on $(date)\n"
writelog "Starting with non-persistent mode ...\n"
# check memory range
-if [ "${mem}" -lt "256" ] || [ "${memhost}" -lt "256" ]; then
- writelog "\tMemory out of range: ${mem} MB (guest) / ${memhost} MB (host)!"
+if [ "${mem}" -lt "256" ] || [ "${hostmem}" -lt "256" ]; then
+ writelog "\tMemory out of range: ${mem} MB (guest) / ${hostmem} MB (host)!"
writelog "\tMin. 256 MB for host and guest!"
exit 1
fi
@@ -420,7 +424,8 @@ if [ -n "${network_card}" ]; then
writelog "\tNet Adaptor:\t${network_card}"
fi
writelog "\tMem:\t\t${mem} MB"
-writelog "\tHostmem:\t${memhost} MB"
+# echo nur wenn hostmem gesetzt
+[ -n "${hostmem}" ] && writelog "\tHostmem:\t${hostmem} MB"
writelog "\tMax. res.:\t${xres}x${yres}"
writelog "\tCD-ROM1:\t${cdrom0}"
writelog "\tCD-ROM2:\t${cdrom1}"