Changing or adding a hypervisor configuration in the XML configuration

The VMLoader.xml file is a file which is bundled with the VMLoader.jar. Currently has configurations for running VMware Server 2.0 and KVM. New hypervisors can be added by providing a detection-command which, if successful, can run the commands it is associated with its most specific configuration. These commands must be build with the predefined keywords listed below.

Keyword Description
${imagename} All occurrences will be replaced by the specific platform name.
${default} The platform which will be used unless there is a specific platform configuration available.
${username} Will be replaced with the user name specified on the local password file on the server. If no file is provided or available in the XML configuration inside the VMLoader.jar - then the field will be empty.
${password} Will be replaced with the password specified on the local password file on the server. If no file is provided or available in the XML configuration inside the VMLoader.jar - then the field will be empty.
${path} The absolute path of the current directory will be inserted.

The phases "download", "convert", "launch" and "stop" is launched in this sequence through the lifecycle of the VM. The keyword, f. ex ${imagename}, is replaced with the correct string during runtime.

Example

The following VMLoader XML element is for registering a virtual machine in VMware Server 2.0:

<convert command="vmrun -T server -h https://127.0.0.1:8333/sdk -u ${username} -p ${password} register [] ${path}/${imagename}/${imagename}.vmx"/>

Which during launch of the platform "WN_base_SLC4_x86_64" is transformed to:

vmrun -T server -h https://127.0.0.1:8333/sdk -u ovalense -p passwordfromfile register [] /home/ovalense/WN_base_SLC4_x86_64/WN_base_SLC4_x86_64.vmx

In order to run this command manually in the terminal:

vmrun -T server -h https://127.0.0.1:8333/sdk -u ovalense -p writtenpassword register "[] /home/ovalense/WN_base_SLC4_x86_64/WN_base_SLC4_x86_64.vmx"

XML elements and attributes

Element Attribute Description
<bootstrapper>
eticsserver The ETICS server which will be tested for http connectivity during execution of the VMLoader.
maxvmloaderinstances The maximum number of allowed VMLoader instances allowed on this single worker node.
<detect>
priority Will arrange the <hypervisor> elements according to its priority given by this detection.
hypervisor Must correspond to the name-attribute in a <hypervisor> element.
version Must correspond to the version-attribute in a <hypervisor> element.
command The command to run, must return exit code zero to be used as a valid detection.
<hypervisor>
name Must correspond to the hypervisor-attribute in a <detect> element.
version Must correspond to the version-attribute in a <detect> element.
<virtualmachine>
name Must correspond to a platform name according to the virtual machine naming convention. The ${default} keyword can be used only here. In order to use this keyword all files needed by the hypervisor must follow the ${imagename}.xxx.
exec Specifies which command that will be used to execute the user-defined job inside the virtual machine.
shutdown Specifies which command that will be used to shut down the virtual machine from inside the virtual machine.
killvmon The VMLoader will listen for this text to know when the virtual machine is has shut down.
diskspacerequirement This is the lower limit for the available disk space on a worker node, otherwise the VMLoader will exit with error code 1.
memoryrequirement This is the lower limit for the available memory on a worker node, otherwise the VMLoader will exit with error code 2.
operatingsystem Affects how the user-defined job is executed inside the virtual machine, the only two options is "unix" and "nt".
<download>
command The command that will be run on the worker node to download a virtual machine file. Preferably a command that does not produce console output.
location The URL location of the file, except the file name.
file The name of the file and its extension.
<convert>
command The command that will be run on the worker node to convert or perform any action needed before the launch.
<launch>
ownthread Important: This attribute is for hypervisors that need to run the launch process in its own thread. Assumes VMware and defaults to "false". Set "true" when using KVM or Xen!
command The final command that causes the virtual machine to start and output to the Console.log in the virtual machine folder on the worker node. Only one launch is allowed!
<stop>
command The command that can stop the virtual machine if it is not able to be shut down by it self, experiences an error or fails to write to the Console.log within a time-out period.

A complete configuration example

Example

<?xml version="1.0" encoding="UTF-8"?>
<bootstrapper eticsserver="http://etics.cern.ch:80" maxvmloaderinstances="3">
    <detect priority="1" hypervisor="vmware" version="2.0" command="vmware -v"/>

    <hypervisor name="vmware" version="2.0">
        <virtualmachine name="${default}" exec="sh" shutdown="shutdown -h now" killvmon="acpi_power_off called" diskrequirement="8000" memoryrequirement="1024" operatingsystem="unix">
            <download command="wget -qc" location="http://pcvmvalen/${imagename}/" file="${imagename}.vmdk"/>
            <download command="wget -qc" location="http://pcvmvalen/${imagename}/" file="${imagename}.vmx"/>
            <convert command="vmrun -T server -h https://127.0.0.1:8333/sdk -u ${username} -p ${password} register [] ${path}/${imagename}/${imagename}.vmx"/>
            <launch command="vmrun -T server -h https://127.0.0.1:8333/sdk -u ${username} -p ${password} start [] ${path}/${imagename}/${imagename}.vmx"/>
            <stop command="vmrun -T server -h https://127.0.0.1:8333/sdk -u ${username} -p ${password} unregister [] ${path}/${imagename}/${imagename}.vmx"/>
        </virtualmachine>
    </hypervisor>
</bootstrapper>

-- OeyvindValenSendstad - 31 Jul 2009

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r5 - 2009-08-04 - OeyvindValenSendstad
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    ETICS All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback