summaryrefslogtreecommitdiffstats
path: root/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include
blob: 84679ebf2f2b8fee8b661cf5f7507132fcd53eaa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# -----------------------------------------------------------------------------
# Copyright (c) 2009..2012 - RZ Uni Freiburg
# Copyright (c) 2009..2013 - 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 suggestions, praise, or complaints to feedback@openslx.org
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
# run-virt.include
#    - component for vmware/player of the vmchooser plugin vmchooser-run_virt
################################################################################

################################################################################
### configuration writer functions
### This needs bash, not dash or ash! (indented HEREDOC)
################################################################################

VMWAREINCLUDEDIR=/opt/openslx/vmchooser/vmware/includes
vmostype=$(rv_clean_string "$vmostype")

# declaration of default variables for vmware
source "${VMWAREINCLUDEDIR}/set_vmware_include_variables.inc" && set_vmware_include_variables
# General global openslx config
source /opt/openslx/config

# TODO: Where to put global helper functions that could be used in several units below?
vmw_cap_hw_version() {
	[ -z "$1" ] && writelog "cap_hw_version called without parameter!" && return 1
	[ "$1" -lt "$maxhardwareversion" ] && maxhardwareversion="$1"
}

# get information from downloaded vmx
source "${VMWAREINCLUDEDIR}/parse_vmx.inc"

# determine limitations wrt RAM and CPU count of VM
source "${VMWAREINCLUDEDIR}/determine_hardware_limitations.inc"

# create file and directory structure for vmware setup
source "${VMWAREINCLUDEDIR}/create_static_directory_structure.inc"

# create preferences file ${vmhome}/preferences
source "${VMWAREINCLUDEDIR}/create_vmhome_preferences_file.inc" && create_vmhome_preferences_file

# parse the given vmx file
source "${VMWAREINCLUDEDIR}/write_final_vmx.inc"

# print summary - needs writelog() from vmchooser-run_virt
source "${VMWAREINCLUDEDIR}/log_config_summary.inc"

# For debugging
cp "$conffile" "/tmp/vmware-last-config"

# using the modified version of the wrapper script
VIRTCMD="/opt/openslx/bin/vmplayer"
VIRTCMDOPTS="${vmopt} ${conffile}"