]> git.proxmox.com Git - mirror_ovs.git/commitdiff
ovn-northd; Treat logical ports of router type as always being up
authorJakub Sitnicki <jkbs@redhat.com>
Fri, 29 Sep 2017 15:05:23 +0000 (17:05 +0200)
committerBen Pfaff <blp@ovn.org>
Tue, 28 Nov 2017 20:57:42 +0000 (12:57 -0800)
Employ the simplest possible approach to determine the state of logical
ports that connect to logical routers by hardcoding it to always up.
This is intended to be less surprising than the current approach where
router ports appear as being down (with the exception of ones linking to
gateway routers, which are bound).

Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2017-August/045202.html
Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
Acked-by: Miguel Angel Ajo <majopela@redhat.com>
ovn/northd/ovn-northd.c
ovn/ovn-nb.xml
tests/ovn-northd.at

index ce67232c069fdfee7afb4ff95ac7ad8b5dc1da6e..7e6b1d9a1f84cd1b9b67f645e0dadc24acc14116 100644 (file)
@@ -6205,7 +6205,7 @@ update_logical_port_status(struct northd_context *ctx)
             continue;
         }
 
-        bool up = sb->chassis ? true : false;
+        bool up = (sb->chassis || !strcmp(nbsp->type, "router"));
         if (!nbsp->up || *nbsp->up != up) {
             nbrec_logical_switch_port_set_up(nbsp, &up, 1);
         }
index ee54960bcb7efd74736b3dc0c2e16d04d3afe8f7..1091c05ce8cb90f2ba05ae22a7d8499c264cdf17 100644 (file)
 
     <group title="Port State">
       <column name="up">
-        This column is populated by <code>ovn-northd</code>, rather than by the
-        CMS plugin as is most of this database.  When a logical port is bound
-        to a physical location in the OVN Southbound database <ref
-        db="OVN_Southbound" table="Binding"/> table, <code>ovn-northd</code>
-        sets this column to <code>true</code>; otherwise, or if the port
-        becomes unbound later, it sets it to <code>false</code>.  This allows
-        the CMS to wait for a VM's (or container's) networking to become active
-        before it allows the VM (or container) to start.
+        <p>
+          This column is populated by <code>ovn-northd</code>, rather
+          than by the CMS plugin as is most of this database.  When a
+          logical port is bound to a physical location in the OVN
+          Southbound database <ref db="OVN_Southbound"
+          table="Binding"/> table, <code>ovn-northd</code> sets this
+          column to <code>true</code>; otherwise, or if the port
+          becomes unbound later, it sets it to <code>false</code>.
+          This allows the CMS to wait for a VM's (or container's)
+          networking to become active before it allows the VM (or
+          container) to start.
+        </p>
+
+        <p>
+          Logical ports of router type are an exception to this rule.
+          They are considered to be always up, that is this column is
+          always set to <code>true</code>.
+        </p>
       </column>
 
       <column name="enabled">
index fc9eda87063fe17dfaab8e176048a6fc737b174a..954e2594210ee37a7e9cba6d273e9d561be0fd9e 100644 (file)
@@ -83,3 +83,72 @@ ovn-nbctl --wait=sb remove Logical_Router_Port bob options redirect-chassis
 AT_CHECK([ovn-sbctl find Gateway_Chassis name=bob_gw1], [0], [])
 
 AT_CLEANUP
+
+AT_SETUP([ovn -- check up state of VIF LSP])
+AT_SKIP_IF([test $HAVE_PYTHON = no])
+ovn_start
+
+ovn-nbctl ls-add S1
+ovn-nbctl lsp-add S1 S1-vm1
+AT_CHECK([test x`ovn-nbctl lsp-get-up S1-vm1` = xdown])
+
+ovn-sbctl chassis-add hv1 geneve 127.0.0.1
+ovn-sbctl lsp-bind S1-vm1 hv1
+AT_CHECK([test x`ovn-nbctl lsp-get-up S1-vm1` = xup])
+
+AT_CLEANUP
+
+AT_SETUP([ovn -- check up state of router LSP linked to a distributed LR])
+AT_SKIP_IF([test $HAVE_PYTHON = no])
+ovn_start
+
+ovn-nbctl lr-add R1
+ovn-nbctl lrp-add R1 R1-S1 02:ac:10:01:00:01 172.16.1.1/24
+
+ovn-nbctl ls-add S1
+ovn-nbctl lsp-add S1 S1-R1
+ovn-nbctl lsp-set-type S1-R1 router
+ovn-nbctl lsp-set-addresses S1-R1 02:ac:10:01:00:01
+ovn-nbctl lsp-set-options S1-R1 router-port=R1-S1
+AT_CHECK([test x`ovn-nbctl lsp-get-up S1-R1` = xup])
+
+AT_CLEANUP
+
+AT_SETUP([ovn -- check up state of router LSP linked to a gateway LR])
+AT_SKIP_IF([test $HAVE_PYTHON = no])
+ovn_start
+
+ovn-sbctl chassis-add gw1 geneve 127.0.0.1
+
+ovn-nbctl create Logical_Router name=R1 options:chassis=gw1
+ovn-nbctl lrp-add R1 R1-S1 02:ac:10:01:00:01 172.16.1.1/24
+
+ovn-nbctl ls-add S1
+ovn-nbctl lsp-add S1 S1-R1
+ovn-nbctl lsp-set-type S1-R1 router
+ovn-nbctl lsp-set-addresses S1-R1 02:ac:10:01:00:01
+ovn-nbctl lsp-set-options S1-R1 router-port=R1-S1
+
+ovn-sbctl lsp-bind S1-R1 gw1
+AT_CHECK([test x`ovn-nbctl lsp-get-up S1-R1` = xup])
+
+AT_CLEANUP
+
+AT_SETUP([ovn -- check up state of router LSP linked to an LRP with set Gateway Chassis])
+AT_SKIP_IF([test $HAVE_PYTHON = no])
+ovn_start
+
+ovn-sbctl chassis-add gw1 geneve 127.0.0.1
+
+ovn-nbctl lr-add R1
+ovn-nbctl lrp-add R1 R1-S1 02:ac:10:01:00:01 172.16.1.1/24
+ovn-nbctl lrp-set-gateway-chassis R1-S1 gw1
+
+ovn-nbctl ls-add S1
+ovn-nbctl lsp-add S1 S1-R1
+ovn-nbctl lsp-set-type S1-R1 router
+ovn-nbctl lsp-set-addresses S1-R1 router
+ovn-nbctl lsp-set-options S1-R1 router-port=R1-S1
+AT_CHECK([test x`ovn-nbctl lsp-get-up S1-R1` = xup])
+
+AT_CLEANUP