summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJonathan Bauer2018-05-04 16:38:17 +0200
committerJonathan Bauer2018-05-04 16:38:17 +0200
commit718a68bf8060c17c602d73085bc5b2ca3a643c26 (patch)
treea2508dacf4d5e0176bcebb6802452e5f54d268e3 /core
parent[vmware*] proper quoting... (diff)
downloadmltk-718a68bf8060c17c602d73085bc5b2ca3a643c26.tar.gz
mltk-718a68bf8060c17c602d73085bc5b2ca3a643c26.tar.xz
mltk-718a68bf8060c17c602d73085bc5b2ca3a643c26.zip
[*virt*] fix vmware VM only having 1 core...
Diffstat (limited to 'core')
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc10
-rwxr-xr-xcore/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/guest_hardware_limits.inc10
-rw-r--r--core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/determine_hardware_limitations.inc2
3 files changed, 9 insertions, 13 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
index c59a82b0..19e1cb43 100644
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
@@ -13,15 +13,15 @@
# Use: 00:FF:00 for firtual machines ;)
## Functions ##
+# Import /run/hwinfo variables
+import_hwinfo() {
+ $(safesource "/run/hwinfo")
+}
# Sets the VM's hostname to the original hostname prefixed with a fixed string and its ID
set_virt_hostname() {
declare -rg HOSTNAME="virt${VM_ID}-$(hostname)"
writelog "\tVM Hostname:\t\t$HOSTNAME"
}
-set_virt_cpu() {
- # Make sure CPU_CORES is not empty
- declare -g CPU_CORES=${CPU_CORES:-"1"}
-}
# Derives the amount of memory allocated to the VM from the
# host's total memory (previously determined by systemd-run_virt_env)
set_virt_memory() {
@@ -149,7 +149,7 @@ set_serial_ports() {
## MAIN ##
call_post_source \
- set_virt_cpu \
+ import_hwinfo \
set_virt_memory \
set_virt_mac \
set_virt_hostname \
diff --git a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/guest_hardware_limits.inc b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/guest_hardware_limits.inc
index 44640710..d29fac20 100755
--- a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/guest_hardware_limits.inc
+++ b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/guest_hardware_limits.inc
@@ -104,13 +104,9 @@ set_hardware_limits() {
# TODO: FreeBSD, NetBSD, MacOS*, Solaris, Oracle, ...
esac
- # check /run/hwinfo for CORE not THREADS
- # vbox seems to only want maximum cores = number of
- # physical cores of the cpu, so use that
- if [ -e /run/hwinfo ]; then
- . /run/hwinfo
- notempty HW_CORES && CPU_CORES="$HW_CORES"
- fi
+ # use HW_CORES not HW_THREADS since virtualbox does not
+ # seem to handle hyperthreading all too well...
+ declare -g CPU_CORES="${HW_CORES:-1}"
[ "${CPU_CORES}" -gt "{MAXCORES}" ] && CPU_CORES="${MAXCORES}"
[ "${VM_MEM}" -gt "${MAXMEM}" ] && VM_MEM="${MAXMEM}"
diff --git a/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/determine_hardware_limitations.inc b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/determine_hardware_limitations.inc
index c288ed09..ce929230 100644
--- a/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/determine_hardware_limitations.inc
+++ b/core/modules/vmware12/data/opt/openslx/vmchooser/plugins/vmware/includes/determine_hardware_limitations.inc
@@ -174,7 +174,7 @@ set_vm_hardware_limits() {
MAXCORES="1"
;;
esac
-
+ declare -rg CPU_CORES="${HW_THREADS:-1}"
declare -rg HOST_CORE_COUNT="$CPU_CORES"
[ "$CPU_CORES" -gt "$MAXCORES" ] && CPU_CORES="$MAXCORES"