You need to be familiar with these sections:
The django admin interface is a core component of the django framework. Elements can be added for particular implementations but, fundamentally, the operation of the interface is the same as other django sites. The appearance of the menu is determined by the version of django installed on your system. The style changed substantially in django 1.9, so images of the interface itself are not included here.
The django administrative interface offers links back to your LAVA instance if the Sites element is modified. (The default django value is example.com.) Navigate to the Sites element in the administrative interface and modify the domain name and display name. Once complete, links like View site and the View on site button on certain pages of the interface will link to the correct location in your LAVA instance.
It is tempting to jump straight in with your one-off special device which nobody else has managed to automate yet but a fresh install needs to be tested with a known working configuration. Setting up known working devices and learning how to modify the first job is essential to deciding how to best configure a new device. It is also recommended to setup another known device type which is similar to the device you want to add as there are different steps required for certain types of device.
This first QEMU device can be configured on the existing worker which is always available on the master. Subsequent devices can be added to other workers and devices can be shuffled between workers, subject to limitations of physical connections.
QEMU is always recommended as the first device to be set up on any LAVA instance for a few reasons:
See also
Creating a gold standard image and Adding your first QEMU device.
Log in to the LAVA instance and click on your username to see the Profile menu.
The django administrative interface is accessed from the Administration link in the profile menu.
Just before you add the device type, take a look at the available elements of a device type:
The only value needed for the QEMU device type is the Name, just check that Display is the default: enabled. Now Save.
For the first device, a simple device dictionary can be used to provide the device-specific details on top of the template:
{% extends 'qemu.jinja2' %}
{% set arch = 'amd64' %}
{% set mac_addr = '52:54:00:12:34:59' %}
{% set memory = '1024' %}
The template itself lives in:
/etc/lava-server/dispatcher-config/device-types/qemu.jinja2
This dictionary does not include a setting to use a tap device which means that this device would not support a hacking session inside the virtual machine. Setting up a bridge is out of scope for this documentation.
See also
Creating a device dictionary for the device, Updating a device dictionary, Checking your templates and About device type templates.
Once updated, the device dictionary is added to the Device view in the administrative interface under the Advanced Properties section at the base of the page.
The core principles remain the same as for QEMU, the main differences are in the way that the device dictionary is needed to provide a wider range of settings covering power control, serial connections, network details and other values.
Templates usually exist for known device types because an existing instance is using the template. Often, that instance will be Linaro’s central validation lab in Cambridge which is accessible via https://validation.linaro.org/ .
The contents of the device dictionary for particular devices are visible to anyone with access to that device type, using the device detail page. Details of the jinja2 files used to update the device dictionary on Linaro instances is also held in git:
The structure of the device dictionary files will be similar for each device of the same type but the values will change. An example for a beaglebone-black device looks like:
{% extends 'beaglebone-black.jinja2' %}
{% set connection_command = 'telnet localhost 7101' %}
{% set hard_reset_command = '/usr/local/lab-scripts/snmp_pdu_control --hostname pdu15 --command reboot --port 11' %}
{% set power_off_command = '/usr/local/lab-scripts/snmp_pdu_control --hostname pdu15 --command off --port 11' %}
{% set power_on_command = '/usr/local/lab-scripts/snmp_pdu_control --hostname pdu15 --command on --port 11' %}
Note
It is recommended to keep the device dictionary jinja files under version control. The templates are configuration files, so if you modify the default templates, those need to be under version control as well.
If you have a working V1 configuration, this can be migrated to the V2 requirements. Devices can support both models during the migration, admins can choose to make some devices exclusive to V2 at any time before the V1 code support is removed.
Warning
This is the most complex part and it can be a lot of work (sometimes several months) to integrate a completely new device into LAVA. V2 offers a different and wider range of support to V1 but some devices will need new support to be written within lava-dispatcher. It is not always possible to automate a new device, depending on how the device connects to LAVA, how the device is powered and whether the software on the device allows the device to be controlled remotely.
The integration process is different for every new device. Therefore, this documentation can only provide hints about such devices, based on experience within the LAVA software and lab teams. Please talk to us before starting on the integration of a new device using the Mailing lists. Include full details of the type of device, the bootloader specifications, hardware support and anything you have done so far to automate the device. Sometimes, the supplied bootloader must be modified to allow automation. Some devices need electrical modifications or specialised hardware to be automated.