Deploying a KVM (x86_64) Device¶
Warning
This chapter discusses a model of device support which is being superceded by the pipeline model.
Adding a KVM device to LAVA is an easy way to make sure things work without having to worry about connecting to a physical device and setting up a master image. This page outlines the steps required to add a new KVM device to your LAVA deployment and make it able to accept job requests.
Obtain an image¶
A variety of pre-built images are available for download:
http://images.validation.linaro.org/kvm/
Building KVM images for LAVA¶
If the prebuilt images are not suitable, new images can be built using vmdebootstrap. See also Deploying an image to a device.
Note
image building tools are constantly developing and this guide can easily become out of date, so you will need to read the manpages for the tools and update the instructions appropiately.
sudo apt install vmdebootstrap
The default distribution is Debian stable.
Example invocation:
$ sudo vmdebootstrap --image=myimage.img --verbose --serial-console --enable-dhcp
To run the test image, use the --owner=$(whoami) option to
vmdebootstrap or make sure it is writeable:
$ sudo chmod a+w ./myimage.img
Execute using qemu, e.g. on amd64 using qemu-system-x86_64:
$ qemu-system-x86_64 ./myimage.img
Newer versions of qemu will complain about the format, so check the manpage and use something like:
$ qemu-system-x86_64 -m 1024 -enable-kvm -drive format=raw,file=./myimage.img
See man 1 vmdebootstrap and man qemu-system for more information.
Adding a KVM device to LAVA¶
You can use the Instance name support:
$ sudo /usr/share/lava-server/add_device.py kvm kvm01
- Add the
root_part = 1line to the device configuration - Configure Optional: networking configuration
Configure the dispatcher manually¶
Create your kvm01.conf file with the following content:
device_type = kvm
root_part = 1
Sample job file (replace file:///path/to/kvm.img with the actual
location where you placed the image you created in the previous step):
{
"timeout": 18000,
"job_name": "kvm-test",
"device_type": "kvm",
"target": "kvm01",
"actions": [
{
"command": "deploy_linaro_image",
"parameters": {
"image": "file:///path/to/kvm.img"