1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Added installation procedure for VMWare drivers

git-svn-id: http://svn.opennebula.org/one/trunk@513 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Constantino Vázquez Blanco 2009-05-07 13:13:54 +00:00
parent ae2bdd2584
commit 1c873e3067
7 changed files with 169 additions and 5 deletions

4
src/im_mad/vmware/one_im_vmware Normal file → Executable file
View File

@ -47,9 +47,9 @@ fi
# Execute the actual MAD
if [ -n "${ONE_MAD_DEBUG}" ]; then
exec nice -n $PRIORITY java -cp .:$CLASSPATH -Djavax.net.ssl.trustStore=$VMWARE_TRUSTORE -Xmx1024M $MAD_FILE $* 2>> $MAD_LOG_PATH
exec nice -n $PRIORITY java -cp $ONE_LOCATION/lib/mads:$CLASSPATH -Djavax.net.ssl.trustStore=$VMWARE_TRUSTORE -Xmx1024M $MAD_FILE $* 2>> $MAD_LOG_PATH
else
exec nice -n $PRIORITY java -cp .:$CLASSPATH -Djavax.net.ssl.trustStore=$VMWARE_TRUSTORE -Xmx1024M $MAD_FILE $* 2> /dev/null
exec nice -n $PRIORITY java -cp $ONE_LOCATION/lib/mads:$CLASSPATH -Djavax.net.ssl.trustStore=$VMWARE_TRUSTORE -Xmx1024M $MAD_FILE $* 2> /dev/null
fi

View File

@ -539,7 +539,69 @@ class OneVmmVmware extends Thread
continue;
}
} // if (action.equals("MIGRATE"))
} // if (action.equals("MIGRATE"))
if (action.equals("POLL"))
{
if (str_split.length < 4)
{
System.out.println("FAILURE Wrong number of arguments for POLL " +
"action. Number args = [" + str_split.length + "].");
synchronized (System.err)
{
System.err.println(action + " FAILURE " + vid_str);
continue;
}
}
else
{
vid_str = str_split[1];
hostName = str_split[2];
String vmName = str_split[3];
// First, create the checkpoint
try
{
oVM = new OperationsOverVM(arguments,hostName);
}
catch(Exception e)
{
synchronized (System.err)
{
System.err.println(action + " FAILURE " + vid_str + " Failed connection to host " +
hostName +". Reason: " + e.getMessage());
if(debug)
{
e.printStackTrace();
}
}
continue;
}
// Poll the VM
/* if(!oVM.pollVM(vmName,checkpointName))
{
synchronized (System.err)
{
System.err.println(action + " FAILURE " + vid_str + " Failed restoring VM [" +
vmName + "] in host " + destHostName);
}
}
else
{
synchronized (System.err)
{
System.err.println(action + " SUCCESS " + vid_str);
}
}*/
System.err.println(action + " SUCCESS " + vid_str + "USEDCPU=1 USEDMEMORY=256");
continue;
}
} // if (action.equals("POLL"))
} // else if (action.equals("FINALIZE"))
} // while(!fin)
} // loop

48
src/vmm_mad/vmware/Readme Normal file
View File

