summaryrefslogtreecommitdiff
path: root/utilities/ovs-save
Commit message (Collapse)AuthorAgeFilesLines
* ovs-save: Replace "echo -n" with "printf"Timothy Redaelli2017-10-271-2/+2
| | | | | | | | This is neeed since "echo -n" is not POSIX and may not work with some shells. Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Flavio Leitner <fbl@sysclose.org>
* ovs-save: Use a file to restore flows instead of heredocTimothy Redaelli2017-10-271-6/+7
| | | | | | | | | | | This patch makes ovs-save to use a file to restore flows instead of using shell script here-document. This is needed since eval + here-documents are much slower than reading a file with the rules directly. Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Flavio Leitner <fbl@sysclose.org>
* ovs-save: Use --bundle to restore flows (on OpenFlow 1.4+)Timothy Redaelli2017-10-271-3/+19
| | | | | | | | | | | | If possible, use OpenFlow 1.4 atomic bundle transaction to restore flows. The patch uses also the highest enabled OpenFlow version to do the queries. With the actual implementation, if you have the default OpenFlow version disabled then ovs-save fails. This patch also fixes that problem. Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Flavio Leitner <fbl@sysclose.org>
* ovs-save: Use ${bridge} when dumping TLV map.Jesse Gross2016-09-151-1/+1
| | | | | | | | | The script accidentally hardcoded the bridge name as 'br-int', a leftover from testing. Reported-by: Huanle Han <hanxueluo@gmail.com> Signed-off-by: Jesse Gross <jesse@kernel.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovs-save: Restore tunnel TLV map before flows.Jesse Gross2016-08-301-0/+6
| | | | | | | | | | | | | Scripts that integrate OVS with a distribution often save and restore flows across disruptive events, such as an upgrade. The ovs-save utility generates a script to assist with this. When flows include tunnel metadata, we also need to restore the TLV mappings before the flows are re-added. Otherwise, the instance of OVS receiving the new flows won't know the meaning of these fields and will ignore them. Signed-off-by: Jesse Gross <jesse@kernel.org>
* ovs-save: Handle MTU changes correctly.Gurucharan Shetty2016-04-111-2/+2
| | | | | | | | | | | | | | | | The following command on ubuntu 12.04, 14.04 and CentOS 7.x returns null: expr "mtu 1500" : '.*mtu \([0-9]+\)' But the following works correctly: expr "mtu 1500" : '.*mtu \([0-9]\+\)' I am not sure about the portability implications as there seems to be very sparse documentation about this but this fixes a bug in 2 of the most popular distributions. VMware-BZ: #1638654 Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* ovs-ctl: Remove code for upgrading from Open vSwitch 1.9 and earlier.Ben Pfaff2016-03-161-35/+1
| | | | | | | | | OVS 1.10 was released in May 2013, so by the time current OVS is released, it will be about three years old. I think that this is long enough to remove special upgrade code from the startup scripts. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Jesse Gross <jesse@kernel.org>
* ovs-lib: Ability to move ip address and routes.Gurucharan Shetty2015-07-011-2/+2
| | | | | | | | | | | The ability to move IP address and routes between two interfaces is useful when we want to make a physical interface (say eth0) as a port of OVS bridge (say breth0) with all its IP address and route information transferred to OVS bridge. An upcoming commit uses the new ability. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-save: Refactor and move some code to ovs-lib.Gurucharan Shetty2015-07-011-55/+8
| | | | | | | | An upcoming commit becomes the second user of the new functions. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-save: Preserve IPv6 link-local address on interface save.Alexey I. Froloff2015-03-031-2/+3
| | | | | | | | | | If IPv6 link-local address is removed from interface, it is unable to receive any IPv6 packets, including Route Advertisements. In save_interface only skip IPv4 "scope link" addresses. Signed-off-by: Alexey I. Froloff <raorn@raorn.name> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Fix capitalization of OpenFlow.Justin Pettit2014-08-141-1/+1
| | | | | Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-save: Do not depend on hardcoded set of $PATH for utilities.Gurucharan Shetty2013-08-261-21/+6
| | | | | | Reported-by: Jian Qiu <swordqiu@gmail.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-vsctl: Try connecting only once for active connections by default.Ben Pfaff2013-03-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | 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>
* ovs-save: Add a helper command to maintain ofport value.Gurucharan Shetty2013-01-161-0/+33
| | | | | | | | | | | | | | | This patch adds a helper command: save-ofports. The command will o/p a shell script that will set the 'ofport_request' column of the interface table with the value of the corresponding ofport. This command takes a list of bridges as input and will be used by a future commit to restore the ofport value across force-reload-kmod. This command is only useful while trying to upgrade from a pre-1.10 branch to 1.10 or a later branch. Issue #13556 Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* ovs-ctl.in: Don't save kernel datapath config.Gurucharan Shetty2012-11-261-82/+0
| | | | | | | | | | | | | | | | | | | | | | | | Commit a41754333f6 (ovs-ctl.in: Ability to save flows and kernel datapath config.) made ovs-ctl able to usefully save and restore the flow table across loading and unloading the OVS kernel module and stopping and starting the OVS daemons. To ensure that the flow table was still meaningful, it ensured that the datapath port numbers were the same with the old and new versions of the kernel module. However, later commit e1b1d06afde (Separate OpenFlow port numbers from datapath ones.) changed the OpenFlow implementation so that keeping the same datapath port numbers no longer ensured that the OpenFlow port numbers would be the same. This caused a regression in saving and restoring the flow table. Although the flow table was still saved and restored, it was no longer useful, since the datapath port numbers might change. This commit does not fix the regression, but it does drop the code that saves and restores the port datapath numbers, since it is no longer useful. The following commit fixes the regression. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* netdev-vport: Warn users that pmtud is deprecatedAnsis Atteka2012-10-301-1/+1
| | | | | | | | | This is a complementary patch to the other one I sent out previously. The purpose of it is to make it more obvious that tunnel pmtud is deprecated and will be removed soon. Requested-by: Jesse Gross <jesse@nicira.com> Signed-off-by: Ansis Atteka <aatteka@nicira.com>
* ovs-save: Use timeout option for ovs-vsctlGurucharan Shetty2012-10-261-4/+8
| | | | | | | Running ovs-save directly to save datapath configuration can wait forever if ovsdb-server is not running. Use a timeout. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* ovs-ctl.in: Ability to save flows and kernel datapath config.Gurucharan Shetty2012-10-231-106/+228
| | | | | | | | | | | | | Add a new command - "restart" to ovs-ctl. Calling this command will save and restore the Openflow flows on each bridge while stopping and starting the userspace daemons respectively. Also, during a force-reload-kmod, save the flows and kernel datapath configuration. Use the saved datapath configuration while readding the kernel module and the flows while starting the userspace daemons. Feature #13555. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* Global replace of Nicira Networks.Raju Subramanian2012-05-021-1/+1
| | | | | | | | 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>
* ovs-save: Add "dev" keyword before interface names in the ip commandsAnsis Atteka2012-04-161-4/+4
| | | | | | | | | | | | | | | The "service force-reload-kmod" command did not work properly, if there was a bridge, which name was a prefix of string "broadcast" (e.g. "br"). To reproduce: ovs-vsctl add-br br service openvswitch-switch force-reload-kmod This patch will make sure that the generated ip commands are clearly interpretable by the ip utility. Issue #9841 Signed-off-by: Ansis Atteka <aatteka@nicira.com>
* ovs-save: Fix address label processing.Alexey I. Froloff2011-06-071-2/+3
| | | | | | | | | If there is a string in ip addr show output, that "coincide with the name of the device or ... prefixed with the device name followed by colon", consider this is an address label string. Signed-off-by: Alexey I. Froloff <raorn@altlinux.org> Signed-off-by: Ben Pfaff <blp@nicira.com>
* xenserver: Introduce "force-reload-kmod" to reload kernel module.Ben Pfaff2011-02-081-0/+157
Running "service openvswitch force-reload-kmod" will now save the kernel configuration state of Open vSwitch interfaces, stop the vswitch, unload the kernel module, reload the kernel module, restart the vswitch, and restore kernel configuration state. It is a reasonably safe way to upgrade or downgrade the Open vSwitch kernel module on a running system. Signed-off-by: Ben Pfaff <blp@nicira.com>