Virtual machine (VM) groups are a special type of multinode test job, where dynamically allocated virtual machines participate in a single test job.
To submit a VM group test job, you need:
A VM group test job consists of a vm_group attribute, specifying the host machine and a list of VM’s that will spawned on the host.
See Writing MultiNode JSON tests for more information on VMGroup test definitions. Virtual Machine groups are an extension of MultiNode, so the definition which would be resubmitted as a new VMGroup job will be the VMGroup Definition.
Example job definition:
{
"timeout": 18000,
"job_name": "vm-groups basic test case",
"logging_level": "DEBUG",
"vm_group": {
"host": {
"device_type": "arndale",
"role": "host"
},
"auto_start_vms": true,
"vms": [
{
"device_type": "kvm-arm",
"role": "server"
},
{
"device_type": "kvm-arm",
"role": "client"
}
]
},
"actions": [
{
"command": "deploy_linaro_image",
"parameters": {
"image": "file:///path/to/host.img",
"role": "host"
}
},
{
"command": "deploy_linaro_image",
"parameters": {
"image": "file:///path/to/host.img",
"role": "client"
}
},
{
"command": "deploy_linaro_image",
"parameters": {
"image": "file:///path/to/host.img",
"role": "server"
}
},
{
"command": "lava_test_shell",
"parameters": {
"testdef_urls": [
"file:///path/to/mytestdef.yaml"
]
}
}
]
}
The host section declares the device that will be used as host for the VMs. Note the following requirements for system images used for host devices:
The auto_start_vms attribute is optional, and can be set to false to make LAVA not start the VM’s as soon as the host is booted (the default value is true). In that case, signaling LAVA when the VM’s should be started becomes a responsibility of the test writer: one has to include a call to lava-start-vms at a point in the test code where the VMs should be started, and another call to lava-wait-vms before the test code finishes to make sure that the host will wait until the VM’s are done before allowing a reboot of the host. Example:
#!/bin/sh
# work work work ... (e.g. build qemu from source)
lava-start-vms
# run tests on the host ...
# done, now wait for VM's to finish
lava-wait-for-vms
The vms section contains an array of VM descriptions, which will be used to instantiate the VMs on the host device. Each item in that array must have the following mandatory attributes:
There are additional parameters that can be used, but are optional:
The VMs will run on the host device and LAVA supports running LAVA Test Shell on the host and inside each VM.