2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-27 15:18:06 +00:00
Commit Graph

59 Commits

Author SHA1 Message Date
Huanle Han
adfb6580f0 ovs-bugtool: Remove argument of "ovs-appctl dpif/show".
"ovs-appctl dpif/show" no longer takes any argument after commit dc54ef36
(ofproto: Track subfacet stats in the backer).

Signed-off-by: Huanle Han <hanxueluo@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-07-06 08:15:59 -07:00
Ben Pfaff
90bcf7a507 ovs-bugtool: Improve manpage.
The manpage was poorly organized and failed to mention some options.

Example provided by Gurucharan Shetty <gshetty@nicira.com>.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
2015-03-04 14:20:05 -08:00
Ben Pfaff
7be0b8a0b0 ovs-bugtool: Add --help message.
Seemed a little embarrassing when I realized that ovs-bugtool has no usage
message on a customer call this morning.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-01-30 13:22:33 -08:00
Joe Stringer
ec26264171 ovs-bugtool: Log more detail for dumped flows.
The standard mode for printing flows doesn't always provide the full
range of information that is available, particularly with the UFID
changes. Turn on more detail.

Suggested-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
2014-12-05 13:17:06 -08:00
Andy Zhou
24adf5d684 ovs-bugtool: Add fdb output for all bridges
Fdb entries can provide useful information. Collect them in bugtool.

Signed-off-by: Andy Zhou <azhou@nicira.com>
2014-10-09 11:40:02 -07:00
Gurucharan Shetty
ccb0ca0333 ovs-bugtool: Remove reference to an undefined variable.
commit 1d5aaa61f (ovs-controller: Rename test-controller and do not
install or package.) removed a variable definition but not its use.
Fix it.

Bug #20901.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2013-11-05 13:22:07 -08:00
Ben Pfaff
1d5aaa61fa ovs-controller: Rename test-controller and do not install or package.
Too many users have incorrectly assumed that ovs-controller is a necessary
or desirable part of an Open vSwitch deployment.  This commit should fix
the problem by renaming it test-controller and removing it from the
default install and from packaging.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-11-02 21:06:45 -07:00
Shih-Hao Li
b136128927 ovs-bugtool: Change log-days parameter based on file last_mod_time.
Previously the log-days parameter can only support rotated logs
based on their numbered filename extension. Thus it can not be
used for other types of log filenames. This patch changes it to
be based on file last modification time.

Issue: #19671

Signed-off-by: Shih-Hao Li <shihli@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-09-27 14:55:43 -07:00
Shih-Hao Li
4e0abe6e1a ovs-bugtool: Limit disk usage
When output to a file with "--unlimited" unset,
only allow 90% of the free disk space to be used.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-09-26 13:00:44 -07:00
Gurucharan Shetty
1cad56e16c ovs-bugtool: Add config files to the debug bundle.
The previously defined config files were never included in
the debug bundle. This will include them.

Also increase the max size for CAP_NETWORK_CONFIG to 5 MB.
A pre-compressed size of 5 MB does not amount to much after
compression for config files.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2013-08-09 14:07:43 -07:00
Gurucharan Shetty
3475802232 ovs-bugtool: Collect database through CAP_NETWORK_STATUS.
Currently the openvswitch database is being collected with
CAP_NETWORK_CONFIG which has a max size of 50 KB. This is
quite low as the database can easily be larger than 50 KB.

Move database collection to CAP_NETWORK_STATUS which does
not have a max size. If database size exceeds 10 MB, create
a compacted version of it and then collect it.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2013-08-09 14:04:25 -07:00
Gurucharan Shetty
dad0f0e793 ovs-bugtool: Increase max size of CAP_HARDWARE_INFO.
Current size feels very low when we are collecting o/p of
'dmidecode' and 'lspci -vv'

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-07-24 10:31:08 -07:00
Gurucharan Shetty
eb6f308927 ovs-bugtool: Separate capability for general network info.
Current situation is that CAP_NETWORK_STATUS has a max size of 50 MB.
When we have around 100,000 openflow flows, we over-run that size
by just running the "ovs-ofctl dump-flows" command. All the openvswitch
commands run through the plugin scripts in this repo won't have its
data stored in the debug bundle in this case as they are part of
CAP_NETWORK_STATUS too. One option to correct this is to increase
the CAP_NETWORK_STATUS max size to a higher number. But CAP_NETWORK_STATUS
also includes a bunch of general network related information collected
by running commands like ethtool, tc etc. and we probably want to limit
the data collected through those commands.

