Skip to content

Commit

Permalink
ovn-docker: Update overlay mode for new tcp ports.
Browse files Browse the repository at this point in the history
There were changes made recently wherein 2 ovsdb-server is
started for northbound and southbound databases with tcp ports
6641 and 6642. This breaks Docker integration. This commit
fixes it.

Signed-off-by: Gurucharan Shetty <[email protected]>
Acked-by: Russell Bryant <[email protected]>
  • Loading branch information
shettyg committed Apr 7, 2016
1 parent 91644f4 commit d61fbed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
10 changes: 2 additions & 8 deletions INSTALL.Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ in a database. On one of your machines, with an IP Address of $CENTRAL_IP,
where you have installed and started Open vSwitch, you will need to start some
central components.

Begin by making ovsdb-server listen on a TCP port by running:

```
ovs-appctl -t ovsdb-server ovsdb-server/add-remote ptcp:6640
```

Start ovn-northd daemon. This daemon translates networking intent from Docker
stored in the OVN_Northbound database to logical flows in OVN_Southbound
database.
Expand Down Expand Up @@ -89,8 +83,8 @@ support in upstream Linux. You can verify whether you have the support in your
kernel by doing a "lsmod | grep $ENCAP_TYPE".)

```
ovs-vsctl set Open_vSwitch . external_ids:ovn-remote="tcp:$CENTRAL_IP:6640" \
external_ids:ovn-encap-ip=$LOCAL_IP external_ids:ovn-encap-type="$ENCAP_TYPE"
ovs-vsctl set Open_vSwitch . external_ids:ovn-remote="tcp:$CENTRAL_IP:6642" \
external_ids:ovn-nb="tcp:$CENTRAL_IP:6641" external_ids:ovn-encap-ip=$LOCAL_IP external_ids:ovn-encap-type="$ENCAP_TYPE"
```

And finally, start the ovn-controller. (You need to run the below command
Expand Down
12 changes: 6 additions & 6 deletions ovn/utilities/ovn-docker-overlay-driver
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ app = Flask(__name__)
vlog = ovs.vlog.Vlog("ovn-docker-overlay-driver")

OVN_BRIDGE = "br-int"
OVN_REMOTE = ""
OVN_NB = ""
PLUGIN_DIR = "/etc/docker/plugins"
PLUGIN_FILE = "/etc/docker/plugins/openvswitch.spec"

Expand Down Expand Up @@ -64,7 +64,7 @@ def ovs_vsctl(*args):

def ovn_nbctl(*args):
args_list = list(args)
database_option = "%s=%s" % ("--db", OVN_REMOTE)
database_option = "%s=%s" % ("--db", OVN_NB)
args_list.insert(0, database_option)
return call_prog("ovn-nbctl", args_list)

Expand All @@ -82,10 +82,10 @@ def ovn_init_overlay():
"external_ids:bridge-id=" + OVN_BRIDGE,
"other-config:disable-in-band=true", "fail-mode=secure")

global OVN_REMOTE
OVN_REMOTE = ovs_vsctl("get", "Open_vSwitch", ".",
"external_ids:ovn-remote").strip('"')
if not OVN_REMOTE:
global OVN_NB
OVN_NB = ovs_vsctl("get", "Open_vSwitch", ".",
"external_ids:ovn-nb").strip('"')
if not OVN_NB:
sys.exit("OVN central database's ip address not set")

ovs_vsctl("set", "open_vswitch", ".",
Expand Down

0 comments on commit d61fbed

Please sign in to comment.