summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm122
1 files changed, 17 insertions, 105 deletions
diff --git a/src/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm b/src/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
index f21488d5..fdec79d6 100644
--- a/src/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
+++ b/src/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
@@ -1,4 +1,4 @@
-# Copyright (c) 2008..2013 - OpenSLX G-mbH
+# Copyright (c) 2008..2014 - OpenSLX G-mbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -43,8 +43,8 @@ sub getInfo
return {
description => unshiftHereDoc(<<' End-of-Here'),
Module for enabling services of VMware Inc. on an OpenSLX stateless
- client. This plugin might use pre-existing installations of VMware
- tools or install addional variants and versions.
+ client. This plugin uses an installation of VMware within the cloned
+ system.
End-of-Here
precedence => 70,
required => [ qw( desktop ) ],
@@ -131,14 +131,14 @@ sub getAttrInfo
applies_to_systems => 1,
applies_to_clients => 1,
description => unshiftHereDoc(<<' End-of-Here'),
- Which set of VMware binaries to use: installed (local) or provided by the
- plugin itself (vmpl1.0, vmpl2.0, vmpl2.5, vmpl3.X)?
+ Which set of VMware binaries to use: installed (local)?
+ (Only pre-installed in the clone versions will work)
End-of-Here
# only allow the supported once...
# TODO: modify if we know which of them work
#content_regex => qr{^(local|vmws(5\.5|6.0)|vmpl(1\.0|2\.0))$},
- content_regex => qr{^(local|vmpl3\.0||vmpl2\.0|vmpl1\.0|vmpl2\.5)$},
- content_descr => 'Allowed values: local, vmpl2.0',
+ content_regex => qr{^(local$},
+ content_descr => 'Allowed values: local',
#TODO: what if we don't have a local installation. default
# is still local. Someone has a clue how to test
# it and change the default value?
@@ -158,58 +158,12 @@ sub getAttrInfo
content_descr => '1 means active - 0 means inactive',
default => '1',
},
- 'vmware::vmpl2.0' => {
- applies_to_vendor_os => 1,
- applies_to_system => 0,
- applies_to_clients => 0,
- description => unshiftHereDoc(<<' End-of-Here'),
- Install and configure vmplayer v2
- End-of-Here
- content_regex => qr{^(1|0)$},
- content_descr => '1 means active - 0 means inactive',
- default => '0',
- },
- 'vmware::vmpl2.5' => {
- applies_to_vendor_os => 1,
- applies_to_system => 0,
- applies_to_clients => 0,
- description => unshiftHereDoc(<<' End-of-Here'),
- Install and configure vmplayer v2
- End-of-Here
- content_regex => qr{^(1|0)$},
- content_descr => '1 means active - 0 means inactive',
- default => '0',
- },
- 'vmware::vmpl1.0' => {
- applies_to_vendor_os => 1,
- applies_to_system => 0,
- applies_to_clients => 0,
- description => unshiftHereDoc(<<' End-of-Here'),
- Install and configure vmplayer v1
- End-of-Here
- content_regex => qr{^(1|0)$},
- content_descr => '1 means active - 0 means inactive',
- default => '0',
- },
- 'vmware::pkgpath' => {
- applies_to_vendor_os => 1,
- applies_to_system => 0,
- applies_to_clients => 0,
- description => unshiftHereDoc(<<' End-of-Here'),
- Path to VMware packages
- End-of-Here
- #TODO
- #content_regex => qr{^(1|0)$},
- content_descr => '1 means active - 0 means inactive',
- default => '/root/vmware-pkgs',
- },
# ** set of attributes for the installation of VM Workstation/Player
# versions. More than one package could be installed in parallel.
# To be matched to/triggerd by 'vmware::kind'
};
}
-
sub preInstallationPhase()
{
my $self = shift;
@@ -223,17 +177,11 @@ sub preInstallationPhase()
$self->{vendorOsPath} = $info->{'vendor-os-path'};
my $pkgpath = $self->{attrs}->{'vmware::pkgpath'};
- my $vmpl10 = $self->{attrs}->{'vmware::vmpl1.0'};
- my $vmpl20 = $self->{attrs}->{'vmware::vmpl2.0'};
- my $vmpl25 = $self->{attrs}->{'vmware::vmpl2.5'};
my $local = $self->{attrs}->{'vmware::local'};
- if ($local == 0 && $vmpl10 == 0 && $vmpl20 == 0 && $vmpl25 == 0) {
+ if ($local == 0) {
print "\n\n * At least one kind needs to get installed/activated:\n";
print " vmware::local=1 or\n";
- print " vmware::vmpl1.0=1 or\n";
- print " vmware::vmpl2.0=1\n";
- print " vmware::vmpl2.5=1\n";
print " * vmware plugin was not installed!\n\n";
exit 1;
}
@@ -279,15 +227,6 @@ sub installationPhase
if ($self->{attrs}->{'vmware::local'} == 1) {
$self->_localInstallation();
}
- if ($self->{attrs}->{'vmware::vmpl2.0'} == 1) {
- $self->_vmpl2Installation();
- }
- if ($self->{attrs}->{'vmware::vmpl1.0'} == 1) {
- $self->_vmpl1Installation();
- }
- if ($self->{attrs}->{'vmware::vmpl2.5'} == 1) {
- $self->_vmpl25Installation();
- }
## prepration for our faster wrapper script
# rename the default vmplayer script and create a link.
@@ -342,34 +281,6 @@ sub checkStage3AttrValues
);
}
- if ($vm_kind eq 'vmpl1.0' &&
- ! -d "/opt/openslx/plugin-repo/vmware/vmpl1.0/vmroot") {
- push @problems, _tr(
- "No OpenSLX installation of VMware Player 1 found or installation failed. Using it as virtual machine wouldn't work!"
- );
- }
-
- if ($vm_kind eq 'vmpl2.0' &&
- ! -d "/opt/openslx/plugin-repo/vmware/vmpl2.0/vmroot") {
- push @problems, _tr(
- "No OpenSLX installation of VMware Player 2.0 found or installation failed. Using it as virtual machine wouldn't work!"
- );
- }
-
- if ($vm_kind eq 'vmpl2.5' &&
- ! -d "/opt/openslx/plugin-repo/vmware/vmpl2.5/vmroot") {
- push @problems, _tr(
- "No OpenSLX installation of VMware Player 2.5 found or installation failed. Using it as virtual machine wouldn't work!"
- );
- }
-
- if ($vm_kind eq 'vmpl3.X' &&
- ! -d "/opt/openslx/plugin-repo/vmware/vmpl3.X/vmroot") {
- push @problems, _tr(
- "No OpenSLX installation of VMware Player 3.X found or installation failed. Using it as virtual machine wouldn't work!"
- );
- }
-
return if !@problems;
return \@problems;
@@ -416,15 +327,15 @@ sub _writeRunlevelScript
"tempdir",
"$script"
);
- $modlist = "vmnet vmmon";
+ $modlist = "vmnet vmmon ";
$script = unshiftHereDoc(<<" End-of-Here");
# VMplayer common stuff
insmod ${modpath}/vmmon.ko || return 1
insmod ${modpath}/vmnet.ko || return 1
End-of-Here
- if ($kind eq 'local3X' || $kind eq 'vmpl3.X' || $kind eq 'local4X' || $kind eq 'local5X') {
+ if ($kind eq 'local3X' || $kind eq 'local4X' || $kind eq 'local5X' || $kind eq 'local6X') {
$script .= unshiftHereDoc(<<" End-of-Here");
- # VMplayer 3.X specific stuff
+ # Newer VMplayers specific stuff
insmod ${modpath}/vmci.ko
insmod ${modpath}/vmblock.ko
insmod ${modpath}/vsock.ko
@@ -452,7 +363,7 @@ sub _writeRunlevelScript
if [ -n "\$vmnet0" ] ; then
# the path might be directly point to the plugin dir
End-of-Here
- if ($kind eq 'vmpl1.0' || $kind eq 'vmpl2.0' || $kind eq 'local10' || $kind eq 'local20') {
+ if ($kind eq 'local10' || $kind eq 'local20') {
$script .= " \$location/vmnet-bridge -d /var/run/vmnet-bridge-0.pid /dev/vmnet0 eth0\n";
} else {
$script .= " \$location/vmnet-bridge -d /var/run/vmnet-bridge-0.pid -n 0\n";
@@ -513,7 +424,7 @@ sub _writeRunlevelScript
vmnetif
End-of-Here
# start the USB arbitrator on higher VMware/player versions (3.0+)
- if ($kind eq 'vmpl3.X' || $kind eq 'local3X' || $kind eq 'local4X' || $kind eq 'local5X') {
+ if ($kind eq 'local3X' || $kind eq 'local4X' || $kind eq 'local5X' || $kind eq 'local6X') {
$script .= unshiftHereDoc(<<" End-of-Here");
vmblock
End-of-Here
@@ -550,7 +461,6 @@ sub _writeRunlevelScript
spitFile("$self->{'pluginRepositoryPath'}/vmware-slx", $runlevelscript);
}
-
# writes the wrapper script for vmware workstation and player, depending
# on the flag. If player: just player wrapper, if ws: ws+player wrapper
# usage: _writeWrapperScript("$vmpath", "$kind", "player")
@@ -723,13 +633,15 @@ sub _localInstallation
# VMplayer 2.5
} elsif ($vmversion eq "2.5" || $vmversion eq "6.5") {
$kind="local25";
- # VMplayer 3.0, 3.1, 4.X, 5.X Workstation 7.0, 7.1, 8.X, 9.X
+ # VMplayer 3.0, 3.1, 4.X, 5.X, 6.X Workstation 7.0, 7.1, 8.X, 9.X, 10.X
} elsif ($vmversion eq "3.0" || $vmversion eq "7.0" ||
$vmversion eq "3.1" || $vmversion eq "7.1") { $kind="local3X";
} elsif ($vmversion eq "4.0" || $vmversion eq "8.0") {
$kind="local4X";
} elsif ($vmversion eq "5.0" || $vmversion eq "9.0") {
$kind="local5X";
+ } elsif ($vmversion eq "6.0" || $vmversion eq "10.0") {
+ $kind="local6X";
}
# Create runlevel script depending on detected version
$self->_writeRunlevelScript("$vmpath", "$kind");
@@ -751,7 +663,7 @@ sub _localInstallation
copyFile("$pluginFilesPath/$file", "$self->{'pluginRepositoryPath'}/$kind");
}
- } # else { TODO: errorhandling if file or string doesn't exist }
+ }
## creating needed config /etc/vmware/config
$self->_writeVmwareConfigs("$kind", "$vmpath");