With this commit, we create a new capability called CAP_NETWORK_INFO
and collect general network related information through them. For OVS
related information, we continue to use CAP_NETWORK_STATUS, but remove
the maximum size restriction. One rationale to keep OVS related
information in CAP_NETWORK_STATUS is because xen-bugtool probably expects
OVS information in that capability.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-07-24 10:30:15 -07:00
Gurucharan Shetty
00c7bf8b13 ovs-bugtool: Remove duplicate bond/show command.
ovs-appctl bond/show is being run through the plugin by
calling the script ovs-bugtool-bond-show.

So remove the redundant code.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-07-24 10:29:55 -07:00
Pavithra Ramesh
ee5ce4915b BFD: Add BFD output to bugtool
This change includes the output of ovs-appctl bfd/show to
ovs-bugtool output.

Signed-off-by: Pavithra Ramesh <paramesh@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-07-17 09:16:30 -07:00
Gurucharan Shetty
a4fff9cc39 ovs-bugtool: Add ovsdb-server/list-dbs command to bugtool.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2013-07-10 10:20:41 -07:00
Gurucharan Shetty
740f68d71a ovs-bugtool: Add ovs-appctl dpif commands to debug bundle.
With single datapath, 'ovs-dpctl dump-flows ' dumps datapath flows for
all the userspace bridges in a system. It can get a little harder
to figure out the datapath flows belonging to a particular userspace
bridge.

This patch adds the 'ovs-appctl dpif/show' and 'ovs-appctl dpif/dump-flows'
output for each userspace bridge. This gives us a summary of configured
datapaths and all datapath flow entries for each bridge separately.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-03-25 10:09:23 -07:00
Gurucharan Shetty
62182ac9fa ovs-bugtool: Add iptables output for all tables.
Currently we list all the rules only from the 'filter' table.
Include the rules from all the other tables too.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-03-25 08:41:18 -07:00
Gurucharan Shetty
9933c207b5 ovs-bugtool: Add ovs-ofctl commands to bugtool plugin scripts.
This patch adds two new scripts that run "ovs-ofctl show" and
"ovs-ofctl dump-flows" on each bridge.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-03-21 14:25:08 -07:00
Gurucharan Shetty
5bcd75e596 ovs-bugtool: Remove calls of ovs-ofctl on ovs-system.
With single datapath, making ovs-ofctl calls on ovs-system
does not give the necessary o/p. This patch removes those calls.

The next patch adds the correct commands to bugtool plugin scripts.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-03-21 14:25:08 -07:00
Ben Pfaff
fba6bd1d3f ovs-vsctl: Try connecting only once for active connections by default.
Until now, ovs-vsctl has kept trying to the database server until it
succeeded or the timeout expired (if one was specified with --timeout).
This meant that if ovsdb-server wasn't running, then ovs-vsctl would hang.
The result was that almost every ovs-vsctl invocation in scripts specified
a timeout on the off-chance that the database server might not be running.
But it's difficult to choose a good timeout.  A timeout that is too short
can cause spurious failures.  A timeout that is too long causes long delays
if the server really isn't running.

This commit should alleviate this problem.  It changes ovs-vsctl's behavior
so that, if it fails to connect to the server, it exits unsuccessfully.
This makes --timeout obsolete for the purpose of avoiding a hang if the
database server isn't running.  (--timeout is still useful to avoid a hang
if ovsdb-server is running but ovs-vswitchd is not, for ovs-vsctl commands
that modify the database.  --no-wait also avoids that issue.)

