.. _configuration:

Configuration
=============

Guideline
^^^^^^^^^

Please refer to README in lava-dispatcher source code::

    lava-dispatcher/lava_dispatcher/default-config/lava-dispatcher/README

Or browse on the `web page <http://bazaar.launchpad.net/~linaro-validation/lava-dispatcher/trunk/view/head:/lava_dispatcher/default-config/lava-dispatcher/README>`_

Don't forget to setup LAVA_SERVER_IP, and LAVA_PROXY if there is one proxy,
which will prompt the performance explicitly.

You can set up a squid service, refer to :ref:`proxy`

Configuration files for lava-dispatcher
=======================================

lava-dispatcher looks for files in:

 * Alongside the installation/source tree for the default values
   (i.e. this directory).

 * /srv/lava/<instance>/etc/lava-dispatcher

Each config directory can contain two files and two directories:

 * lava-dispatcher.conf

   This file defines global settings of the dispatcher.  You will
   almost certainly need to customize LAVA_SERVER_IP and LAVA_PROXY
   for your install. LAVA_PROXY could be empty if no proxy server
   available.

 * device-defaults.conf

   This file defines default values for all devices.  You probably
   won't need to customize it.

 * device-types/

   This directory contains a config file for each device type.  You
   probably won't need to customize the settings for device types that
   are already supported by lava-dispatcher, but if you are working on
   supporting a new class of device, you will need to add a file here.

 * devices/

   This directory contains a file per device that can be targeted by
   lava-dispatcher.  For the most part this file just needs to contain
   a line "device_type = <device type>", although other settings can
   be included here.  You will definitely need to tell lava-dispatcher
   about the devices you have!

Add support for x86 devices using iPXE as the bootloader.
Add support for x86 devices using iPXE as the bootloader.

For this to work, you need an x86 device (I've got a Dell PowerEdge) with iPXE installed on the default boot device (I'm using a USB stick).
A future config could be to chainload iPXE using PXE so any x86 device in the lab without a bootable medium ends up in iPXE.

I've changed the sendline function to call send(string) then send(os.linesep) to enable passing a delay between characters when writing to the serial line. Adding a delay cured a problem I was having with iPXE dropping random characters when large strings were sent over serial at high speed. The 2 calls the send actually mimics the behaviour of pexepect sendline anyway.
I had trouble using send to interrupt the bootloader with a control character to added a sendcontrol function which uses the pexpect sendcontrol as per the pexpect documentation. See http://pexpect.sourceforge.net/pexpect.html#spawn-sendcontrol

configuration.rst did not match what was at the head of bzr lp:lava-dispatcher so I've added it to my commit.

Amended changes as per Tylers' review. Also added the connection_command to the log output when connecting to console of a board as it's really useful to have that info when debugging problems with boards in the lab.

Amended again for next review, and hopefully moved it onto a branch...

Change-Id: Ib5d8521a8446f446592986cc2ba473113931673a
