Bug 1461270
Summary: | virsh domifstat tx_drop value is not correct for openvswitch vhostuser interfaces | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | chhu | |
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> | |
Status: | CLOSED ERRATA | QA Contact: | Jingjing Shao <jishao> | |
Severity: | medium | Docs Contact: | ||
Priority: | high | |||
Version: | 7.4 | CC: | dyuan, fsoppels, jherrman, mkalinin, mprivozn, ojanas, rbalakri, rhodain, xuzhang, yalzhang | |
Target Milestone: | rc | Keywords: | Upstream, ZStream | |
Target Release: | --- | |||
Hardware: | x86_64 | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | libvirt-3.7.0-1.el7 | Doc Type: | Bug Fix | |
Doc Text: |
Previously, diagnostic commands for virtual machines (VMs), such as "virsh domifstat", in some cases incorrectly reported 0 as the value of certain statistics. This update modifies the libvirtd service to fetch these statistics one by one instead of in groups. As a result, reporting 0 values for VM statistics is significantly less likely.
|
Story Points: | --- | |
Clone Of: | ||||
: | 1627746 (view as bug list) | Environment: | ||
Last Closed: | 2018-04-10 10:48:37 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1627746 |
Description
chhu
2017-06-14 05:47:47 UTC
The problem here is libvirt issues one ovs-vsctl command trying to fetch all the data. However, upon error, no output is produced for libvirt to parse. Therefore we must break it into smaller pieces: int virNetDevOpenvswitchInterfaceStats(const char *ifname, virDomainInterfaceStatsPtr stats) { ... cmd = virCommandNew(OVSVSCTL); virNetDevOpenvswitchAddTimeout(cmd); virCommandAddArgList(cmd, "get", "Interface", ifname, "statistics:rx_errors", "statistics:rx_dropped", "statistics:tx_errors", "statistics:tx_dropped", NULL); ... } Patch proposed upstream: https://www.redhat.com/archives/libvir-list/2017-June/msg00913.html I've just pushed the patch upstream: commit edaf13565712b431c6fd66a5c4a964af7759ce68 Author: Michal Privoznik <mprivozn> AuthorDate: Wed Jun 14 15:23:29 2017 +0200 Commit: Michal Privoznik <mprivozn> CommitDate: Fri Jun 23 11:51:23 2017 +0200 virNetDevOpenvswitchInterfaceStats: Be more forgiving when fetching stats https://bugzilla.redhat.com/show_bug.cgi?id=1461270 When fetching stats for a vhost-user type of interface, we run couple of ovs-vsctl commands and parse their output. However, not all stats exist at all times, for instance "rx_dropped" or "tx_errors" can be missing. Thing is, we ask for a bulk of statistics and if one of them is missing an error is reported instead of returning the rest. Since we ignore errors, we fail to set statistics. Fix this by asking for each piece alone. Signed-off-by: Michal Privoznik <mprivozn> v3.4.0-165-gedaf13565 Test on below packages, the result is as expected. libvirt-3.7.0-2.el7.x86_64 openvswitch-2.8.0-0.1.20170810git3631ed2.el7fdb.x86_64 1. Set 2 guests with vhostuser type interface, then ping each other 2. on host check that there is no rx_error, and the statistics are right. # virsh domiflist vhost1 Interface Type Source Model MAC ------------------------------------------------------- vhost-user1 vhostuser - virtio 52:54:00:69:33:29 # virsh domiflist vhost2 Interface Type Source Model MAC ------------------------------------------------------- vhost-user2 vhostuser - virtio 52:54:00:93:51:db # virsh domifstat vhost1 vhost-user1 vhost-user1 rx_bytes 403278 vhost-user1 rx_packets 4188 vhost-user1 rx_drop 50 vhost-user1 tx_bytes 404706 vhost-user1 tx_packets 4206 vhost-user1 tx_errs 0 vhost-user1 tx_drop 0 # ovs-vsctl list interface ... name : "vhost-user1" ... statistics : {"rx_1024_to_1522_packets"=0, "rx_128_to_255_packets"=0, "rx_1523_to_max_packets"=0, "rx_1_to_64_packets"=125, "rx_256_to_511_packets"=0, "rx_512_to_1023_packets"=0, "rx_65_to_127_packets"=4082, rx_bytes=404706, rx_dropped=0, rx_errors=0, rx_packets=4206, tx_bytes=403278, tx_dropped=50, tx_packets=4188} Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:0704 *** Bug 1624273 has been marked as a duplicate of this bug. *** |