Difference between revisions of "Plugin:virt/tests"
m (→New metrics tests) |
(Updated testplan for virt plugin: added sanity tests from Barometer) |
||
Line 588: | Line 588: | ||
5. Make sure that job information reported by collectd corresponds to values retrieved by virsh utility. | 5. Make sure that job information reported by collectd corresponds to values retrieved by virsh utility. | ||
| * Job information reported by collectd corresponds to values retrieved by virsh utility. | | * Job information reported by collectd corresponds to values retrieved by virsh utility. | ||
+ | |} | ||
+ | |||
+ | === Sanity tests === | ||
+ | |||
+ | Test preconditions: | ||
+ | |||
+ | * Configured write, virt plugins in collectd.conf. | ||
+ | * Libvirtd, collectd services are running. | ||
+ | * perf metrics are enabled (either during VM definition or later on running VM). | ||
+ | |||
+ | {|class="wikitable" | ||
+ | ! # | ||
+ | ! Test summary | ||
+ | ! Steps | ||
+ | ! Expected Result | ||
+ | |- | ||
+ | | 1 | ||
+ | | Verify CPU cycles/instructions upon enable/disable of perf. | ||
+ | | | ||
+ | 1. Get CPU cycles metric from VM. | ||
+ | $ virsh domstats U2 --perf | grep -e cpu_cycles | ||
+ | perf.cpu_cycles=3304247062191 | ||
+ | |||
+ | 2. Compare CPU cycles values from virsh and write plugin (CSV). | ||
+ | |||
+ | 3. Disable CPU cycles | ||
+ | $ virsh perf U2 --disable cpu_cycles | ||
+ | |||
+ | 4. Enable CPU cycles metric | ||
+ | $ virsh perf U2 --enable cpu_cycles | ||
+ | |||
+ | 5. Repeat same for CPU instructions metric. | ||
+ | | | ||
+ | * CPU cycles metric retrieved. | ||
+ | * CPU cycles metric is similar. | ||
+ | * CPU cycles metric is not updated by write plugin. | ||
+ | * CPU cycles metric is similar. | ||
+ | * Same as above for CPU instructions metric. | ||
+ | |- | ||
+ | | 2 | ||
+ | | Verify CPU cycles/instructions upon collectd start/stop, change interval. | ||
+ | | | ||
+ | 1. Get CPU metrics from VM and collectd write plugin. | ||
+ | |||
+ | 2. Stop collectd. Get CPU metrics from VM and collectd write plugin. | ||
+ | |||
+ | 3. Start collectd. Get CPU metrics from VM and collectd write plugin. | ||
+ | |||
+ | 4. Change interval in range 10-60 seconds (restart collectd). | ||
+ | |||
+ | 5. Get CPU metrics from VM and collectd write plugin. | ||
+ | | | ||
+ | * CPU cycles and instructions are updated and similar. | ||
+ | * CPU cycles and instructions are not updated. | ||
+ | * CPU cycles and instructions are updated and similar. | ||
+ | * CPU cycles and instructions are updated every interval set. | ||
+ | |- | ||
+ | | 3 | ||
+ | | Verify CPU cycles/instructions upon libvirtd start/stop, VM start/destroy. | ||
+ | | | ||
+ | 1. Get CPU metrics from VM and collectd write plugin. | ||
+ | |||
+ | 2. Stop libvirtd. Get CPU metrics from VM and collectd write plugin. | ||
+ | |||
+ | 3. Start libvirtd. Get CPU metrics from VM and collectd write plugin. | ||
+ | |||
+ | 4. Stop VM | ||
+ | $ virsh destroy <vm> | ||
+ | |||
+ | 5. Start VM | ||
+ | $ virsh start <vm> | ||
+ | | | ||
+ | * CPU cycles and instructions are updated and similar. | ||
+ | * Metric cannot be retrieved from VM. | ||
+ | * CPU cycles and instructions are updated and similar. | ||
+ | * Metric cannot be retrieved from VM. | ||
+ | * CPU cycles and instructions are updated and similar. | ||
+ | |- | ||
+ | | 4 | ||
+ | | Verify cache misses/references upon enable/disable of perf. | ||
+ | | | ||
+ | 1. Get cache misses metric from VM. | ||
+ | $ virsh domstats U2 --perf | grep -e cache_misses | ||
+ | perf.cache_misses=36683 | ||
+ | |||
+ | 2. Compare cache misses values from virsh and write plugin (CSV). | ||
+ | tail -n1 U2/virt/perf-perf_cache_misses-2017-02-15 | ||
+ | 1487151170.074,36389.000000 | ||
+ | 3. Disable cache misses | ||
+ | $ virsh perf U2 --disable cache_misses | ||
+ | |||
+ | 4. Enable cache misses metric | ||
+ | $ virsh perf U2 --enable cache_misses | ||
+ | |||
+ | 5. Repeat same for cache references metric. | ||
+ | | | ||
+ | * Cache misses metric retrieved. | ||
+ | * Cache misses metric is similar. | ||
+ | * Cache misses metric is not updated by write plugin. | ||
+ | * Cache misses metric is similar. | ||
+ | * Same as above for cache references metric: | ||
+ | perf.cache_references=1815957 | ||
+ | 1487151170.074,1795347.000000 | ||
+ | |- | ||
+ | | 5 | ||
+ | | Verify cache misses/references upon collectd start/stop, change interval. | ||
+ | | | ||
+ | 1. Get cache metrics from VM and collectd write plugin. | ||
+ | |||
+ | 2. Stop collectd. Get cache metrics from VM and collectd write plugin. | ||
+ | |||
+ | 3. Start collectd. Get cache metrics from VM and collectd write plugin. | ||
+ | |||
+ | 4. Change interval in range 10-60 seconds (restart collectd). | ||
+ | |||
+ | 5. Get cache metrics from VM and collectd write plugin. | ||
+ | | | ||
+ | * Cache misses/references are updated and similar. | ||
+ | * Cache misses/references are not updated. | ||
+ | * Cache misses/references are updated and similar. | ||
+ | * Cache misses/references are updated every interval set. | ||
+ | |- | ||
+ | | 6 | ||
+ | | Verify cache misses/references upon libvirtd start/stop, VM start/destroy. | ||
+ | | | ||
+ | 1. Get cache metrics from VM and collectd write plugin. | ||
+ | |||
+ | 2. Stop libvirtd. Get cache metrics from VM and collectd write plugin. | ||
+ | |||
+ | 3. Start libvirtd. Get cache metrics from VM and collectd write plugin. | ||
+ | |||
+ | 4. Stop VM | ||
+ | $ virsh destroy <vm> | ||
+ | |||
+ | 5. Start VM | ||
+ | $ virsh start <vm> | ||
+ | | | ||
+ | * Cache misses/references are updated and similar. | ||
+ | * Metric cannot be retrieved from VM. | ||
+ | * Cache misses/references are updated and similar. | ||
+ | * Metric cannot be retrieved from VM. | ||
+ | * Cache misses/references are updated and similar. | ||
+ | |- | ||
+ | | 7 | ||
+ | | Verify disk metrics upon collectd start/stop, change interval. | ||
+ | | | ||
+ | 1. Get disk number of operations/bytes read/write metrics from VM and collectd write plugin. | ||
+ | virsh domblkstat --human Ubuntu-QA had [ | grep -e operations -e bytes] | ||
+ | tail -n4 disk_octets-hda-2017-02-15 | ||
+ | tail -n4 disk_ops-hda-2017-02-15 | ||
+ | |||
+ | 2. Stop collectd. Get disk metrics from VM and collectd write plugin. | ||
+ | |||
+ | 3. Start collectd. Get disk metrics from VM and collectd write plugin. | ||
+ | |||
+ | 4. Change interval in range 10-60 seconds. Get disk metrics from VM and collectd write plugin. | ||
+ | | | ||
+ | * Disk operations/bytes are updated and similar. | ||
+ | * Disk operations/bytes are not updated. | ||
+ | * Disk operations/bytes are updated and similar. | ||
+ | * Disk operations/bytes are updated every interval set. | ||
+ | |- | ||
+ | | 8 | ||
+ | | Verify disk metrics upon libvirtd start/stop, VM start/destroy. | ||
+ | | | ||
+ | 1. Get disk number of operations/bytes read/write metrics from VM and collectd write plugin. | ||
+ | |||
+ | 2. Stop libvirtd. Get disk metrics from VM and collectd write plugin. | ||
+ | |||
+ | 3. Start libvirtd. Get disk metrics from VM and collectd write plugin. | ||
+ | |||
+ | 4. Stop VM | ||
+ | $ virsh destroy <vm> | ||
+ | |||
+ | 5. Start VM | ||
+ | $ virsh start <vm> | ||
+ | | | ||
+ | * Disk operations/bytes are updated and similar. | ||
+ | * Disk operations/bytes cannot be retrieved from VM. | ||
+ | * Disk operations/bytes are updated and similar. | ||
+ | * Disk operations/bytes cannot be retrieved from VM. | ||
+ | * Disk operations/bytes are updated and similar. | ||
+ | |- | ||
+ | | 9 | ||
+ | | Verify interface metrics upon collectd start/stop, change interval. | ||
+ | | | ||
+ | 1. Get interface statistic from VM and collectd write plugin. | ||
+ | virsh domifstat Ubuntu-QA vnet0; ls | grep if_.*vnet0 | xargs -i -t tail -n4 {} | ||
+ | (files are: | ||
+ | if_dropped-vnet0-2017-02-15; if_errors-vnet0-2017-02-15; | ||
+ | if_octets-vnet0-2017-02-15; if_packets-vnet0-2017-02-15 | ||
+ | ) | ||
+ | |||
+ | 2. Stop collectd. Get interface statistic from VM and collectd write plugin. | ||
+ | |||
+ | 3. Start collectd. Get interface statistic from VM and collectd write plugin. | ||
+ | |||
+ | 4. Change interval in range 10-60 seconds (restart collectd). | ||
+ | |||
+ | 5. Get interface statistic from VM and collectd write plugin. | ||
+ | | | ||
+ | * Interface statistic are updated and similar. | ||
+ | * Interface statistic are not updated. | ||
+ | * Interface statistic are updated and similar. | ||
+ | * Interface statistic are updated every interval set. | ||
+ | |- | ||
+ | | 10 | ||
+ | | Verify interface metrics upon libvirtd start/stop, VM start/destroy. | ||
+ | | | ||
+ | 1. Get interface statistic from VM and collectd write plugin. | ||
+ | |||
+ | 2. Stop libvirtd. Get interface statistic from VM and collectd write plugin. | ||
+ | |||
+ | 3. Start libvirtd. Get interface statistic from VM and collectd write plugin. | ||
+ | |||
+ | 4. Stop VM | ||
+ | $ virsh destroy <vm> | ||
+ | |||
+ | 5. Start VM | ||
+ | $ virsh start <vm> | ||
+ | | | ||
+ | * Interface statistic are updated and similar. | ||
+ | * Interface statistic cannot be retrieved from VM. | ||
+ | * Interface statistic are updated and similar. | ||
+ | * Interface statistic cannot be retrieved from VM. | ||
+ | * Interface statistic are updated and similar. | ||
+ | vnet0 rx_bytes 2098 | ||
+ | vnet0 rx_packets 32 | ||
+ | vnet0 rx_errs 0 | ||
+ | vnet0 rx_drop 0 | ||
+ | vnet0 tx_bytes 1402 | ||
+ | vnet0 tx_packets 15 | ||
+ | vnet0 tx_errs 0 | ||
+ | vnet0 tx_drop 0 | ||
+ | tail -n1 if_dropped-vnet0-2017-02-15 | ||
+ | 1487172921.637,0,0 | ||
+ | tail -n1 if_errors-vnet0-2017-02-15 | ||
+ | 1487172921.637,0,0 | ||
+ | tail -n1 if_octets-vnet0-2017-02-15 | ||
+ | 1487172921.637,2098,1402 | ||
+ | tail -n1 if_packets-vnet0-2017-02-15 | ||
+ | 1487172921.637,32,15 | ||
+ | |- | ||
+ | | 11 | ||
+ | | Verify memory metrics upon collectd start/stop, change interval. | ||
+ | | | ||
+ | 1. Get memory metrics from VM and collectd write plugin. | ||
+ | virsh domstats Ubuntu-QA | grep balloon ; ls | grep memory | xargs -i -t tail -n3 {} | ||
+ | (files are: | ||
+ | memory-actual_balloon-2017-02-15; | ||
+ | memory-last_update-2017-02-15; | ||
+ | memory-rss-2017-02-15; | ||
+ | memory-swap_in-2017-02-15; | ||
+ | memory-total-2017-02-15 | ||
+ | ) | ||
+ | |||
+ | 2. Stop collectd. Get memory metrics from VM and collectd write plugin. | ||
+ | |||
+ | 3. Make changes to memory configuration | ||
+ | $ virsh setmem Ubuntu-QA --size 2097152 --live | ||
+ | |||
+ | 4. Start collectd. Get memory metrics from VM and collectd write plugin. | ||
+ | |||
+ | 5. Change interval in range 10-60 seconds (restart collectd). | ||
+ | |||
+ | 6. Get memory metrics from VM and collectd write plugin. | ||
+ | | | ||
+ | * Memory metrics are updated and similar. | ||
+ | * Memory metrics are not updated. | ||
+ | * Memory rss, actual metrics are updated in VM. No changes observed in write plugin. | ||
+ | * Memory metrics are updated and similar. | ||
+ | * Memory metrics are updated every interval set. | ||
+ | |||
+ | NOTE: | ||
+ | * Maximum allowed memory is not dispatched by libvirt 3.1.0. | ||
+ | * Both memory-actual_balloon and memory-total may return same value. | ||
+ | |- | ||
+ | | 12 | ||
+ | | Verify memory metrics upon VM start/destroy. | ||
+ | | | ||
+ | 1. Get memory statistic from VM and collectd write plugin. | ||
+ | |||
+ | 2. Stop VM | ||
+ | $ virsh destroy <vm> | ||
+ | |||
+ | 3. Change max memory limit | ||
+ | $ virsh setmaxmem Ubuntu-QA --size 4194304 | ||
+ | |||
+ | 4. Start VM | ||
+ | $ virsh start <vm> | ||
+ | |||
+ | 5. Get memory statistic from VM and collectd write plugin. | ||
+ | | | ||
+ | * Memory metrics are updated and similar. | ||
+ | * Memory total metrics updated in configuration but not updated by collectd write plugin. | ||
+ | virsh domstats Ubuntu-QA | grep balloon.maximum | ||
+ | Memory total metrics updated in VM and collectd write plugin. | ||
|} | |} | ||
Latest revision as of 16:34, 19 March 2020
This page contains tests instructions for the virt plugin. This page is meant to aid in testing at release time and be a guide for developing automated tests. Please add any tests that you have run when testing this plugin.
OPNFV Barometer
New metrics tests
NOTE:
- Tests cover CMT, CPU pinning info, CPU utilization, State metrics only.
- Several tests added for interaction coverage(restarting libvirtd, disabling metrics for VM, stopping VM, etc...)
- Added tests for MBM metric.
- Added 'sanity' tests for other metrics: CPU cycles/instructions, cache misses/references, interface statistic, disk and memory data.
- Added tests for disk errors, file system information and job statistics.
Test Environment details:
- Bare Metal, Ubuntu 16.04.1 LTS
- Kernel version: 4.4.0-43-generic
Repo/branch used:
- collectd/ feat_libvirt_upstreamed
Tests precondition:
- libvirt version used 2.4.0 (3.1.0)
- VM is started:
$ virsh start demo $ root@silpixa00390838:~/orest/csv# virsh list Id Name State ---------------------------------------------------- 6 demo running
- Collectd is started with csv write plugin enabled and the following libvirt configuration:
Interval 2 LoadPlugin virt
<Plugin virt> Connection "qemu:///system" RefreshInterval 60 # Domain "demo" # BlockDevice "name:device" # BlockDeviceFormat target # BlockDeviceFormatBasename false # InterfaceDevice "name:device" # IgnoreSelected false # HostnameFormat name # InterfaceFormat name # PluginInstanceFormat name Instances 1 #ExtraStats "cpu_util disk disk_err domain_state fs_info job_stats_background pcpu perf vcpupin memory_last_update" </Plugin>
# | Test summary | Steps | Expected Result |
---|---|---|---|
1 | Verify that virt plugin dispatches CMT metrics. |
1. Start collectd with virt plugin and write plugin enabled(Interval is set to 1 second): Interval 1 2. Get cmt metric from VM. $ virsh domstats demo --perf Domain: 'demo' perf.cmt=196608 perf.cpu_cycles=711466301 perf.instructions=682427381 3. Wait 10 seconds(this is done in order to catch value written by collectd) 4. Stop collectd 5. Get collectd data: $ tail -f demo/virt/perf-perf_cmt-2016-12-27 1482836073.410,229376.000000 1482836074.408,327680.000000 1482836075.408,425984.000000 6. Verify that value perf.cmt=196608 is present in collectd data. |
Since cmt performance metric is continuously changing it is complicated to catch equal values in virsh and collectd data. Therefore we are verifying that perf.cmt=196608 is present in collectd data. |
2 | Verify that virt plugin does not dispatch CMT metrics when CMT has been disabled in VM |
1. Make sure that CMT metrics are dispatched by collectd: $ tail -f demo/virt/perf-perf_cmt-2016-12-29 1483023819.786,1376256.000000 1483023821.786,1376256.000000 1483023823.786,1376256.000000 2. Disable CMT metric in VM: $ virsh perf demo --disable cmt --live 3. Verify that plugin stops dispatching cmt metrics: $ tail -f demo/virt/perf-perf_cmt-2016-12-29 1483023819.786,1376256.000000 1483023821.786,1376256.000000 1483023823.786,1376256.000000 |
Virt plugin should stop dispatching CMT metric when CMT is dynamically disabled for VM. |
3 | Verify that virt plugin dispatches CPU pinning info metrics. |
1. Get CPU pinnning info using virsh tool: $ virsh vcpupin demo VCPU: CPU Affinity ---------------------------------- 0: 0-15 2. Make sure that CPU pinning info metric is dispatched for all CPUs by collectd: $ ls demo/virt/cpu_affinity-vcpu_0-cpu_ cpu_affinity-vcpu_0-cpu_0-2017-01-03 cpu_affinity-vcpu_0-cpu_12-2017-01-03 cpu_affinity-vcpu_0-cpu_2-2017-01-03 cpu_affinity-vcpu_0-cpu_6-2017-01-03 cpu_affinity-vcpu_0-cpu_10-2017-01-03 cpu_affinity-vcpu_0-cpu_13-2017-01-03 cpu_affinity-vcpu_0-cpu_3-2017-01-03 cpu_affinity-vcpu_0-cpu_7-2017-01-03 cpu_affinity-vcpu_0-cpu_11-2017-01-03 cpu_affinity-vcpu_0-cpu_14-2017-01-03 cpu_affinity-vcpu_0-cpu_4-2017-01-03 cpu_affinity-vcpu_0-cpu_8-2017-01-03 cpu_affinity-vcpu_0-cpu_1-2017-01-03 cpu_affinity-vcpu_0-cpu_15-2017-01-03 cpu_affinity-vcpu_0-cpu_5-2017-01-03 cpu_affinity-vcpu_0-cpu_9-2017-01-03 3. $ tail -f demo/virt/cpu_affinity-vcpu_0-cpu_0-2017-01-03 1483439612.731,1.000000 1483439614.729,1.000000 |
$ tail -f demo/virt/cpu_affinity-vcpu_0-cpu_0-2017-01-03 1483439612.731,1.000000 1483439614.729,1.000000
|
4 | Verify that virt plugin change CPU pinning info metric when its value is changed. |
1. Get CPU pinning info using virsh tool: $ virsh vcpupin demo VCPU: CPU Affinity ---------------------------------- 0: 0-15 2. Make sure that pinning value for CPU-15 is equal to 1 in write collectd data: $ tail -f demo/virt/cpu_affinity-vcpu_0-cpu_15-2017-01-03 1483440114.729,1.000000 1483440116.729,1.000000 1483440118.729,1.000000 1483440120.729,1.000000 3. Change CPU pinning using virsh tool: $ virsh vcpupin demo --vcpu 0 --cpulist 0-14 4. Verify that CPU pinning info is changed to 0 in write collectd data: $ tail -f demo/virt/cpu_affinity-vcpu_0-cpu_15-2017-01-03 1483440132.730,1.000000 1483440134.729,1.000000 1483440136.729,0.000000 1483440138.729,0.000000 |
CPU pinning info is changed to 0 in collectd data when its value was changed using virsh tool. |
5 | Verify that virt plugin dispatches CPU utilization per VCPU in nanosecond format |
1. Start collectd with virt plugin and write plugin enabled. 2. Get vcpu metric from VM. 3. Wait collectd interval time for value update. 4. Stop collectd and get collectd data. 5. Compare utilizations for all vcpu in VM. |
$ virsh vcpuinfo U2 VCPU: 0 CPU time: 668.8s - $ tail -n2 U2/virt/virt_vcpu-0-2017-02-14 1487092445.317,668860000000 1487092450.319,668860000000
|
6 | Verify that notification raised when changed Virtual Machine state . |
1. Start VM: virsh start vm_name 2. Using exec plugin get notification message. 3. Reset VM: virsh reset vm_name 4. Using exec plugin get notification message. 5. Suspend VM: virsh suspend vm_name 6. Using exec plugin get notification message. 7. Resume VM: virsh resume vm_name 8. Using exec plugin get notification message. |
|
7 | Verify that virt plugin starts dispatching data for newly created VM within RefreshInterval. |
1. One VM is in running state: $ virsh list --all Id Name State ---------------------------------------------------- 4 demo running - demo1 shut off 2. Set RefreshInterval to 10 seconds in collectd.conf: RefreshInterval 10 3. Start collectd and immediately start second VM. $ virsh start demo1 4. Make sure that data occurs after Refresh Interval. |
|
8 | Verify that virt plugin stops dispatching data for deleted VM. |
1. Two VMs are running: $ virsh list Id Name State ---------------------------------------------------- 4 demo running 5 demo1 running 2. Set RefreshInterval to 10 seconds in collectd.conf: RefreshInterval 10 3. Start collectd, immediately stop second VM and remove collectd data. 4. Make sure that some collectd metrics are still dispatched(State metrics) $ ls; virsh destroy demo1; rm -rf ./*; sleep 2; tail -f demo1/virt/domain_state-2017-01-03; demo demo1 Domain demo1 destroyed epoch,state,reason 1483443087.341,5.000000,2.000000 1483443089.340,5.000000,2.000000 1483443091.341,5.000000,2.000000 1483443093.340,5.000000,2.000000 5. Verify that collectd metrics stops dispatching after RefreshInterval |
|
9 | Verify that virt plugin resumes dispatching data after libvirtd has been restarted |
1. Restart libvirtd service. $ systemctl restart libvirtd 2. Wait until service is restarted. $ systemctl status libvirtd ? libvirt-bin.service - Virtualization daemon Loaded: loaded (/lib/systemd/system/libvirt-bin.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2017-01-03 11:36:04 GMT; 1min 49s ago 3. Verify that virt plugin resumes collecting metrics. |
* Virt plugin resumes collecting metrics after libvirtd service has been restarted. |
10 | Verify that virt plugin resumes dispatching data after VM has been restarted |
1. Restart VM: $ virsh destroy demo Domain demo destroyed $ virsh start demo Domain demo started 2. Tail one of VM metrics(CPU total utilization): root@silpixa00390838:~/orest/csv# tail -f demo/virt/percent-virt_cpu_total-2017-01-03 1483443552.844,0.000000 1483443554.844,0.031250 3. Verify that virt plugin resumes collecting metrics. |
|
11 | Verify that libvirt plugin correctly displays CPU utilization in percent in regular mode |
1. Start virt-top on server where VM is started 2. Open libvirt plugin file where CPU utilization is stored $ tail -f percent-virt_cpu_total-2017-01-03 3. Compare values NOTE: virt-top cuts output to 1 tenth symbol, and speed of values increment is different |
Note: In case of CPU is not loaded around zero values will be retrieved. |
12 | Verify that libvirt plugin correctly displays CPU utilization in CPU load mode |
1. Start virt-top on server where VM is started 2. Open libvirt plugin file where CPU utilization is stored tail -f percent-virt_cpu_total-2017-01-03 3. Start stress tool on VM stress --cpu 2 --io 1 --vm 1 --vm-bytes 128M --timeout 20s 4. Compare values NOTE: virt-top cuts output to 1 tenth symbol, and speed of values increment is different |
|
13 | Verify that libvirt plugin correctly displays CPU utilization in percent upon VM restart |
1. Start virt-top on server where VM is started 2. Open libvirt plugin file where CPU utilization is stored: tail -f percent-virt_cpu_total-2017-01-03 3. Start stress tool on VM: stress --cpu 2 --io 1 --vm 1 --vm-bytes 128M --timeout 60s 4. Start/Stop a VM within 60 seconds: virsh destroy <VM_name>; sleep 1; virsh start <VM_name> 5. Compare values NOTE: virt-top cuts output to 1 tenth symbol, and speed of values increment is different |
* Values are pretty similar except 0 value every 10 sec |
14 | Verify that libvirt plugin doesn't update CPU utilization if collectd is disabled |
1. Start virt-top on server where VM is started 2. Open libvirt plugin file where CPU utilization is stored tail -f percent-virt_cpu_total-2017-01-03 3. Compare values 4. Stop collectd 5. Compare values NOTE: virt-top cuts output to 1 tenth symbol, and speed of values increment is different |
* Update of percent-virt.. file has stopped |
15 | Verify that libvirt plugin starts update CPU utilization if collectd is started |
1.Start virt-top on server where VM is started 2. Open libvirt plugin file where CPU utilization is stored tail -f percent-virt_cpu_total-2017-01-03 3. Stop collectd 4. Compare values 5. Start collectd 6. Compare values NOTE: virt-top cuts output to 1 tenth symbol, and speed of values increment is different |
* Update of percent-virt.. file has started
NOTE: up to 10 sec before 1-st value appeared |
16 | Verify that CPU utilization values are correct through at least 30-40 sec3 |
1. Start virt-top on server where VM is started 2. Open libvirt plugin file where CPU utilization is stored tail -f percent-virt_cpu_total-2017-01-03 3. Start stress tool on VM stress --cpu 2 --io 1 --vm 1 --vm-bytes 128M --timeout 40s 4. Compare values NOTE: virt-top cuts output to 1 tenth symbol, and speed of values increment is different |
* Values are pretty similar except 0 value every 10 sec |
17 | Verify libvirt collectd plugin MBM metric behavior upon enable/disable mbmt/mbml |
1. Start collectd with virt and csv (or other write) plugin enabled, libvirt. 2. Start vm and enable mbmt metric. Run some activity in VM: stress --cpu 2 --io 1 --vm 1 --vm-bytes 128M --timeout 20s 3. Disable mbmt and enable mbml metric. 4. Disable mbml metric. 5. Enable both mbmt and mbml metric. |
|
18 | Verify libvirt collectd plugin MBM metric updates every interval time set in collectd.conf. |
1. Start collectd with virt and csv (or other write) plugin enabled, libvirt. 2. Start vm and enable mbmt metric. Run some activity in VM: stress --cpu 2 --io 1 --vm 1 --vm-bytes 128M --timeout 20s 3. Change interval in collectd.conf. Restart collectd. 4. Repeat step#3 for different time intervals. |
|
19 | Verify MBM metric upon collectd stop/start |
|
|
20 | Verify libvirt collectd plugin MBM metric by un-/comment 'virt' in collectd.conf |
|
|
21 | Verify MBM metric after libvirt service restart |
|
|
22 | Verify MBM metric after VM start/destroy |
|
|
23 | Verify libvirt collectd plugin MBM metric from two VMs |
|
|
24 | Verify MBM metric after VM reboot, suspend, resume |
|
|
25 | Verify zero disk errors are collected by virt plugin |
1. Start collectd with virt and wirte plugin enabled in collectd.conf. ExtraStats "disk_err" 2. Start VM 3. Get disk errors information using virsh tool and make sure no errors are present: $ virsh domblkerror silvixa00398939a 4. Start parsing syslog and make sure that plugin reportd zero disk errors. 5. Verify that plugin does not collectd any errors. |
* Plugin does not collectd any errors and syslog shows that zero disk errors are reported by collectd. |
26 | Verify file system information reported by collectd corresponds to actual values of VM. |
1. Start collectd with virt and write plugin enabled in collectd.conf. ExtraStats "fs_info" 2. Make sure that exec plugin is enabled for capturing collectd notifications. exec_script: #!/bin/bash rm -f /home/test/notifications while read x y do echo $x$y >> /home/test/notifications done
<Plugin exec> Exec "test:test" "/home/test/exec_notification" NotificationExec "test:test" "/home/test/exec_notification" </Plugin> 3. Get file system information using virsh utility: virsh domfsinfo silvixa00398939a Mountpoint Name Type Target ------------------------------------------------------------------- / sda1 ext4 hda 4. Get Notification data reported by collectd: Severity:OKAY Time:1490705042.261 Host:silvixa00398939a Plugin:virt Type:file_system mountpoint:/ name:sda1 fstype:ext4 ndevAlias:1 devAlias:hda Filesystem information 5. Verify that notification data corresponds to data retrieved by virsh utility. |
Notification data corresponds to data retrieved by virsh utility. |
27 | Verify job statistic is reported by virt plugin. |
1. Start collectd with virt and write plugin enabled in collectd.conf. 2. Set collectd read interval to 0.5 second in order to catch job statistics before VM exits. 3. Make sure that VM is in running state. 4. Perform virsh managedsave command and get job stat information using virsh in parallel. $ virsh managedsave silvixa00398939a --bypass-cache& for x in range{1..20}; do virsh domjobinfo silvixa00398939a; sleep 0.5; done 5. Make sure that job information reported by collectd corresponds to values retrieved by virsh utility. |
* Job information reported by collectd corresponds to values retrieved by virsh utility. |
Sanity tests
Test preconditions:
- Configured write, virt plugins in collectd.conf.
- Libvirtd, collectd services are running.
- perf metrics are enabled (either during VM definition or later on running VM).
# | Test summary | Steps | Expected Result |
---|---|---|---|
1 | Verify CPU cycles/instructions upon enable/disable of perf. |
1. Get CPU cycles metric from VM. $ virsh domstats U2 --perf | grep -e cpu_cycles perf.cpu_cycles=3304247062191 2. Compare CPU cycles values from virsh and write plugin (CSV). 3. Disable CPU cycles $ virsh perf U2 --disable cpu_cycles 4. Enable CPU cycles metric $ virsh perf U2 --enable cpu_cycles 5. Repeat same for CPU instructions metric. |
|
2 | Verify CPU cycles/instructions upon collectd start/stop, change interval. |
1. Get CPU metrics from VM and collectd write plugin. 2. Stop collectd. Get CPU metrics from VM and collectd write plugin. 3. Start collectd. Get CPU metrics from VM and collectd write plugin. 4. Change interval in range 10-60 seconds (restart collectd). 5. Get CPU metrics from VM and collectd write plugin. |
|
3 | Verify CPU cycles/instructions upon libvirtd start/stop, VM start/destroy. |
1. Get CPU metrics from VM and collectd write plugin. 2. Stop libvirtd. Get CPU metrics from VM and collectd write plugin. 3. Start libvirtd. Get CPU metrics from VM and collectd write plugin. 4. Stop VM $ virsh destroy <vm> 5. Start VM $ virsh start <vm> |
|
4 | Verify cache misses/references upon enable/disable of perf. |
1. Get cache misses metric from VM. $ virsh domstats U2 --perf | grep -e cache_misses perf.cache_misses=36683 2. Compare cache misses values from virsh and write plugin (CSV). tail -n1 U2/virt/perf-perf_cache_misses-2017-02-15 1487151170.074,36389.000000 3. Disable cache misses $ virsh perf U2 --disable cache_misses 4. Enable cache misses metric $ virsh perf U2 --enable cache_misses 5. Repeat same for cache references metric. |
perf.cache_references=1815957 1487151170.074,1795347.000000 |
5 | Verify cache misses/references upon collectd start/stop, change interval. |
1. Get cache metrics from VM and collectd write plugin. 2. Stop collectd. Get cache metrics from VM and collectd write plugin. 3. Start collectd. Get cache metrics from VM and collectd write plugin. 4. Change interval in range 10-60 seconds (restart collectd). 5. Get cache metrics from VM and collectd write plugin. |
|
6 | Verify cache misses/references upon libvirtd start/stop, VM start/destroy. |
1. Get cache metrics from VM and collectd write plugin. 2. Stop libvirtd. Get cache metrics from VM and collectd write plugin. 3. Start libvirtd. Get cache metrics from VM and collectd write plugin. 4. Stop VM $ virsh destroy <vm> 5. Start VM $ virsh start <vm> |
|
7 | Verify disk metrics upon collectd start/stop, change interval. |
1. Get disk number of operations/bytes read/write metrics from VM and collectd write plugin. virsh domblkstat --human Ubuntu-QA had [ | grep -e operations -e bytes] tail -n4 disk_octets-hda-2017-02-15 tail -n4 disk_ops-hda-2017-02-15 2. Stop collectd. Get disk metrics from VM and collectd write plugin. 3. Start collectd. Get disk metrics from VM and collectd write plugin. 4. Change interval in range 10-60 seconds. Get disk metrics from VM and collectd write plugin. |
|
8 | Verify disk metrics upon libvirtd start/stop, VM start/destroy. |
1. Get disk number of operations/bytes read/write metrics from VM and collectd write plugin. 2. Stop libvirtd. Get disk metrics from VM and collectd write plugin. 3. Start libvirtd. Get disk metrics from VM and collectd write plugin. 4. Stop VM $ virsh destroy <vm> 5. Start VM $ virsh start <vm> |
|
9 | Verify interface metrics upon collectd start/stop, change interval. |
1. Get interface statistic from VM and collectd write plugin. virsh domifstat Ubuntu-QA vnet0; ls | grep if_.*vnet0 | xargs -i -t tail -n4 {} (files are: if_dropped-vnet0-2017-02-15; if_errors-vnet0-2017-02-15; if_octets-vnet0-2017-02-15; if_packets-vnet0-2017-02-15 ) 2. Stop collectd. Get interface statistic from VM and collectd write plugin. 3. Start collectd. Get interface statistic from VM and collectd write plugin. 4. Change interval in range 10-60 seconds (restart collectd). 5. Get interface statistic from VM and collectd write plugin. |
|
10 | Verify interface metrics upon libvirtd start/stop, VM start/destroy. |
1. Get interface statistic from VM and collectd write plugin. 2. Stop libvirtd. Get interface statistic from VM and collectd write plugin. 3. Start libvirtd. Get interface statistic from VM and collectd write plugin. 4. Stop VM $ virsh destroy <vm> 5. Start VM $ virsh start <vm> |
vnet0 rx_bytes 2098 vnet0 rx_packets 32 vnet0 rx_errs 0 vnet0 rx_drop 0 vnet0 tx_bytes 1402 vnet0 tx_packets 15 vnet0 tx_errs 0 vnet0 tx_drop 0 tail -n1 if_dropped-vnet0-2017-02-15 1487172921.637,0,0 tail -n1 if_errors-vnet0-2017-02-15 1487172921.637,0,0 tail -n1 if_octets-vnet0-2017-02-15 1487172921.637,2098,1402 tail -n1 if_packets-vnet0-2017-02-15 1487172921.637,32,15 |
11 | Verify memory metrics upon collectd start/stop, change interval. |
1. Get memory metrics from VM and collectd write plugin. virsh domstats Ubuntu-QA | grep balloon ; ls | grep memory | xargs -i -t tail -n3 {} (files are: memory-actual_balloon-2017-02-15; memory-last_update-2017-02-15; memory-rss-2017-02-15; memory-swap_in-2017-02-15; memory-total-2017-02-15 ) 2. Stop collectd. Get memory metrics from VM and collectd write plugin. 3. Make changes to memory configuration $ virsh setmem Ubuntu-QA --size 2097152 --live 4. Start collectd. Get memory metrics from VM and collectd write plugin. 5. Change interval in range 10-60 seconds (restart collectd). 6. Get memory metrics from VM and collectd write plugin. |
NOTE:
|
12 | Verify memory metrics upon VM start/destroy. |
1. Get memory statistic from VM and collectd write plugin. 2. Stop VM $ virsh destroy <vm> 3. Change max memory limit $ virsh setmaxmem Ubuntu-QA --size 4194304 4. Start VM $ virsh start <vm> 5. Get memory statistic from VM and collectd write plugin. |
virsh domstats Ubuntu-QA | grep balloon.maximum Memory total metrics updated in VM and collectd write plugin. |