@ -0,0 +1,48 @@
/*
* Install instructions for VMWare OpenNebula drivers. Please note that these drivers are in an early stage,
* please submit found bugs or doubts to users@opennebula.org mailing list
*/
1. Install OpenNebula in self-contained mode (specifying the -d option in the install.sh)
2. Install the VMWare VI SDK from [1]
3. Configure the VMWare VI SDK following [2]. You should end up with a keystore containing VMWare certificates installed in the <oneadmin> home folder.
4. Install Apache Axis 1.4 [3]
5. Add all jars in $AXISHOME/lib and $SDKHOME/samples/Axis/java/lib/ to <oneadmin> CLASSPATH
6. Go to OpenNebula source code directory and navigate to src/vmm_mad/vmware. Run the install-vmware.sh script.
7. Edit $ONE_LOCATION/etc/oned.conf and enable the tm_dummy TM MAD removing the leading # from each line. Also, add the following two MADs for VMWare:
#-------------------------------------------------------------------------------
# VMWare Information Driver Manager sample configuration
#-------------------------------------------------------------------------------
IM_MAD = [
name = "im_vmware",
executable = "one_im_vmware",
arguments = "--username <esxi_username> --password <esxi_password>",
default = "im_vmware/im_vmware.conf" ]
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# VMWare Virtualization Driver Manager sample configuration
#-------------------------------------------------------------------------------
VM_MAD = [
name = "vmm_vmware",
executable = "one_vmm_vmware",
arguments = "--username <esxi_username> --password <esxi_password>",
default = "vmm_eh/vmm_eh.conf",
type = "xml" ]
#-------------------------------------------------------------------------------
8. Add ESXi hosts using the following drivers:
$ onehost add <esxi_hostname> im_vmware vmm_vmware tm_dummy
9. Create VMWare VM using the VI client. This can be created in an ESXi server and then shared among others using VMFS or (ideally) NFS. Be careful with the name of the datastore where the VMs are residing, at this stage of the VMWare drivers for OpenNebula it only supports "datastore1" for the datastore and "ha-datacenter" for the datacenter. This is hardcoded in the drivers, but also is the default installation for ESXi.
10. Create a VM template using the name used for the VM in the VI client in step 9 as the Name of the OpenNebula VM.
11. Submit using "onevm create"
--
[1] http://www.vmware.com/support/developer/vc-sdk/
[2] http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/visdk25setupguide.pdf
[3] http://ws.apache.org/axis/

View File

@ -0,0 +1,30 @@
#!/bin/bash
if [ -z "${ONE_LOCATION}" ]; then
echo "ONE_LOCATION is not defined. Don't know where to copy, aborting."
exit -1
fi
echo -n "Installing VMWare drivers."
javac OneVmmVmware.java
cp *class $ONE_LOCATION/lib/mads
cp one_vmm_vmware $ONE_LOCATION/bin
cd ../../im_mad/vmware/
javac OneImVmware.java
cp *class $ONE_LOCATION/lib/mads
cp one_im_vmware $ONE_LOCATION/bin
cd -
echo -n "."
mkdir $ONE_LOCATION/etc/im_vmware
mkdir $ONE_LOCATION/etc/vmm_vmware
cp vmm_vmware.conf vmm_vmwarerc $ONE_LOCATION/etc/vmm_vmware
cp im_vmware.conf im_vmwarerc $ONE_LOCATION/etc/im_vmware
echo "done"

View File

@ -52,9 +52,9 @@ fi
ONE_MAD_DEBUG=neno
# Execute the actual MAD
if [ -n "${ONE_MAD_DEBUG}" ]; then
exec nice -n $PRIORITY java -cp .:$CLASSPATH -Djavax.net.ssl.trustStore=$VMWARE_TRUSTORE -Ddebug=$ONE_MAD_DEBUG -Xmx1024M $MAD_FILE $* 2>> $MAD_LOG_PATH
exec nice -n $PRIORITY java -cp $ONE_LOCATION/lib/mads:$CLASSPATH -Djavax.net.ssl.trustStore=$VMWARE_TRUSTORE -Ddebug=$ONE_MAD_DEBUG -Xmx1024M $MAD_FILE $* 2>> $MAD_LOG_PATH
else
exec nice -n $PRIORITY java -cp .:$CLASSPATH -Djavax.net.ssl.trustStore=$VMWARE_TRUSTORE -Xmx1024M $MAD_FILE $* 2> /dev/null
exec nice -n $PRIORITY java -cp $ONE_LOCATION/lib/mads:$CLASSPATH -Djavax.net.ssl.trustStore=$VMWARE_TRUSTORE -Xmx1024M $MAD_FILE $* 2> /dev/null
fi

View File

View File

@ -0,0 +1,24 @@
# -------------------------------------------------------------------------- #
# Copyright 2002-2009, Distributed Systems Architecture Group, Universidad #
# Complutense de Madrid (dsa-research.org) #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
# This must point to a java keystore with appropriate certificates for accessing
# all the ESXi hosts
#VMWARE_TRUSTORE=<path_to_keystore>
# Uncomment the following line to active MAD debug
#ONE_MAD_DEBUG=1