[ovs-dev,RFC,ovn,00/10] OVN Interconnection
mbox series

Message ID 1569623665-77390-1-git-send-email-hzhou8@ebay.com
Headers show
Series
  • OVN Interconnection
Related show

Message

Han Zhou Sept. 27, 2019, 10:34 p.m. UTC
The series supports interconnecting multiple OVN deployments (e.g.  located at
multiple data centers) through logical routers connected with tansit logical
switches with overlay tunnels, managed through OVN control plane.  See the
ovn-architecture document updates for more details.

The series is now RFC to get feedback only.  Here are the major TODOs before
sending as formal patch:

- CLI improvements. Now there are only basic database commands supported.
  More commands will be supported and documentation will be added.

- Test cases. Although it is manually tested with multiple OVN setups with
  basic senarios, test cases will need to be added and more cases covered.

- Sandbox support.

- Documentation improvements.

- Code optimizations.

Below are the steps to try/test:

1. Precondition: two or more independent OVN environments are up and running
   with this patch, each with its own logical switches/routers and workloads.

2. Create the global IC-NB and IC-SB DBs on any node:
    ovsdb-tool create inb.db ../../ovn-inb.ovsschema
    ovsdb-tool create isb.db ../../ovn-isb.ovsschema
    ovsdb-server --detach --no-chdir --pidfile=icdb.pid -vconsole:off \
        --log-file=icdb.log -vsyslog:off \
        --unixctl=icdb \
        --remote=ptcp:6649:0.0.0.0 \
        --remote=punix:icdb.ovsdb inb.db isb.db

3. On central node of each OVN, start ovn-ic daemon:
    export OVN_INB_DB=tcp:<IC DB IP>:6649
    export OVN_ISB_DB=tcp:<IC DB IP>:6649

    # Specify NB/SB DB if not using default connection URL.
    ovn-ic --detach --no-chdir --pidfile=ovn-ic.pid -vconsole:off \
        --log-file=ovn-ic.log -vsyslog:off

4. For each OVN, set AZ name in NB:
    e.g. ovn-nbctl set nb . name="az1"

5. Create a transit switch in global IC-NB:
    ovn-inbctl create transit_switch name=ts1

6. For each OVN, specify one or more chassis as gateway node(s) for
   interconnection by running below command on the chassis:
    ovs-vsctl set open . external_ids:is-interconn=true

7. For each OVN, create distributed gateway port(s) and its peer on transit
   switch, e.g.:
    # In OVN az1:
    ovn-nbctl lrp-add lr1 lrp-lr1-ts1 aa:aa:aa:00:00:01 169.254.100.1/24
    ovn-nbctl lrp-set-gateway-chassis lrp-lr1-ts1 gw1
    ovn-nbctl lsp-add ts1 lsp-ts1-lr1
    ovn-nbctl lsp-set-addresses lsp-ts1-lr1 router 
    ovn-nbctl lsp-set-type lsp-ts1-lr1 router 
    ovn-nbctl lsp-set-options lsp-ts1-lr1 router-port=lrp-lr1-ts1
    # In OVN az2:
    ovn-nbctl lrp-add lr2 lrp-lr2-ts1 aa:aa:aa:00:00:02 169.254.100.2/24
    ovn-nbctl lrp-set-gateway-chassis lrp-lr2-ts1 gw2
    ovn-nbctl lsp-add ts1 lsp-ts1-lr2
    ovn-nbctl lsp-set-addresses lsp-ts1-lr2 router 
    ovn-nbctl lsp-set-type lsp-ts1-lr2 router 
    ovn-nbctl lsp-set-options lsp-ts1-lr2 router-port=lrp-lr2-ts1

8. For each OVN, create the static routes to route to remote workload
   subnets, e.g.:
   In OVN az1, there are workloads using 10.0.1.0/24 under lr1;
   in OVN az2, there are workloads using 10.0.2.0/24 under lr2.

    # In az1, add below route:
    ovn-nbctl lr-route-add lr1 10.0.2.0/24 169.254.100.2
    # In az1, add below route:
    ovn-nbctl lr-route-add lr1 10.0.1.0/24 169.254.100.1

9. Try ping between the workloads in different OVNs.

Han Zhou (10):
  ovn-northd.c: Fix datapath tunnel key allocation.
  ovn-architecture: Add documentation for OVN interconnection feature.
  ovn-inb: Interconnection northbound DB schema and CLI.
  ovn-isb: Interconnection southbound DB schema and CLI.
  ovn-ic: Interconnection controller with AZ registeration.
  ovn-northd.c: Refactor allocate_tnlid.
  ovn-ic: Transit switch controller.
  ovn-sb: Add columns is_interconn and is_remote to Chassis.
  ovn-ic: Interconnection gateway controller.
  ovn-ic: Interconnection port controller.

 .gitignore                 |   6 +
 Makefile.am                |   1 +
 automake.mk                |  75 ++++
 controller/binding.c       |   6 +-
 controller/chassis.c       |  14 +
 debian/ovn-common.install  |   2 +
 debian/ovn-common.manpages |   4 +
 ic/.gitignore              |   2 +
 ic/automake.mk             |  10 +
 ic/ovn-ic.8.xml            | 111 ++++++
 ic/ovn-ic.c                | 942 +++++++++++++++++++++++++++++++++++++++++++++
 lib/.gitignore             |   6 +
 lib/automake.mk            |  32 +-
 lib/ovn-inb-idl.ann        |   9 +
 lib/ovn-isb-idl.ann        |   9 +
 lib/ovn-util.c             |  92 +++++
 lib/ovn-util.h             |  15 +
 northd/ovn-northd.c        | 106 ++---
 ovn-architecture.7.xml     | 107 ++++-
 ovn-inb.ovsschema          |  76 ++++
 ovn-inb.xml                | 377 ++++++++++++++++++
 ovn-isb.ovsschema          | 130 +++++++
 ovn-isb.xml                | 588 ++++++++++++++++++++++++++++
 ovn-nb.ovsschema           |   5 +-
 ovn-nb.xml                 |  18 +-
 ovn-sb.ovsschema           |   8 +-
 ovn-sb.xml                 |  15 +
 tutorial/ovs-sandbox       |   2 +-
 utilities/.gitignore       |   4 +
 utilities/automake.mk      |  10 +
 utilities/ovn-inbctl.c     | 879 ++++++++++++++++++++++++++++++++++++++++++
 utilities/ovn-isbctl.c     | 890 ++++++++++++++++++++++++++++++++++++++++++
 32 files changed, 4460 insertions(+), 91 deletions(-)
 create mode 100644 ic/.gitignore
 create mode 100644 ic/automake.mk
 create mode 100644 ic/ovn-ic.8.xml
 create mode 100644 ic/ovn-ic.c
 create mode 100644 lib/ovn-inb-idl.ann
 create mode 100644 lib/ovn-isb-idl.ann
 create mode 100644 ovn-inb.ovsschema
 create mode 100644 ovn-inb.xml
 create mode 100644 ovn-isb.ovsschema
 create mode 100644 ovn-isb.xml
 create mode 100644 utilities/ovn-inbctl.c
 create mode 100644 utilities/ovn-isbctl.c