Message ID | 1499865130-31404-2-git-send-email-majopela@redhat.com |
---|---|
State | Superseded |
Delegated to: | Russell Bryant |
Headers | show |
Super nit comments while trying to go through the code. Very good work btw! Thanks a lot Miguel and Anil! On Wed, Jul 12, 2017 at 3:12 PM, Miguel Angel Ajo <majopela@redhat.com> wrote: > From: "majopela@redhat.com" <majopela@redhat.com> > > 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) > s/it's/its > 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> > --- > ovn/ovn-nb.ovsschema | 28 +++++++++++++++-- > ovn/ovn-nb.xml | 88 ++++++++++++++++++++++++++++++ > +++++++++++++++++++++- > ovn/ovn-sb.ovsschema | 30 ++++++++++++++++-- > ovn/ovn-sb.xml | 51 ++++++++++++++++++++++++++++++ > 4 files changed, 190 insertions(+), 7 deletions(-) > > diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema > index c6a1417..d85a3fe 100644 > --- a/ovn/ovn-nb.ovsschema > +++ b/ovn/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": { > @@ -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", > @@ -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}} > + } > diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml > index 32c10c1..1e73465 100644 > --- a/ovn/ovn-nb.xml > +++ b/ovn/ovn-nb.xml > @@ -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. > Whitespace? </column> > > <column name="other_config" key="exclude_ips"> > @@ -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, > @@ -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> > > @@ -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> > + > I'd have liked to read whether a higher number implies higher priority (probably obvious?) and also what happens if two entries have the same priority. Which criteria is then used to select one against the other? > + <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> > diff --git a/ovn/ovn-sb.ovsschema b/ovn/ovn-sb.ovsschema > index 8a68e7c..2643640 100644 > --- a/ovn/ovn-sb.ovsschema > +++ b/ovn/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": { > @@ -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", > @@ -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}}} > diff --git a/ovn/ovn-sb.xml b/ovn/ovn-sb.xml > index b22d1ac..c1731d2 100644 > --- a/ovn/ovn-sb.xml > +++ b/ovn/ovn-sb.xml > @@ -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 > @@ -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> > Same as before + > + <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> > -- > 1.8.3.1 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev >
diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema index c6a1417..d85a3fe 100644 --- a/ovn/ovn-nb.ovsschema +++ b/ovn/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": { @@ -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", @@ -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}} + } diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml index 32c10c1..1e73465 100644 --- a/ovn/ovn-nb.xml +++ b/ovn/ovn-nb.xml @@ -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"> @@ -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, @@ -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> @@ -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> diff --git a/ovn/ovn-sb.ovsschema b/ovn/ovn-sb.ovsschema index 8a68e7c..2643640 100644 --- a/ovn/ovn-sb.ovsschema +++ b/ovn/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": { @@ -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", @@ -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}}} diff --git a/ovn/ovn-sb.xml b/ovn/ovn-sb.xml index b22d1ac..c1731d2 100644 --- a/ovn/ovn-sb.xml +++ b/ovn/ovn-sb.xml @@ -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 @@ -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>