On Wed, 10 Oct 2018 at 12:27, john zhang <laojianghusz@163.com> wrote:
Before test job,we need to add a "device_type" .jinja2 file to directory /etc/lava-server/dispatcher-config/device-types/,and add a "device" .jinja2 file to /etc/lava-server/dispatcher-config/devices/.
The "device_type" .jinja2 file defines device type(for example different hardware)  ,and "device" .jinja2 file(at: /etc/lava-server/dispatcher-config/devices/) defines a concrete device.
When the  dispatcher submits job, a job should be submited to a concrete device.

No, that is a misunderstanding. The scheduler assigns the test job to the first available device of the requested device-type. All devices of that device-type are deemed to be equally suitable for the test job, unless device-tags are used.

What you call a "concrete device" is a "board" - what exists in the database for the scheduler to use is a "device". Boards can and are routinely replaced and have no direct correlation with a device. e.g. the second beaglebone-black on a shelf might be  beaglebone-black-01 but then something happens to it and it gets replaced by a newly purchased beaglebone-black - that new board is still the beaglebone-black-01 device. Or admins could decide to put the details from the first beaglebone-black on the shelf into the device dictionary as beaglebone-black-01 and the new one goes into -02 - it is entirely arbitrary.

If one board has peripherals attached which test writers want to use, then the device can have a device tag created and assigned - test writers can then specify that device tag in test jobs which need to use that peripheral - otherwise if no device tags are in the test job submission, the test job will run on whichever device is available at the time, irrespective of the device tags.