[ovs-dev] [PATCH v1] Enable manager_option configuation for NB and SB
Amitabha Biswas
azbiswas at gmail.com
Tue Jul 19 05:21:09 UTC 2016
NB and SB dbs are handled by separate ovsdb-server processes. The
ovsdb-server processes manage dbs based on the schemas for OVN NorthBound
and SouthBound. These schemas do not have any Manager Options similar
to the Open_vSwitch schema. As a result, for e.g., the frequency of
inactivity probes sent to clients from the ovsdb-server cannot be
modified.
This patch addresses the above problem by creating independent
"conf.db"s for NB and SB. The ovsdb-server process which handles
the NB will handle a NB_conf.db as well, ditto for the ovsdb-server
that handles the SB.
A similar result can be obtained by adding a Manager Table to the
NorthBound and SouthBound DBs as well. In such case there would
not be a need for a separate "config" database. I'm willing to
consider this solution as well pending feedback.
Sample Calls for modifying the inactivity probe timeout value:
ovs-appctl -t /usr/local/var/run/openvswitch/ovnnb_db.ctl vlog/set any:any:dbg
ovs-appctl -t /usr/local/var/run/openvswitch/ovnnb_db.ctl ovsdb-server/list-remotes
manager_ip=`ovs-appctl -t /usr/local/var/run/openvswitch/ovnnb_db.ctl ovsdb-server/list-remotes | grep ptcp | awk -F\: '{print $3}'`
manager_port=`ovs-appctl -t /usr/local/var/run/openvswitch/ovnnb_db.ctl ovsdb-server/list-remotes | grep ptcp | awk -F\: '{print $2}'`
ovs-vsctl --db=unix:/usr/local/var/run/openvswitch/ovnnb_db.sock --no-wait set-manager ptcp:$manager_port:$manager_ip
ovs-vsctl --db=unix:/usr/local/var/run/openvswitch/ovnnb_db.sock list Manager
manager_uuid=`ovs-vsctl --db=unix:/usr/local/var/run/openvswitch/ovnnb_db.sock list Manager | grep _uuid | awk -F\: '{print $2}'`
manager_uuid=${manager_uuid//[[:blank:]]/}
ovs-vsctl --db=unix:/usr/local/var/run/openvswitch/ovnnb_db.sock --no-wait set Manager $manager_uuid inactivity_probe=0
ovs-vsctl --db=unix:/usr/local/var/run/openvswitch/ovnnb_db.sock list Manager
ovs-vsctl --db=unix:/usr/local/var/run/openvswitch/ovnnb_db.sock --no-wait set Manager $manager_uuid inactivity_probe=5
Signed-off-by: Amitabha Biswas <abiswas at us.ibm.com>
---
ovn/utilities/ovn-ctl | 21 +++++++++++++++++----
ovn/utilities/ovn-ctl.8.xml | 2 ++
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/ovn/utilities/ovn-ctl b/ovn/utilities/ovn-ctl
index dad6db6..384d876 100755
--- a/ovn/utilities/ovn-ctl
+++ b/ovn/utilities/ovn-ctl
@@ -49,22 +49,30 @@ start_ovsdb () {
# Check and eventually start ovsdb-server for Northbound DB
if ! pidfile_is_running $DB_NB_PID; then
upgrade_db "$DB_NB_FILE" "$DB_NB_SCHEMA" 1>/dev/null 2>/dev/null
+ upgrade_db "$DB_NB_CONF" "$DB_CONF_SCHEMA" 1>/dev/null 2>/dev/null
set ovsdb-server
- set "$@" --detach $OVN_NB_LOG --log-file=$OVN_NB_LOGFILE --remote=punix:$DB_NB_SOCK --remote=ptcp:$DB_NB_PORT:$DB_NB_ADDR --pidfile=$DB_NB_PID --unixctl=ovnnb_db.ctl
+ set "$@" --detach $OVN_NB_LOG --log-file=$OVN_NB_LOGFILE \
+ --remote=db:Open_vSwitch,Open_vSwitch,manager_options \
+ --remote=punix:$DB_NB_SOCK --remote=ptcp:$DB_NB_PORT:$DB_NB_ADDR \
+ --pidfile=$DB_NB_PID --unixctl=ovnnb_db.ctl
- $@ $DB_NB_FILE
+ $@ $DB_NB_FILE $DB_NB_CONF
fi
# Check and eventually start ovsdb-server for Southbound DB
if ! pidfile_is_running $DB_SB_PID; then
upgrade_db "$DB_SB_FILE" "$DB_SB_SCHEMA" 1>/dev/null 2>/dev/null
+ upgrade_db "$DB_SB_CONF" "$DB_CONF_SCHEMA" 1>/dev/null 2>/dev/null
set ovsdb-server
- set "$@" --detach $OVN_SB_LOG --log-file=$OVN_SB_LOGFILE --remote=punix:$DB_SB_SOCK --remote=ptcp:$DB_SB_PORT:$DB_SB_ADDR --pidfile=$DB_SB_PID --unixctl=ovnsb_db.ctl
- $@ $DB_SB_FILE
+ set "$@" --detach $OVN_SB_LOG --log-file=$OVN_SB_LOGFILE \
+ --remote=db:Open_vSwitch,Open_vSwitch,manager_options \
+ --remote=punix:$DB_SB_SOCK --remote=ptcp:$DB_SB_PORT:$DB_SB_ADDR \
+ --pidfile=$DB_SB_PID --unixctl=ovnsb_db.ctl
+ $@ $DB_SB_FILE $DB_SB_CONF
fi
}
@@ -159,17 +167,20 @@ set_defaults () {
DB_NB_SOCK=$rundir/ovnnb_db.sock
DB_NB_PID=$rundir/ovnnb_db.pid
DB_NB_FILE=$dbdir/ovnnb_db.db
+ DB_NB_CONF=$dbdir/ovnnb_conf.db
DB_NB_ADDR=0.0.0.0
DB_NB_PORT=6641
DB_SB_SOCK=$rundir/ovnsb_db.sock
DB_SB_PID=$rundir/ovnsb_db.pid
DB_SB_FILE=$dbdir/ovnsb_db.db
+ DB_SB_CONF=$dbdir/ovnsb_conf.db
DB_SB_ADDR=0.0.0.0
DB_SB_PORT=6642
DB_NB_SCHEMA=$datadir/ovn-nb.ovsschema
DB_SB_SCHEMA=$datadir/ovn-sb.ovsschema
+ DB_CONF_SCHEMA=$datadir/vswitch.ovsschema
DB_SOCK=$rundir/db.sock
DB_CONF_FILE=$dbdir/conf.db
@@ -245,7 +256,9 @@ Options:
File location options:
--db-sock=SOCKET JSON-RPC socket name (default: $DB_SOCK)
--db-nb-file=FILE OVN_Northbound db file (default: $DB_NB_FILE)
+ --db-nb-conf=FILE NB Open_vSwitch conf file (default: $DB_NB_CONF)
--db-sb-file=FILE OVN_Southbound db file (default: $DB_SB_FILE)
+ --db-sb-conf=FILE SB Open_vSwitch conf file (default: $DB_SB_CONF)
--db-nb-schema=FILE OVN_Northbound db file (default: $DB_NB_SCHEMA)
--db-sb-schema=FILE OVN_Southbound db file (default: $DB_SB_SCHEMA)
--db-nb-addr=ADDR OVN Northbound db ptcp address (default: $DB_NB_ADDR)
diff --git a/ovn/utilities/ovn-ctl.8.xml b/ovn/utilities/ovn-ctl.8.xml
index 89ad934..2dff60e 100644
--- a/ovn/utilities/ovn-ctl.8.xml
+++ b/ovn/utilities/ovn-ctl.8.xml
@@ -31,7 +31,9 @@
<h1>File location options</h1>
<p><code>--db-sock==<var>SOCKET</var></code></p>
<p><code>--db-nb-file==<var>FILE</var></code></p>
+ <p><code>--db-nb-conf==<var>FILE</var></code></p>
<p><code>--db-sb-file==<var>FILE</var></code></p>
+ <p><code>--db-sb-conf==<var>FILE</var></code></p>
<p><code>--db-nb-schema==<var>FILE</var></code></p>
<p><code>--db-sb-schema==<var>FILE</var></code></p>
--
2.7.4 (Apple Git-66)
More information about the dev
mailing list