This blog explains about my patch to avocado-vt framework to enable running multiple VM's through libvirt in a single test.


Refer my previous blogs for introductions of avocado test framework.


Patches that are needed to support below tests:


tp-libvirt: *
41434fbd Add multi vm cpu stress tests
ede3e1ac Fixup: stress functions args position

avocado-vt: *
2c3ad894 Add param to cleanup env
3723cb28 Library to generate stress events to guest
e6df69b7 Enable libvirt vm start in preprocess
44773144 Undefine libvirt vm using param during postprocess

* - already merged in upstream.

Steps to setup avocado in host and run Multi VM's libvirt tests:

Make sure your host has all packages installed which are needed to run KVM guests through libvirt.

Below tests results are from Fedora28 in IBM Power8 and Intel X86 hosts.

Refer my previous blogs for installing and setting up of avocado test framework, lets right away jump to test runs..

Running tests...

Result on IBM Power8 box:
# avocado run multivm_cpustress.stress_suspend --vt-type libvirt --vt-extra-params create_vm_libvirt=yes kill_vm_libvirt=yes env_cleanup=yes backup_image_before_testing=no restore_image_after_testing=no vcpu_cores=2 smp=2 --vt-guest-os JeOS.27.ppc64le
JOB ID     : 080fd40cc63fb4b68057a3f3d78fe7850dc995ea
JOB LOG    : /home/sath/avocado-fvt-wrapper/results/job-2018-05-17T02.58-080fd40/job.log
 (1/1) type_specific.io-github-autotest-libvirt.multivm_cpustress.stress_suspend: PASS (291.43 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB TIME   : 318.42 s

Result on Intel box:
$sudo avocado run multivm_cpustress.stress_suspend --vt-type libvirt --vt-extra-params create_vm_libvirt=yes kill_vm_libvirt=yes env_cleanup=yes backup_image_before_testing=no restore_image_after_testing=no vcpu_cores=2 smp=2
[sudo] password for satheesh: 
JOB ID     : d405ea473644c411b15e85e5956064bd3784aa6b
JOB LOG    : /root/avocado/job-results/job-2018-05-16T12.45-d405ea4/job.log
 (1/1) type_specific.io-github-autotest-libvirt.multivm_cpustress.stress_suspend: PASS (312.76 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB TIME   : 322.33 s

p:s:- sudo can be ignored if you are already a root user.
guest image is missing wget, gcc packages, install manually.

It's that simple now, let me explain what this test(multivm_cpustress.stress_suspend) does in simple words!!!

1) Define and start three* VMs in libvirt environment.
2) Runs given stress cmd inside each VM.
3) Suspend/Resume each VM in parallel for given number of iterations*.

* - Number of VMs,  Number of iterations of suspend/resumes are test configurable, and it can just be modified in a command line like other params e:g:- vcpu_cores=2

There are few more tests in multivm_cpustress which concentrates on stress vcpu pinning, vcpu hot-plugging etc.



Hope this helps you in someways!!
Thanks for taking time in reading this blog....