Bug #2393.
Bug #15594.
Reported-by: Jeff Merrick <jmerrick@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-03-15 16:26:47 -07:00
Gurucharan Shetty
c067cd1234 ovs-bugtool: Add ovs-ctl.log to debug bundle.
ovs-ctl.log will include the o/p of ovs-ctl when
run from rhel, debian and xenserver startup scripts.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-03-15 09:17:16 -07:00
Gurucharan Shetty
54e536a64f ovs-bugtool: Ability to collect number of logs through plugins.
A new option "--log-days" recently added lets us to control the
number of rotated logs included in the debug bundle. This option
only works on log files defined inside the ovs-bugtool code.

This patch lets us to do the same with logs collected through plugins.

The example format inside a plugin is:
<files type="logs">
    /var/log/one
</files>

This will collect one, one.[1-x], one.[1-x].gz. Where 'x' is 20
by default and can be controlled by the option '--log-days' passed
to ovs-bugtool.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-02-25 13:10:47 -08:00
Shih-Hao Li
4a39a40aba Add binary option for command outputs collected by ovs-bugtool
Current ovs-bugtool collects command outputs as text strings.
Thus it reads the output by lines. For commands that generate
huge binary data, it becomes very inefficient to read the output.

The change here is to use a 1MB buffer to read binary data
instead of reading them by lines.

Signed-off-by: Shih-Hao Li <shihli@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-02-25 12:33:00 -08:00
Gurucharan Shetty
8d79e6a020 ovs-bugtool: Remove unused code and nonrequired commands.
There is some code that is unused and some commands whose
output we probably don't need to debug openvswitch issues.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-02-14 14:14:33 -08:00
Gurucharan Shetty
f07902cdc0 ovs-bugtool: Change the default output type.
In my tests, I see that creating a tar.gz takes a lot less
time than creating a tar.bz2. The difference in compressed
size of the debug bundle is not much different when either
of the above is used. So, use tar.gz as the default debug
bundle type.

Test results in my setup:
For an uncompressed debug bundle size of 250MB(95% of it is log files),
bz2 takes 50 seconds whereas gz takes 8 seconds. xz took 90 seconds.
gz, bz2 and xz compressed the debug bundle into 144M, 139M and 131M
respectively.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-02-14 14:14:33 -08:00
Gurucharan Shetty
65e0f34ea8 ovs-bugtool: Don't run a few ethtool commands on virtual devices.
There can be a few hundred virtual interfaces in a hypervisor.
Some of the ethtool commands that we currently run on these devices
probably does not provide any extra information. So remove them
for tap and vif interfaces.

Also bump up the size limitation for CAP_NETWORK_STATUS. The
current value is quite low and a 50 MB limit pre-compression
does not add much to the overall size.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-02-14 14:14:33 -08:00
Gurucharan Shetty
ced171980c ovs-bugtool: Ability to collect the number of rotated logs.
A big reason for a large debug bundle size is the size of log
files. By default we collect 20 rotated logs for each logfile.
Most of the times we collect the debug bundle as soon as we
hit a bug. In such cases, we know that we need only one day's
worth of logs.

This patch adds an option, '--log-days' to ovs-bugtool wherein
we can specify how many days worth of rotated logs do we need
as part of the debug bundle.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-02-14 14:14:33 -08:00
Gurucharan Shetty
659fd90c57 ovs-bugtool: Provide a separate capability to openvswitch logs.
Currently we have a 50 MB size limitation for all logs. This looks
quite less because a single uncompressed log can be 50 MB which
will result in ovs-bugtool picking a single log.

While debugging issues related to openvswitch, it is important that
we have all logs related to openvswitch atleast. This patch provides
a new capability for openvswitch logs with no size limitation. This
should not be a problem since compression reduces the size of the logs
quite a bit.

Also increase the size limitation for the regular system logs to 200 MB.

A future commit adds an option '--log-days' to control the number of logs
that we collect.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-02-14 14:14:33 -08:00
Ethan Jackson
5115299cb8 bugtool: Add manpage to gitignore.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2013-01-07 15:24:47 -08:00
Saul St. John
77465eb393 manpages: Fix build
This patch fixes regressions in the dist and distclean targets, and in
the Debian build process, that were introduced by commit d2cb6c956b
(manpages: Put version number instead of date at bottom of page.).

