feat(jobspec): Unify soak jobspecs
[csit.git] / docs / report / introduction / methodology_kvm_vms_vhost_user.rst
1 KVM VMs vhost-user
2 ------------------
3
4 QEMU is used for KVM VM vhost-user testing enviroment. By default,
5 standard QEMU version is used, preinstalled from OS repositories
6 (qemu-2.11.1 for Ubuntu 18.04). The path
7 to the QEMU binary can be adjusted in `Constants.py`.
8
9 FD.io CSIT performance lab is testing VPP vhost-user with KVM VMs using
10 following environment settings:
11
12 CSIT supports two types of VMs:
13
14 - **Image-VM**: used for all functional, VPP_device, and regular
15   performance tests except NFV density tests.
16
17 - **Kernel-VM**: new VM type introduced for NFV density tests to provide
18   greater in-VM application install flexibility and to further reduce
19   test execution time by simpler VM lifecycle management.
20
21 Image-VM
22 ~~~~~~~~
23
24 CSIT can use a pre-created VM image. The path to the image can be
25 adjusted in `Constants.py`. For convenience and full compatibility CSIT
26 repository contains a set of scripts to prepare `Built-root
27 <https://buildroot.org/>`_ based embedded Linux image with all the
28 dependencies needed to run DPDK Testpmd, DPDK L3Fwd, Linux bridge or
29 Linux IPv4 forwarding.
30
31 Built-root was chosen for a VM image to make it lightweight and with
32 fast booting time to limit impact on tests duration.
33
34 In order to execute CSIT tests, VM image must have following software
35 installed: qemu-guest-agent, sshd, bridge-utils, VirtIO support and DPDK
36 Testpmd/L3fwd applications. Username/password for the VM must be
37 ``cisco``/``cisco`` and ``NOPASSWD`` sudo access. The interface naming
38 is based on the driver (management interface type is Intel E1000), all
39 E1000 interfaces will be named ``mgmt<n>`` and all VirtIO interfaces
40 will be named ``virtio<n>``. In VM ``/etc/init.d/qemu-guest-agent`` must
41 be set to ``TRANSPORT=isa-serial:/dev/ttyS1`` because ttyS0 is used by
42 serial console and ttyS1 is dedicated for qemu-guest-agent in QEMU
43 setup.
44
45 Kernel-VM
46 ~~~~~~~~~
47
48 CSIT can use a kernel KVM image as a boot kernel, as an alternative to
49 image VM. This option allows better configurability of what application
50 is running in VM userspace. Using root9p filesystem allows mapping the
51 host-OS filesystem as read only guest-OS filesystem.
52
53 Example of custom init script for the kernel-VM:
54
55 ::
56
57   #!/bin/bash
58   mount -t sysfs -o "nodev,noexec,nosuid" sysfs /sys
59   mount -t proc -o "nodev,noexec,nosuid" proc /proc
60   mkdir /dev/pts
61   mkdir /dev/hugepages
62   mount -t devpts -o "rw,noexec,nosuid,gid=5,mode=0620" devpts /dev/pts || true
63   mount -t tmpfs -o "rw,noexec,nosuid,size=10%,mode=0755" tmpfs /run
64   mount -t tmpfs -o "rw,noexec,nosuid,size=10%,mode=0755" tmpfs /tmp
65   mount -t hugetlbfs -o "rw,relatime,pagesize=2M" hugetlbfs /dev/hugepages
66   echo 0000:00:06.0 > /sys/bus/pci/devices/0000:00:06.0/driver/unbind
67   echo 0000:00:07.0 > /sys/bus/pci/devices/0000:00:07.0/driver/unbind
68   echo vfio-pci > /sys/bus/pci/devices/0000:00:06.0/driver_override
69   echo vfio-pci > /sys/bus/pci/devices/0000:00:07.0/driver_override
70   echo 0000:00:06.0 > /sys/bus/pci/drivers/vfio-pci/bind
71   echo 0000:00:07.0 > /sys/bus/pci/drivers/vfio-pci/bind
72   $vnf_bin
73   poweroff -f
74
75 QemuUtils library during runtime replaces the ``$vnf_bin`` variable by
76 the path to NF binary and its parameters. This allows CSIT to run any
77 application installed on host OS, for example the same version of VPP
78 as running on the host-OS.
79
80 Kernel-VM image must be available in the host filesystem as a
81 prerequisite. The path to kernel-VM image is defined in `Constants.py`.