Skip to content

Commit

Permalink
ovn: l3ha, NBDB and SBDB changes and documentation
Browse files Browse the repository at this point in the history
This commit introduces the north and south db changes necessary for
the l3ha router implementation.

It defines a new Table in both NBDB and SBDB.

The Gateway_Chassis table is created, with a tiny difference between
NBDB and SBDB, NBDB references the chassis via it's name (chassis_name)
and SBDB references the chassis via reference (chassis) to the Chassis table.

In NBDB a new column (gateway_chassis) is added to Logical_Router_Ports
with a list of Gateway_Chassis which can be empty.

In SBDB a new column (gateway_chassis) is added to Port_Binding with
the same list, this column will be used for ports of type chassis-redirect.

Bump minor version since we've added new backwards compatible features.

Co-authored-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Miguel Angel Ajo <majopela@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
  • Loading branch information
mangelajo and russellb committed Jul 16, 2017
1 parent f23ab8b commit 2ba1121
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 7 deletions.
28 changes: 25 additions & 3 deletions ovn-nb.ovsschema
@@ -1,7 +1,7 @@
{
"name": "OVN_Northbound",
"version": "5.6.0",
"cksum": "2552205612 15123",
"version": "5.7.0",
"cksum": "3754583060 16164",
"tables": {
"NB_Global": {
"columns": {
Expand Down Expand Up @@ -196,6 +196,12 @@
"Logical_Router_Port": {
"columns": {
"name": {"type": "string"},
"gateway_chassis": {
"type": {"key": {"type": "uuid",
"refTable": "Gateway_Chassis",
"refType": "strong"},
"min": 0,
"max": "unlimited"}},
"options": {
"type": {"key": "string",
"value": "string",
Expand Down Expand Up @@ -293,4 +299,20 @@
"value": "string",
"min": 0,
"max": "unlimited"}}},
"maxRows": 1}}}
"maxRows": 1},
"Gateway_Chassis": {
"columns": {
"name": {"type": "string"},
"chassis_name": {"type": "string"},
"priority": {"type": {"key": {"type": "integer",
"minInteger": 0,
"maxInteger": 32767}}},
"external_ids": {
"type": {"key": "string", "value": "string",
"min": 0, "max": "unlimited"}},
"options": {
"type": {"key": "string", "value": "string",
"min": 0, "max": "unlimited"}}},
"indexes": [["name"]],
"isRoot": false}}
}
88 changes: 87 additions & 1 deletion ovn-nb.xml
Expand Up @@ -179,7 +179,7 @@
<column name="other_config" key="subnet">
Set this to an IPv4 subnet, e.g. <code>192.168.0.0/24</code>, to enable
<code>ovn-northd</code> to automatically assign IP addresses within
that subnet.
that subnet.
</column>

<column name="other_config" key="exclude_ips">
Expand Down Expand Up @@ -1250,6 +1250,34 @@
</p>
</column>

<column name="gateway_chassis">
<p>
If set, this indicates that this logical router port represents
a distributed gateway port that connects this router to a logical
switch with a localnet port. There may be at most one such
logical router port on each logical router.
</p>

<p>
Several <ref table="Gateway_Chassis"/> can be referenced for a given
logical router port. A single <ref table="Gateway_Chassis"/> is
functionally equivalent to setting
<ref column="options" key="redirect-chassis"/>. Refer to the
description of <ref column="options" key="redirect-chassis"/>
for additional details on gateway handling.
</p>

<p>
Defining more than one <ref table="Gateway_Chassis"/> will enable
gateway high availability. Only one gateway will be active at a
time. OVN chassis will use BFD to monitor connectivity to a
gateway. If connectivity to the active gateway is interrupted,
another gateway will become active.
The <ref column="priority" table="Gateway_Chassis"/> column
specifies the order that gateways will be chosen by OVN.
</p>
</column>

<column name="networks">
<p>
The IP addresses and netmasks of the router. For example,
Expand Down Expand Up @@ -1319,6 +1347,14 @@
table="Logical_Switch_Port"/> should be set to
<code>router</code>.
</p>

<p>
While <ref column="options" key="redirect-chassis"/> is still
supported for backwards compatibility, it is now preferred to
specify one or more <ref column="gateway_chassis"/> instead.
It is functionally equivalent, but allows you to specify multiple
chassis to enable high availability.
</p>
</column>
</group>