Signed-off-by: Saul St. John <sstjohn@cs.wisc.edu>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-01-04 19:21:07 -08:00
Ben Pfaff
d2cb6c956b manpages: Put version number instead of date at bottom of page.
We're really good about keeping manpages up to date, but terrible at
updating the dates at the bottom of the manpages.  So, instead of using
manually updated dates, this commit switches to using automatically updated
version numbers.

We can only use automatically updated version numbers for manpages that
we preprocess, that is, the manpages whose sources end with ".in".  This
excludes a couple of manpages that don't actually get installed with OVS,
such as the manpages for ovs-ctl and ovsdb-idlc.  This commit doesn't
change those manpages.  It does change the ovs-bugtool manpage to one that
is preprocessed so that we can use the version there.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
2013-01-04 09:02:06 -08:00
Pravin B Shelar
5ca1ba484b openvswitch: Remove Linux bridge compatibility.
Currently brcompat does not work on master due to recent
datapath changes. We have decided to remove it as it is
not used very widely.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2012-12-27 13:48:51 -08:00
Ben Pfaff
f973f2af2f Make the location of the database separately configurable.
The default is unchanged, /etc/openvswitch/conf.db.

This makes it possible to transition each Open vSwitch packaging from
/etc/openvswitch/conf.db to /var/lib/openvswitch/conf.db independently.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-01 10:55:57 -07:00
Arun Sharma
b592e72628 ovs-bugtool: Added --ovs option to get only ovs related information
Option --ovs is added for ovs-bugtool command to collect
only OpenvSwitch relevant information. To perform
filtering in plugins, a new xml attribute filters="ovs" (optional)
would be required in element 'command','files','directory' in
openvswitch.xml. Value of 'filters' attribute will be compared
with filtering option in load_plugins to get all relevant operation
to collect information. If no "--ovs" option is passed then it will
behave as earlier.

Fixed an issue which occurs in scenario where option '--yestoall'
is not passed and user keeps entering "y" or "n" on prompt.

Plus, trailing whitespaces are fixed. White space before '=' and
after in function def and call is also fixed.

Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-19 10:21:39 -07:00
Gurucharan Shetty
74e60d69ad ovs-bugtool: Avoid running ethtool on non-physical devices.
There can be possibilities where there are hundreds of OVS
internal devices. In such a situation, running ovs-bugtool
can take a very long time to complete as multiple ethtool
commands are run on each interface in /sys/class/net. Once
the ovs-bugtool completes, most of the ethtool command outputs
would be incomplete with "timeouts" as we only give 30 seconds
for CAP_NETWORK_STATUS.

With the following patch, we only run ethtools on those interfaces
that have an associated "device". All physical interfaces have
this entry in /sys/class/net/${interface_name}/. Virtual interfaces
can have this entry too, if it has an underlying virtual device.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2012-06-25 15:02:14 -07:00
Ben Pfaff
0d08568461 Add support for tracking and logging daemon memory usage.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-22 10:32:05 -07:00
Gurucharan Shetty
a122b0fa65 ovs-bugtool: Close file descriptors after use.
In ovs-bugtool, we do a bunch of Popen calls to
get the results of some shell commands with stdout
set to PIPE. Once we are done, we need to
close the file descriptors.

Bug #11083.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2012-05-11 14:49:02 -07:00
Arun Sharma
ab7b77bbf7 bugtool: rename label names in plugins related to ovs-appctl
It improves to have proper out file name in bugtool archive with respect
to ovs-appctl commands. E.g. if command is 'ovs-appctl lacp/show' then
the related out file will be 'ovs-appctl-lacp-show.out'

Feature #11283.
Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-10 09:11:42 -07:00
Arun Sharma
271c896ee4 bugtool: Collect bond state information from ovs.
This is an enhancement in bugtool archive output to determine the bond
state information. It is implemented as a plugin which internally calls
"ovs-appctl bond/show" command to get bond state.

Feature #11283.
Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-10 09:10:52 -07:00
Raju Subramanian
e0edde6fee Global replace of Nicira Networks.
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc.

