This makes it easier to troubleshoot OVN in a sandbox when initial
contents for the NB/SB/OVS DBs are provided (e.g., from a production
environment).

A way to load the DBs locally and run OVN against them is:
$ SANDBOXFLAGS="--nbdb-source=path-to-nb.db --sbdb-source=path-to-sb.db 
--ovs-source=path-to-conf.db" make sandbox

Signed-off-by: Dumitru Ceara <[email protected]>
---
 tutorial/ovs-sandbox | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/tutorial/ovs-sandbox b/tutorial/ovs-sandbox
index d81e00496..2219b0e99 100755
--- a/tutorial/ovs-sandbox
+++ b/tutorial/ovs-sandbox
@@ -79,6 +79,8 @@ ovn_rbac=true
 n_northds=1
 n_ics=1
 n_controllers=1
+ovs_source=
+vtep_source=
 nbdb_model=standalone
 nbdb_servers=3
 nbdb_source=
@@ -307,6 +309,18 @@ EOF
         --sbdb-so*)
             prev=ovnsb_source
             ;;
+        --ovs-so*=*)
+            ovs_source=$optarg
+            ;;
+        --ovs-so*)
+            prev=ovs_source
+            ;;
+        --vtep-so*=*)
+            vtep_source=$optarg
+            ;;
+        --vtep-so*)
+            prev=vtep_source
+            ;;
         --ic-nb-s*=*)
             ic_nb_servers=$optarg
             ic_nb_model=clustered
@@ -474,10 +488,20 @@ trap 'kill `cat "$sandbox"/*.pid`' 0 1 2 3 13 14 15
 
 # Create database and start ovsdb-server.
 touch "$sandbox"/.conf.db.~lock~
-run ovsdb-tool create conf.db "$schema"
+if test ! -e "$ovs_source"; then
+    run ovsdb-tool create conf.db "$schema"
+else
+    run cp "$ovs_source" conf.db
+    run ovsdb-tool convert conf.db "$schema"
+fi
 ovsdb_server_args=
 
-run ovsdb-tool create vtep.db "$vtep_schema"
+if test ! -e "$vtep_source"; then
+    run ovsdb-tool create vtep.db "$vtep_schema"
+else
+    run cp "$vtep_source" vtep.db
+    run ovsdb-tool convert vtep.db "$vtep_schema"
+fi
 ovsdb_server_args="vtep.db conf.db"
 
 if [ "$HAVE_OPENSSL" = yes ]; then
-- 
2.27.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to