Expand Down Expand Up @@ -2111,4 +2147,54 @@
<column name="external_ids"/>
</group>
</table>
<table name="Gateway_Chassis">
<p>
Association of one or more chassis to a logical router port. The traffic
going out through an specific router port will be redirected to a
chassis, or a set of them in high availability configurations.
A single <ref table="Gateway_Chassis"/> is equivalent to setting
<ref column="options" key="redirect-chassis"/>. Using
<ref table="Gateway_Chassis"/> allows associating multiple prioritized
chassis with a single logical router port.
</p>

<column name="name">
<p>
Name of the <ref table="Gateway_Chassis"/>.
</p>
<p>
A suggested, but not required naming convention is
<code>${port_name}_${chassis_name}</code>.
</p>
</column>

<column name="chassis_name">
<p>
Name of the chassis that we want to redirect traffic through for the
associated logical router port. The value must match the
<ref db="OVN_Southbound" table="Chassis" column="name"/> column
of the <ref db="OVN_Southbound" table="Chassis"/> table in the
<ref db="OVN_Southbound"/> database.
</p>
</column>

<column name="priority">
<p>
This is the priority of a chassis among all
<ref table="Gateway_Chassis"/> belonging to the same logical router
port.
</p>
</column>

<column name="options">
Reserved for future use.
</column>

<group title="Common Columns">
<column name="external_ids">
See <em>External IDs</em> at the beginning of this document.
</column>
</group>
</table>

</database>
30 changes: 27 additions & 3 deletions ovn-sb.ovsschema
@@ -1,7 +1,7 @@
{
"name": "OVN_Southbound",
"version": "1.13.0",
"cksum": "3451836240 12038",
"version": "1.14.0",
"cksum": "3613553908 13275",
"tables": {
"SB_Global": {
"columns": {
Expand Down Expand Up @@ -104,6 +104,12 @@
"columns": {
"logical_port": {"type": "string"},
"type": {"type": "string"},
"gateway_chassis": {
"type": {"key": {"type": "uuid",
"refTable": "Gateway_Chassis",
"refType": "strong"},
"min": 0,
"max": "unlimited"}},
"options": {
"type": {"key": "string",
"value": "string",
Expand Down Expand Up @@ -244,4 +250,22 @@
"update" : {"type": {"key": "string",
"min": 0,
"max": "unlimited"}}},
"isRoot": true}}}
"isRoot": true},
"Gateway_Chassis": {
"columns": {
"name": {"type": "string"},
"chassis": {"type": {"key": {"type": "uuid",
"refTable": "Chassis",
"refType": "weak"},
"min": 0, "max": 1}},
"priority": {"type": {"key": {"type": "integer",
"minInteger": 0,
"maxInteger": 32767}}},
"external_ids": {
"type": {"key": "string", "value": "string",
"min": 0, "max": "unlimited"}},
"options": {
"type": {"key": "string", "value": "string",
"min": 0, "max": "unlimited"}}},
"indexes": [["name"]],
"isRoot": false}}}
51 changes: 51 additions & 0 deletions ovn-sb.xml
Expand Up @@ -1837,6 +1837,18 @@ tcp.flags = RST;

</column>

<column name="gateway_chassis">
<p>
A list of <ref table="Gateway_Chassis"/>.
</p>
<p>
This should only be populated for ports with
<ref column="type"/> set to <code>chassisredirect</code>.
This column defines the list of chassis used as gateways where
traffic will be redirected through.
</p>
</column>

<column name="tunnel_key">
<p>
A number that represents the logical port in the key (e.g. STT key or
Expand Down Expand Up @@ -2883,4 +2895,43 @@ tcp.flags = RST;
clients are allowed to modify.
</column>
</table>
<table name="Gateway_Chassis">
<p>
Association of <ref table="Port_Binding"/> rows of
<ref table="Port_Binding" column="type"/> <code>chassisredirect</code> to
a <ref table="Chassis"/>. The traffic going out through a specific
<code>chassisredirect</code> port will be redirected to a chassis,
or a set of them in high availability configurations.
</p>

<column name="name">
<p>
Name of the <ref table="Gateway_Chassis"/>.
</p>
<p>
A suggested, but not required naming convention is
<code>${port_name}_${chassis_name}</code>.
</p>
</column>

<column name="chassis">
The <ref table="Chassis"/> to which we send the traffic.
</column>

<column name="priority">
This is the priority the specific <ref table="Chassis"/> among all
Gateway_Chassis belonging to the same <ref table="Port_Binding"/>.
</column>

<column name="options">
Reserved for future use.
</column>

<group title="Common Columns">
The overall purpose of these columns is described under <code>Common
Columns</code> at the beginning of this document.

<column name="external_ids"/>
</group>
</table>
</database>

0 comments on commit 2ba1121

Please sign in to comment.