On 03/28/2014 05:02 AM, Ben Pfaff wrote:
From: Andy Zhou <az...@nicira.com>
ovs-vsctl is a command-line interface to the Open vSwitch database,
and as such it just modifies the desired Open vSwitch configuration in
the database. ovs-vswitchd, on the other hand, monitors the database
and implements the actual configuration specified in the database.
This can lead to surprises when the user makes a change to the
database, with ovs-vsctl, that ovs-vswitchd cannot actually
implement. In such a case, the ovs-vsctl command silently succeeds
(because the database was successfully updated) but its desired
effects don't actually take place. One good example of such a change
is attempting to add a port with a misspelled name (e.g. ``ovs-vsctl
add-port br0 fth0'', where fth0 should be eth0); another is creating
a bridge or a port whose name is longer than supported
(e.g. ``ovs-vsctl add-br'' with a 16-character bridge name on
Linux). It can take users a long time to realize the error, because it
requires looking through the ovs-vswitchd log.
The patch improves the situation by checking whether operations that
ovs executes succeed and report an error when
they do not. This patch only report add-br and add-port
operation errors by examining the `ofport' value that
ovs-vswitchd stores into the database record for the newly created
interface. Until ovs-vswitchd finishes implementing the new
configuration, this column is empty, and after it finishes it is
either -1 (on failure) or a positive number (on success).
Signed-off-by: Andy Zhou <az...@nicira.com>
Co-authored-by: Thomas Graf <tg...@redhat.com>
Signed-off-by: Thomas Graf <tg...@redhat.com>
Co-authored-by: Ben Pfaff <b...@nicira.com>
Signed-off-by: Ben Pfaff <b...@nicira.com>
---
v3->v4: See http://openvswitch.org/pipermail/dev/2014-March/038164.html for
changes.
LGTM, thanks!
While looking into extending ovs-vsctl show to report failed port
configurations I figured it would be nice to have an exit code to
make it scriptable.
Obviously we don't want to change behaviour of ovs-vsctl show in
terms of exit code. So how about a new command 'ovs-vsctl status'
which acts as a dashboard. It would be based on 'show' but without
port options to keep it simple. Instead ofport status is included.
It would also include the error message that we store for each
failed port and bridge in a new column. The exit code can be defined
as the number of configuration failures. Thoughts?
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev