README

Brahms Distributed Virtual Machine

1/12/2005
Copyright (c) 1998-2005 NASA Ames Research Center. All Rights Reserved.

Table of Contents:

I. Installation Notes
II. Setup Notes
III. Starting the Server Components
IV. Running a Distributed Brahms Model
V. Trouble Shooting
VI. Contacting the Brahms development team for Technical Support

I. Installation Notes

After you have installed Brahms Professional Agent 1.0 beta 6 you will find a Server directory that contains the server components necessary to run the distributed virtual machine. The server components consists of Corba, used for the naming and lookup service and transport layer and KAoS used to provide naming and directory services. For the server components batch/script files are generated and installed in the Server directory. The Server directory contains the setenvironment batch/script file that sets the necessary environment variables for the server components and distributed virtual machine. For the distributed virtual machine also a separate batch/script file is created named dbvm in the ProfessionalAgent directory. This batch file sets up the environment and starts the virtual machine. This script file should be used as an example for writing a script file to start your own virtual machine. Multiple virtual machines in a distributed environment will require slightly different settings in their script file. This is discussed in more detail later in this document. It is not possible to run the virtual machine in distributed mode without first setting the server environment using Server\setenvironment(.bat/.rc)

To be able to run the server components and the distributed virtual machine the machine on which the components are installed must have a (wireless) network card installed. The machine should also have a static IP address. Without a static IP address it will be necessary to update the setenvironment batch/script file whenever the IP address changes to modify the MACHINE_IP environment variable.

II. Setup Notes

During the installation of Professional Agent the setenvironment script file and a number of supporting configuration files were generated by the installer. These script files setup the environment such that the machine on which Professional Agent was installed would serve as the main server. If you use another machine to run the server components (i.e. the naming service, directory service, domain manager, servlet runner and KPAT) then you will need to modify a number of configuration files to have them point to the appropriate server before you run a virtual machine that connects to the server. Open the following files:

In each one these files you need to change the name of the host to the name of the host where the server component is running. In addition in setenvironment you will need to update the MACHINE_IP environment variable to point to the ip address of the machine on which the servlet runner and KPAT are started.

III. Starting the Server Components 

The server components need to be running on only one machine on the network to which the Brahms virtual machines/agents need to connect. To start the server components you need to go through the following steps: 

  1. Start the Corba Naming Service 
  2. Start the KAoS Directory Service
  3. Start the KAoS Domain Manager
  4. Optionally start the Brahms Agent Environment Manager

In the future we hope to simplify this startup procedure to one script. For each one of these steps an appropriate script file is present in the ProfessionalAgent/Server directory. Run the appropriate script file for each step. Under Windows 2000/XP these steps can also be found under Start/Programs/Brahms/Professional Agent.

For each component wait for the following conditions before starting the next component:

If you want to monitor the agent environments and the agents registered in each environment you will have to start the agent environment manager and enable the virtual machines to register with the agent environment manager.

IV. Running a Distributed Brahms Model

To run distributed Brahms models you need to use a customized version of the dbvm script located in the ProfessionalAgent directory. You cannot use the bvm executable file located in the bin directory. Additional environment variables need to be set up for the distributed virtual machine that will not work with the bvm application. 

To run distributed Brahms models you need to set the virtual machine's mode to the distributed mode by setting the mode flag in the vm.cfg file to 'drt' (distributed real-time). This will trigger the virtual machine to register all agents and objects with the directory service (domain manager) and will allow all agents and objects to receive communication messages using the Corba/IIOP transport layer.

If you are not running the models on the same machine as where the server components are running then you need to make sure that the server configuration files are updated to point to the appropriate host as described in section II

To distribute a model over different machines in different Brahms virtual machines you need to compile a complete model as you would normally would for Brahms models. This will generate a <model>.xml file. Copy this xml file X number of times where X is the number of machines the model will run on. Each XML file is the model loaded in one specific virtual machine on one computer system. Open each of these XML files and remove all those agents and objects that will not be running in that specific machine by removing the line with the agent/object reference. Since areas are not yet distributed you should not remove any area references! For example if you created a model 'MyModel.b' located in the directory C:\Brahms\MyModel, you will after compiling it have a file MyModel.xml. If you want to distribute this model over three machines you will need to copy this file three times and name each file:

 For each model that is run in a virtual machine you must also have the following files:

For example for MyModel1.xml you would create a dbvm script file named startMyModel1(.bat). This file is a copy of the file named dbvm(.bat) located in the ProfessionalAgent directory. Place this file in the directory C:\Brahms\MyModel. Open this file using a text editor and modify the following:

As you can see we are referencing two files we do not yet have. First create the MyModel1.cfg file by copying the vm.cfg file located in the ProfessionalAgent directory and storing it in the C:\Brahms\MyModel directory. Open that configuration file and update the library path and any other configuration settings that require updating. If you use the agent environment manager you will need to make sure that the vmname property is unique. A good value is 'brahms.vm.mymodel1'. Enable the registration with the agent environment manager by setting the aem_registration property to yes and setting the ns_host and ns_port properties to the host and port of the name service with which the agent environment manager is registered. By default these should have the same values as the values for the HOST_NAME and PORT_NUMBER environment variables in the Server/setenvironment script file. The library path in this example should read: library_path=C:\\Program Files\\Brahms\\ProfessionalAgent\\Models;C:\\Brahms\\MyModel. It is also recommended to generate a different log file for each virtual machine to make tracking problems easier. To do this modify the output_file property and have it point to a unique file, for example: C:\\Brahms\\MyModel\\Logs\\MyModel1.log. Make sure the Logs directory exists in the MyModel directory.

The last file you need to create is the file MyModel1VM.cfg. This file should be placed in the ProfessionalAgent/Server/kaos/config/corba/boot directory and should be a copy of the SampleVM.cfg file in that same directory. Open that new file in a text editor and change the name of the proxy (SampleProxy) to a unique proxy name, unique amongst all virtual machines on the network. For example 'MyModel1Proxy'. 

Do the same for the other two models MyModel2 and MyModel3. After you are done you should have the following files in your MyModel directory:

And you should have the following files in the ProfessionalAgent/Server/kaos/config/corba/boot directory:

Now start each model using the distributed virtual machine by starting its virtual machine's script. So with the above three models run 

If you run multiple models on one machine you should also update the teservice.ini file located in the ProfessionalAgent directory. Set the dated_file property to '1': 

dated_file=1 

This will cause a time stamped EventInformation.txt file to be generated for each model. Otherwise one of the virtual machines will overwrite the other's file.

If you run the Agent Monitor you should see the registered agents for each virtual machine once the virtual machine is fully started. Note that starting the virtual machines can take some time. References to remote agents need to be resolved which can sometimes take some time of the remote agent has not yet registered. 

Make sure that when you want to stop the virtual machine that you press the Stop button on the little dialog that appears for each virtual machine. This will properly deregister all the agents and objects from the directory service. Not doing so can corrupt the directory service and will cause subsequent runs to result in errors requiring all server components to be halted and restarted.

V. Trouble Shooting

If there are problems starting any of the server components you will need to verify a number of settings:

  1. Verify the host name and machine_ip properties and their values as described in the Setup Notes. Any values that are not correct should be changed.
  2. Open the Server\setenvironment script file in an editor of choice (Notepad). Make sure that all environment variables are set correctly. Make sure that the paths are all valid and make sure that the MACHINE_IP is set to the IP address of the machine running the server components.

If in your model runs you see that a model is unable to locate a remote agent it is possible that the directory service was corrupted. To fix that problem you need to quit the all processed related with steps 2-5 and restart them one by one.

VI. Contacting the Brahms project team for Technical Support 

In case you have problems with the installation or questions and problems with the use of the Brahms Composer, Agent Viewer, Compiler or Virtual Machine you can reach Technical Support at: 

E-mail: support@agentisolutions.com
www: http://www.agentisolutions.com/support/support.htm

Thank you for trying the Brahms ProfessionalAgent version 1.0 beta 6. We hope you find it useful in your modeling and agent development efforts.

Sincerely,

The Brahms Development Team