Skip to content

Commit

Permalink
Move openvswitch db file into docker volume
Browse files Browse the repository at this point in the history
openvswitch db file is created in /etc/openvswitch/conf.db. It will be
lost during upgrade openvswitch_db container.

This patch moves the db file into /var/lib/openvswitch folder, which
located in docker volume.

Change-Id: I73604fddacd21655590b9e66ee2805014795b9f1
Closes-Bug: #1649290
  • Loading branch information
jeffrey4l authored and Jeffrey Zhang committed Dec 15, 2016
1 parent d023e86 commit f62b16f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docker/openvswitch/openvswitch-db-server/extend_start.sh
@@ -1,6 +1,6 @@
#!/bin/bash

mkdir -p "/run/openvswitch"
if [[ ! -e "/etc/openvswitch/conf.db" ]]; then
ovsdb-tool create "/etc/openvswitch/conf.db"
if [[ ! -e "/var/lib/openvswitch/conf.db" ]]; then
ovsdb-tool create "/var/lib/openvswitch/conf.db"
fi
Expand Up @@ -19,12 +19,12 @@ ovs_ext_intf=$3
if [ ! -e $ovs_bridge ] && [ ! -e $ovs_ext_intf ]; then
# NOTE: (sbezverk) This part is executed only by kubernetes deployment.
# Creating external bridge
/usr/sbin/ovsdb-server /etc/openvswitch/conf.db --remote=punix:/var/run/openvswitch/db.sock --run="ovs-vsctl --no-wait --db=unix:/var/run/openvswitch/db.sock add-br $ovs_bridge"
/usr/sbin/ovsdb-server /var/lib/openvswitch/conf.db --remote=punix:/var/run/openvswitch/db.sock --run="ovs-vsctl --no-wait --db=unix:/var/run/openvswitch/db.sock add-br $ovs_bridge"
# Plug the external interface into the external bridge.
/usr/sbin/ovsdb-server /etc/openvswitch/conf.db --remote=punix:/var/run/openvswitch/db.sock --run="ovs-vsctl --no-wait --db=unix:/var/run/openvswitch/db.sock add-port $ovs_bridge $ovs_ext_intf"
/usr/sbin/ovsdb-server /var/lib/openvswitch/conf.db --remote=punix:/var/run/openvswitch/db.sock --run="ovs-vsctl --no-wait --db=unix:/var/run/openvswitch/db.sock add-port $ovs_bridge $ovs_ext_intf"
# Run ovsdb server process
/usr/sbin/ovsdb-server /etc/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/var/run/openvswitch/db.sock --remote=ptcp:6640 --log-file=/var/log/kolla/openvswitch/ovsdb-server.log
/usr/sbin/ovsdb-server /var/lib/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/var/run/openvswitch/db.sock --remote=ptcp:6640 --log-file=/var/log/kolla/openvswitch/ovsdb-server.log
else
# NOTE: (sbezverk) This part is executed only by kolla-ansible deployment.
/usr/sbin/ovsdb-server /etc/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/run/openvswitch/db.sock --remote=ptcp:6640:$ovsdb_ip --log-file=/var/log/kolla/openvswitch/ovsdb-server.log
/usr/sbin/ovsdb-server /var/lib/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/run/openvswitch/db.sock --remote=ptcp:6640:$ovsdb_ip --log-file=/var/log/kolla/openvswitch/ovsdb-server.log
fi

0 comments on commit f62b16f

Please sign in to comment.