Feature #10593
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02 17:08:02 -07:00
Ben Pfaff
e09616c6c9 ovs-bugtool: Add "ovs-vsctl show" output to bugtool.
The information output by "ovs-vsctl show" is a subset of that available
elsewhere in bugtool output, but it is human-readable instead of needing
to be processed through ovsdb-server or ovsdb-tool, so it is much more
convenient for basic diagnosis.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-30 11:38:59 -07:00
Ben Pfaff
e2dfe6d3a8 ovs-bugtool: Add "ovs-appctl coverage/show" output to bugtool.
This can be useful for diagnosis.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-30 11:38:59 -07:00
Arun Sharma
a2af1e9dd9 bugtool - Collect version information for all running Open vSwitch daemons.
This is an improvement in {ovs|xen}-bugtool archive output to determine the
version which was running for all the OVS daemons. It is implemented as a
plugin which internally calls "ovs-appctl -t <daemon> version" command for
daemons whose pid file is present in /var/run/openvswitch directory.

Feature #10383
Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com>
[blp@nicira.com updated debian/copyright.in]
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-05 13:01:51 -07:00
Raju Subramanian
42d89d2a61 ovs-bugtool: Add ability to prioritize files by date.
When size limit is reached in the middle of processing a dir,
the report ends up containing oldest files. This change adds
an optional param in the plugin to prioritize newer files.

Feature #9937
Requested-by: Ronald Lee <rlee@nicira.com>
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-26 15:41:14 -07:00
Chris Wright
4b38c153a9 bugtool: move plugins data from /etc/openvswitch to /usr/share/openvswitch
This is in repsonse to the following rpmlint warnings:

 W: non-conffile-in-etc /etc/openvswitch/bugtool-plugins/system-configuration/openvswitch.xml
 W: non-conffile-in-etc /etc/openvswitch/bugtool-plugins/system-logs/openvswitch.xml
 W: non-conffile-in-etc /etc/openvswitch/bugtool-plugins/system-configuration.xml
 W: non-conffile-in-etc /etc/openvswitch/bugtool-plugins/network-status/openvswitch.xml
 W: non-conffile-in-etc /etc/openvswitch/bugtool-plugins/kernel-info/openvswitch.xml

The xenserver specfile still places them in /etc/xensource/bugtool since
that's a distro policy.  Of course, the rpmlint warnings are as well,
however, this seems like a more logical place for the bugtool plugins.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-12-09 09:32:38 -08:00
Chris Wright
b4059eff4a Update FSF address in LGPL notices in bugtool plugins.
This quiets the rpmlint errors:
 E: incorrect-fsf-address /etc/openvswitch/bugtool-plugins/system-configuration/openvswitch.xml
 E: incorrect-fsf-address /etc/openvswitch/bugtool-plugins/system-logs/openvswitch.xml
 E: incorrect-fsf-address /etc/openvswitch/bugtool-plugins/system-configuration.xml
 E: incorrect-fsf-address /etc/openvswitch/bugtool-plugins/network-status/openvswitch.xml
 E: incorrect-fsf-address /etc/openvswitch/bugtool-plugins/kernel-info/openvswitch.xml

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-12-09 09:28:18 -08:00
Ben Pfaff
6ca376775e Implement automatic dependency generation for manpages.
This ensures that manpages actually get rebuilt if any of the lib/*.man
fragments that they depend upon are modified.
2011-10-26 16:06:37 -07:00
Ben Pfaff
d0c0b87f1e ovs-bugtool: Improve how Open vSwitch log files are saved.
This moves the OVS log files from the "network-status" capability, which
has a very small maximum size, to the "system-logs" capability, which is
much larger.  It ensures that the newest OVS log files are prioritized over
old versions of system log files (if we just added the OVS log files after
the existing file_output, then new OVS log files would only be included
*after* all archived system log files were added).

Bug #5443.
2011-10-24 09:14:12 -07:00
Ben Pfaff
2cd2c2ef3d ovs-bugtool: Add -s to "ovs-dpctl show" command, to show vport statistics.
It would be nice to include this in xen-bugtool output too but that would
require Citrix to patch xen-bugtool directly.

Bug #7628.
Reported-by: Ethan Jackson <ethan@nicira.com>
2011-10-10 10:29:49 -07:00