On Fri, Oct 23, 2020 at 3:42 PM Ben Pfaff <[email protected]> wrote: > > OVN has three ways to configure distributed router ports: > redirect-chassis, Gateway_Chassis, and HA_Chassis_Group. They all end > up doing the same thing, so it's a lot of redundancy that exists only > for historical reasons. This commit removes the oldest and least > general method, redirect-chassis, and converts all of the documentation > and tests to use newer methods. > > This prepares for the ddlog implementation of ovn-northd, which doesn't > support redirect-chassis. It *could* support redirect-chassis, but it > seemed to make sense to clean this up beforehand. > > Signed-off-by: Ben Pfaff <[email protected]> > --- > NEWS | 2 + > northd/ovn-northd.8.xml | 63 ++++++++++----------- > northd/ovn-northd.c | 119 +++++++++++----------------------------- > ovn-nb.xml | 38 +++++++------ > ovn-sb.xml | 8 --- > tests/ovn-northd.at | 69 +---------------------- > tests/ovn.at | 24 ++++---- > tests/system-ovn.at | 16 +++--- > 8 files changed, 105 insertions(+), 234 deletions(-) > > diff --git a/NEWS b/NEWS > index 35825ac34919..48b21fae4161 100644 > --- a/NEWS > +++ b/NEWS > @@ -2,6 +2,8 @@ Post-v20.09.0 > --------------------- > - The "datapath" argument to ovn-trace is now optional, since the > datapath can be inferred from the inport (which is required). > + - The obsolete "redirect-chassis" way to configure gateways has been > + removed. See ovn-nb(5) for advice on how to update your config if needed. > > > OVN v20.09.0 - 28 Sep 2020 > diff --git a/northd/ovn-northd.8.xml b/northd/ovn-northd.8.xml > index f1c7c9b6450d..9b96ce9a3872 100644 > --- a/northd/ovn-northd.8.xml > +++ b/northd/ovn-northd.8.xml > @@ -1399,14 +1399,13 @@ output; > <code>router</code>, when that logical switch port's > <ref column="addresses" table="Logical_Switch_Port" > db="OVN_Northbound"/> column is set to <code>router</code> and > - the connected logical router port specifies a > - <code>redirect-chassis</code>: > + the connected logical router port has a gateway chassis: > </p> > > <ul> > <li> > The flow for the connected logical router port's Ethernet > - address is only programmed on the <code>redirect-chassis</code>. > + address is only programmed on the gateway chassis. > </li> > > <li> > @@ -1428,14 +1427,13 @@ output; > the connected logical router port specifies a > <code>reside-on-redirect-chassis</code> and the logical router > to which the connected logical router port belongs to has a > - <code>redirect-chassis</code> distributed gateway logical router > - port: > + distributed gateway LRP: > </p> > > <ul> > <li> > The flow for the connected logical router port's Ethernet > - address is only programmed on the <code>redirect-chassis</code>. > + address is only programmed on the gateway chassis. > </li> > </ul> > > @@ -1650,10 +1648,9 @@ output; > <p> > For the gateway port on a distributed logical router (where > one of the logical router ports specifies a > - <code>redirect-chassis</code>), the above flow matching > + gateway chassis), the above flow matching > <code>eth.dst == <var>E</var></code> is only programmed on > - the gateway port instance on the > - <code>redirect-chassis</code>. > + the gateway port instance on the gateway chassis. > </p> > </li> > > @@ -2013,23 +2010,21 @@ output; > <p> > For the gateway port on a distributed logical router (where > one of the logical router ports specifies a > - <code>redirect-chassis</code>), the above flows are only > + gateway chassis), the above flows are only > programmed on the gateway port instance on the > - <code>redirect-chassis</code>. This behavior avoids generation > + gateway chassis. This behavior avoids generation > of multiple ARP responses from different chassis, and allows > - upstream MAC learning to point to the > - <code>redirect-chassis</code>. > + upstream MAC learning to point to the gateway chassis. > </p> > > <p> > For the logical router port with the option > <code>reside-on-redirect-chassis</code> set (which is centralized), > the above flows are only programmed on the gateway port instance on > - the <code>redirect-chassis</code> (if the logical router has a > + the gateway chassis (if the logical router has a > distributed gateway port). This behavior avoids generation > of multiple ARP responses from different chassis, and allows > - upstream MAC learning to point to the > - <code>redirect-chassis</code>. > + upstream MAC learning to point to the gateway chassis. > </p> > </li> > > @@ -2064,12 +2059,12 @@ nd_na_router { > <p> > For the gateway port on a distributed logical router (where > one of the logical router ports specifies a > - <code>redirect-chassis</code>), the above flows replying to > + gateway chassis), the above flows replying to > IPv6 Neighbor Solicitations are only programmed on the > - gateway port instance on the <code>redirect-chassis</code>. > + gateway port instance on the gateway chassis. > This behavior avoids generation of multiple replies from > different chassis, and allows upstream MAC learning to point > - to the <code>redirect-chassis</code>. > + to the gateway chassis. > </p> > </li> > > @@ -2147,7 +2142,7 @@ nd_na { > <p> > For the gateway port on a distributed logical router with NAT > (where one of the logical router ports specifies a > - <code>redirect-chassis</code>): > + gateway chassis): > </p> > > <ul> > @@ -2155,12 +2150,12 @@ nd_na { > If the corresponding NAT rule cannot be handled in a > distributed manner, then a priority-92 flow is programmed on > the gateway port instance on the > - <code>redirect-chassis</code>. A priority-91 drop flow is > + gateway chassis. A priority-91 drop flow is > programmed on the other chassis when ARP requests/NS packets > are received on the gateway port. This behavior avoids > generation of multiple ARP responses from different chassis, > and allows upstream MAC learning to point to the > - <code>redirect-chassis</code>. > + gateway chassis. > </li> > > <li> > @@ -2470,7 +2465,7 @@ icmp6 { > <p> > If the NAT rule cannot be handled in a distributed manner, then > the priority-100 flow above is only programmed on the > - <code>redirect-chassis</code>. > + gateway chassis. > </p> > > <p> > @@ -2493,7 +2488,7 @@ icmp6 { > <p> > Following load balancing DNAT flows are added for Gateway router or > Router with gateway port. These flows are programmed only on the > - <code>redirect-chassis</code>. These flows do not get programmed for > + gateway chassis. These flows do not get programmed for > load balancers with IPv6 <var>VIPs</var>. > </p> > > @@ -2642,7 +2637,7 @@ icmp6 { > <p> > If the NAT rule cannot be handled in a distributed manner, then > the priority-100 flow above is only programmed on the > - <code>redirect-chassis</code>. > + gateway chassis. > </p> > > <p> > @@ -3133,8 +3128,8 @@ outport = <var>P</var>; > > <li> > <p> > - For logical router port with redirect-chassis and redirect-type > - being set as <code>bridged</code>, a priority-50 flow will match > + For a distributed gateway LRP with <code>redirect-type</code> > + set to <code>bridged</code>, a priority-50 flow will match > <code>outport == "ROUTER_PORT" and !is_chassis_resident > ("cr-ROUTER_PORT")</code> has actions <code>eth.dst = <var>E</var>; > next;</code>, where <var>E</var> is the ethernet address of the > @@ -3239,9 +3234,9 @@ icmp6 { > > <p> > For distributed logical routers where one of the logical router > - ports specifies a <code>redirect-chassis</code>, this table redirects > + ports specifies a gateway chassis, this table redirects > certain packets to the distributed gateway port instance on the > - <code>redirect-chassis</code>. This table has the following flows: > + gateway chassis. This table has the following flows: > </p> > > <ul> > @@ -3266,7 +3261,7 @@ icmp6 { > port and <var>CR</var> is the <code>chassisredirect</code> > port representing the instance of the logical router > distributed gateway port on the > - <code>redirect-chassis</code>. > + gateway chassis. > </li> > > <li> > @@ -3371,7 +3366,7 @@ nd_ns { > port in <code>OVN_Northbound</code> database that includes an IPv4 > address <code>VIP</code>, for every backend IPv4 address <var>B</var> > defined for the <code>VIP</code> a priority-120 flow is programmed on > - <code>redirect-chassis</code> that matches > + gateway chassis that matches > <code>ip && ip4.src == <var>B</var> && > outport == <var>GW</var></code>, where <var>GW</var> is the logical > router gateway port with an action <code>ct_dnat;</code>. If the > @@ -3405,7 +3400,7 @@ nd_ns { > <p> > If the NAT rule cannot be handled in a distributed manner, then > the priority-100 flow above is only programmed on the > - <code>redirect-chassis</code>. > + gateway chassis. > </p> > > <p> > @@ -3518,7 +3513,7 @@ nd_ns { > <p> > If the NAT rule cannot be handled in a distributed manner, then > the flow above is only programmed on the > - <code>redirect-chassis</code> increasing flow priority by 128 in > + gateway chassis increasing flow priority by 128 in > order to be run first > </p> > > @@ -3559,7 +3554,7 @@ nd_ns { > > <p> > For distributed logical routers where one of the logical router > - ports specifies a <code>redirect-chassis</code>. > + ports specifies a gateway chassis. > </p> > > <p> > diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c > index 1ca037f13d09..59b7b3d2ee3a 100644 > --- a/northd/ovn-northd.c > +++ b/northd/ovn-northd.c > @@ -613,11 +613,11 @@ struct ovn_datapath { > > /* OVN northd only needs to know about the logical router gateway port for > * NAT on a distributed router. This "distributed gateway port" is > - * populated only when there is a "redirect-chassis" specified for one of > + * populated only when there is a gateway chassis specified for one of > * the ports on the logical router. Otherwise this will be NULL. */ > struct ovn_port *l3dgw_port; > /* The "derived" OVN port representing the instance of l3dgw_port on > - * the "redirect-chassis". */ > + * the gateway chassis. */ > struct ovn_port *l3redirect_port; > > /* NAT entries configured on the router. */ > @@ -2408,27 +2408,25 @@ join_logical_ports(struct northd_context *ctx, > op->lrp_networks = lrp_networks; > op->od = od; > > - const char *redirect_chassis = smap_get(&op->nbrp->options, > - "redirect-chassis"); > - if (op->nbrp->ha_chassis_group || redirect_chassis || > + if (op->nbrp->ha_chassis_group || > op->nbrp->n_gateway_chassis) { > /* Additional "derived" ovn_port crp represents the > - * instance of op on the "redirect-chassis". */ > + * instance of op on the gateway chassis. */ > const char *gw_chassis = smap_get(&op->od->nbr->options, > "chassis"); > if (gw_chassis) { > static struct vlog_rate_limit rl > = VLOG_RATE_LIMIT_INIT(1, 1); > - VLOG_WARN_RL(&rl, "Bad configuration: " > - "redirect-chassis configured on port %s " > + VLOG_WARN_RL(&rl, "Bad configuration: distributed " > + "gateway port configured on port %s " > "on L3 gateway router", nbrp->name); > continue; > } > if (od->l3dgw_port || od->l3redirect_port) { > static struct vlog_rate_limit rl > = VLOG_RATE_LIMIT_INIT(1, 1); > - VLOG_WARN_RL(&rl, "Bad configuration: multiple ports " > - "with redirect-chassis on same logical " > + VLOG_WARN_RL(&rl, "Bad configuration: multiple " > + "distributed gateway ports on logical " > "router %s", od->nbr->name); > continue; > } > @@ -2674,7 +2672,7 @@ get_nat_addresses(const struct ovn_port *op, size_t *n) > > if (central_ip_address) { > /* Gratuitous ARP for centralized NAT rules on distributed gateway > - * ports should be restricted to the "redirect-chassis". */ > + * ports should be restricted to the gateway chassis. */ > if (op->od->l3redirect_port) { > ds_put_format(&c_addresses, " is_chassis_resident(%s)", > op->od->l3redirect_port->json_key); > @@ -3010,33 +3008,19 @@ ovn_port_update_sbrec(struct northd_context *ctx, > struct smap new; > smap_init(&new); > if (op->derived) { > - const char *redirect_chassis = smap_get(&op->nbrp->options, > - "redirect-chassis"); > const char *redirect_type = smap_get(&op->nbrp->options, > "redirect-type"); > > - int n_gw_options_set = 0; > if (op->nbrp->ha_chassis_group) { > - n_gw_options_set++; > - } > - if (op->nbrp->n_gateway_chassis) { > - n_gw_options_set++; > - } > - if (redirect_chassis) { > - n_gw_options_set++; > - } > - if (n_gw_options_set > 1) { > - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); > - VLOG_WARN_RL( > - &rl, "Multiple gatway options set for the logical router " > - "port %s. The first preferred option is " > - "ha_chassis_group; the second is gateway_chassis; " > - "and the last is redirect-chassis.", op->nbrp->name); > - } > + if (op->nbrp->n_gateway_chassis) { > + static struct vlog_rate_limit rl > + = VLOG_RATE_LIMIT_INIT(1, 1); > + VLOG_WARN_RL(&rl, "Both ha_chassis_group and " > + "gateway_chassis configured on port %s; " > + "ignoring the latter.", op->nbrp->name); > + } > > - if (op->nbrp->ha_chassis_group) { > - /* HA Chassis group is set. Ignore 'gateway_chassis' > - * column and redirect-chassis option. */ > + /* HA Chassis group is set. Ignore 'gateway_chassis'. */ > sync_ha_chassis_group_for_sbpb(ctx, op->nbrp->ha_chassis_group, > sbrec_chassis_by_name, op->sb); > sset_add(active_ha_chassis_grps, > @@ -3053,47 +3037,6 @@ ovn_port_update_sbrec(struct northd_context *ctx, > } > > sset_add(active_ha_chassis_grps, op->nbrp->name); > - } else if (redirect_chassis) { > - /* Handle ports that had redirect-chassis option attached > - * to them, and for backwards compatibility convert them > - * to a single HA Chassis group entry */ > - const struct sbrec_chassis *chassis = > - chassis_lookup_by_name(sbrec_chassis_by_name, > - redirect_chassis); > - if (chassis) { > - /* If we found the chassis, and the gw chassis on record > - * differs from what we expect go ahead and update */ > - char *gwc_name = xasprintf("%s_%s", op->nbrp->name, > - chassis->name); > - const struct sbrec_ha_chassis_group *sb_ha_ch_grp; > - sb_ha_ch_grp = ha_chassis_group_lookup_by_name( > - ctx->sbrec_ha_chassis_grp_by_name, gwc_name); > - if (!sb_ha_ch_grp) { > - sb_ha_ch_grp = > - sbrec_ha_chassis_group_insert(ctx->ovnsb_txn); > - sbrec_ha_chassis_group_set_name(sb_ha_ch_grp, > - gwc_name); > - } > - > - if (sb_ha_ch_grp->n_ha_chassis != 1) { > - struct sbrec_ha_chassis *sb_ha_ch = > - create_sb_ha_chassis(ctx, chassis, > - chassis->name, 0); > - sbrec_ha_chassis_group_set_ha_chassis(sb_ha_ch_grp, > - &sb_ha_ch, 1); > - } > - sbrec_port_binding_set_ha_chassis_group(op->sb, > - sb_ha_ch_grp); > - sset_add(active_ha_chassis_grps, gwc_name); > - free(gwc_name); > - } else { > - VLOG_WARN("chassis name '%s' from redirect from logical " > - " router port '%s' redirect-chassis not found", > - redirect_chassis, op->nbrp->name); > - if (op->sb->ha_chassis_group) { > - sbrec_port_binding_set_ha_chassis_group(op->sb, NULL); > - } > - } > } else { > /* Nothing is set. Clear ha_chassis_group from pb. */ > if (op->sb->ha_chassis_group) { > @@ -3258,7 +3201,7 @@ ovn_port_update_sbrec(struct northd_context *ctx, > * IPs by the ovn-controller on which the distributed gateway > * router port resides if: > * > - * - op->peer has 'reside-on-gateway-chassis' set and the > + * - op->peer has 'reside-on-redirect-chassis' set and the > * the logical router datapath has distributed router port. > * > * - op->peer is distributed gateway router port. > @@ -7425,7 +7368,7 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports, > /* The peer of this port represents a distributed > * gateway port. The destination lookup flow for the > * router's distributed gateway port MAC address should > - * only be programmed on the "redirect-chassis". */ > + * only be programmed on the gateway chassis. */ > add_chassis_resident_check = true; > } else { > /* Check if the option 'reside-on-redirect-chassis' > @@ -8709,8 +8652,8 @@ build_lrouter_port_nat_arp_nd_flow(struct ovn_port *op, > } else { > mac_s = REG_INPORT_ETH_ADDR; > /* Traffic with eth.src = l3dgw_port->lrp_networks.ea_s > - * should only be sent from the "redirect-chassis", so that > - * upstream MAC learning points to the "redirect-chassis". > + * should only be sent from the gateway chassis, so that > + * upstream MAC learning points to the gateway chassis. > * Also need to avoid generation of multiple ARP responses > * from different chassis. */ > if (op->od->l3redirect_port) { > @@ -9106,8 +9049,8 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, > bool add_chassis_resident_check = false; > if (op == op->od->l3dgw_port) { > /* Traffic with eth.src = l3dgw_port->lrp_networks.ea_s > - * should only be sent from the "redirect-chassis", so that > - * upstream MAC learning points to the "redirect-chassis". > + * should only be sent from the gateway chassis, so that > + * upstream MAC learning points to the gateway chassis. > * Also need to avoid generation of multiple ARP responses > * from different chassis. */ > add_chassis_resident_check = true; > @@ -9304,7 +9247,7 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, > ovn_lflow_add(lflows, od, S_ROUTER_OUT_SNAT, 120, "nd_ns", "next;"); > > /* NAT rules are only valid on Gateway routers and routers with > - * l3dgw_port (router has a port with "redirect-chassis" > + * l3dgw_port (router has a port with gateway chassis > * specified). */ > if (!smap_get(&od->nbr->options, "chassis") && !od->l3dgw_port) { > continue; > @@ -9449,7 +9392,7 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, > od->l3dgw_port->json_key); > if (!distributed && od->l3redirect_port) { > /* Flows for NAT rules that are centralized are only > - * programmed on the "redirect-chassis". */ > + * programmed on the gateway chassis. */ > ds_put_format(&match, " && is_chassis_resident(%s)", > od->l3redirect_port->json_key); > } > @@ -9526,7 +9469,7 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, > od->l3dgw_port->json_key); > if (!distributed && od->l3redirect_port) { > /* Flows for NAT rules that are centralized are only > - * programmed on the "redirect-chassis". */ > + * programmed on the gateway chassis. */ > ds_put_format(&match, " && is_chassis_resident(%s)", > od->l3redirect_port->json_key); > } > @@ -9611,7 +9554,7 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, > od->l3dgw_port->json_key); > if (!distributed && od->l3redirect_port) { > /* Flows for NAT rules that are centralized are only > - * programmed on the "redirect-chassis". */ > + * programmed on the gateway chassis. */ > ds_put_format(&match, " && is_chassis_resident(%s)", > od->l3redirect_port->json_key); > } > @@ -9684,7 +9627,7 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, > od->l3dgw_port->json_key); > if (!distributed && od->l3redirect_port) { > /* Flows for NAT rules that are centralized are only > - * programmed on the "redirect-chassis". */ > + * programmed on the gateway chassis. */ > priority += 128; > ds_put_format(&match, " && is_chassis_resident(%s)", > od->l3redirect_port->json_key); > @@ -10053,7 +9996,7 @@ build_adm_ctrl_flows_for_lrouter_port( > if (op->od->l3dgw_port && op == op->od->l3dgw_port > && op->od->l3redirect_port) { > /* Traffic with eth.dst = l3dgw_port->lrp_networks.ea_s > - * should only be received on the "redirect-chassis". */ > + * should only be received on the gateway chassis. */ > ds_put_format(match, " && is_chassis_resident(%s)", > op->od->l3redirect_port->json_key); > } > @@ -11302,8 +11245,8 @@ build_ipv6_input_flows_for_lrouter_port( > if (op->od->l3dgw_port && op == op->od->l3dgw_port > && op->od->l3redirect_port) { > /* Traffic with eth.src = l3dgw_port->lrp_networks.ea_s > - * should only be sent from the "redirect-chassis", so that > - * upstream MAC learning points to the "redirect-chassis". > + * should only be sent from the gateway chassi, so that > + * upstream MAC learning points to the gateway chassis. > * Also need to avoid generation of multiple ND replies > * from different chassis. */ > ds_put_format(match, "is_chassis_resident(%s)", > diff --git a/ovn-nb.xml b/ovn-nb.xml > index 5dbefdd6ae9e..b0ceb5051966 100644 > --- a/ovn-nb.xml > +++ b/ovn-nb.xml > @@ -2159,15 +2159,15 @@ > architecture guide, provide limited connectivity between > logical networks and physical ones. OVN support multiple > kinds of gateways. The <ref table="Logical_Router_Port"/> > - table can be used three different ways to configure > + table can be used two different ways to configure > <dfn>distributed gateway ports</dfn>, which are one kind of > - gateway. These different forms of configuration exist for > - historical reasons. All of them produce the same kind of OVN > + gateway. These two forms of configuration exist for > + historical reasons. Both of them produce the same kind of OVN > southbound records and the same behavior in practice. > </p> > > <p> > - If any of these are set, this logical router port represents a > + If either of these are set, this logical router port represents a > distributed gateway port that connects this router to a > logical switch with a <code>localnet</code> port or a > connection to another OVN deployment. There may be at most > @@ -2175,12 +2175,11 @@ > </p> > > <p> > - The newest and most preferred way to configure a gateway is > - <ref column="ha_chassis_group"/>, followed by <ref > - column="gateway_chassis"/>. Using <ref column="options" > - key="redirect-chassis"/> is deprecated. At most one of these > - should be set at a time on a given LRP, since they configure > - the same features. > + The preferred way to configure a gateway is <ref > + column="ha_chassis_group"/>, but <ref > + column="gateway_chassis"/> is also supported for backward > + compatibility. Only one of these should be set at a time on a > + given LRP, since they configure the same features. > </p> > > <p> > @@ -2215,6 +2214,17 @@ > table="Logical_Switch_Port"/> to <code>router</code>. > </p> > > + <p> > + OVN 20.03 and earlier supported a third way to configure > + distributed gateway ports using > + <code>options:redirect-chassis</code> to specify the gateway > + chassis. This method is no longer supported. Any remaining > + users should switch to one of the newer methods instead. A > + <ref column="gateway_chassis"/> may be easily configured from > + the command line, e.g. <code>ovn-nbctl lrp-set-gateway-chassis > + <var>lrp</var> <var>chassis</var></code>. > + </p> > + > <column name="ha_chassis_group"> > Designates an <ref table="HA_Chassis_Group"/> to provide > gateway high availability. > @@ -2225,10 +2235,6 @@ > logical router port. > </column> > > - <column name="options" key="redirect-chassis"> > - Designates the named chassis as the gateway. > - </column> > - > <group title="Options for Physical VLAN MTU Issues"> > <p> > MTU issues arise in mixing tunnels with logical networks that are > @@ -3518,10 +3524,6 @@ > Association of a 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"> > diff --git a/ovn-sb.xml b/ovn-sb.xml > index 749bd0745962..b1480f218635 100644 > --- a/ovn-sb.xml > +++ b/ovn-sb.xml > @@ -3026,14 +3026,6 @@ tcp.flags = RST; > The name of the distributed port for which this > <code>chassisredirect</code> port represents a particular instance. > </column> > - > - <column name="options" key="redirect-chassis"> > - The <code>chassis</code> that this <code>chassisredirect</code> port > - is bound to. This is taken from <ref table="Logical_Router_Port" > - column="options" key="redirect-chassis" db="OVN_Northbound"/> > - in the OVN_Northbound database's <ref table="Logical_Router_Port" > - db="OVN_Northbound"/> table. > - </column> > </group> > > <group title="Nested Containers"> > diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at > index 50457c291a52..e155e26f897c 100644 > --- a/tests/ovn-northd.at > +++ b/tests/ovn-northd.at > @@ -149,54 +149,6 @@ AT_CHECK([ovn-sbctl list ha_chassis_group | wc -l], [0], [0 > > AT_CLEANUP > > -AT_SETUP([ovn -- check Gateway_Chassis propagation from NBDB to SBDB backwards compatibility]) > -ovn_start > - > -ovn-nbctl create Logical_Router name=R1 > -ovn-sbctl chassis-add gw1 geneve 127.0.0.1 > -ovn-sbctl chassis-add gw2 geneve 1.2.4.8 > - > -ovn-nbctl --wait=sb lrp-add R1 bob 00:00:02:01:02:03 172.16.1.1/24 \ > - -- set Logical_Router_Port bob options:redirect-chassis="gw1" > - > - > -# It should be converted to ha_chassis_group entries in SBDB, and > -# still redirect-chassis is kept for backwards compatibility > - > -AT_CHECK([ovn-sbctl list gateway_chassis | wc -l], [0], [0 > -]) > - > -AT_CHECK([ovn-sbctl --bare --columns _uuid list ha_chassis | wc -l], [0], [1 > -]) > - > -AT_CHECK([ovn-sbctl --bare --columns _uuid list ha_chassis_group | wc -l], [0], [1 > -]) > - > -# There should be one ha_chassis_group with the name "bob_gw1" > -ha_chassi_grp_name=`ovn-sbctl --bare --columns name find \ > -ha_chassis_group name="bob_gw1"` > - > -AT_CHECK([test $ha_chassi_grp_name = bob_gw1]) > - > -ha_chgrp_uuid=`ovn-sbctl --bare --columns _uuid find ha_chassis_group name=bob_gw1` > - > -AT_CHECK([ovn-sbctl --bare --columns ha_chassis_group find port_binding \ > -logical_port="cr-bob" | grep $ha_chgrp_uuid | wc -l], [0], [1 > -]) > - > -ovn-nbctl --wait=sb remove Logical_Router_Port bob options redirect-chassis > - > -# expect that the ha_chassis/ha_chassis_group doesn't exist anymore > - > -AT_CHECK([ovn-sbctl find Gateway_Chassis name=bob_gw1], [0], []) > -AT_CHECK([ovn-sbctl list ha_chassis | wc -l], [0], [0 > -]) > - > -AT_CHECK([ovn-sbctl list ha_chassis_group | wc -l], [0], [0 > -]) > - > -AT_CLEANUP > - > AT_SETUP([ovn -- check up state of VIF LSP]) > ovn_start > > @@ -752,7 +704,8 @@ OVS_WAIT_UNTIL( > ref_ch_list=`echo $ref_ch_list | sed 's/ //g'` > test "$comp2_ch_uuid" = "$ref_ch_list"]) > > -# Set redirect-chassis option to lr0-public. It should be ignored. > +# Set redirect-chassis option to lr0-public. It should be ignored > +# (because redirect-chassis is obsolete). > ovn-nbctl set logical_router_port lr0-public options:redirect-chassis=ch1 > > OVS_WAIT_UNTIL([test 1 = `ovn-sbctl --bare --columns name find \ > @@ -765,25 +718,9 @@ ovn-sbctl --bare --columns _uuid find ha_chassis > OVS_WAIT_UNTIL([test 2 = `ovn-sbctl list ha_chassis | grep chassis | \ > grep -v chassis-name | wc -l`]) > > -# Delete the gateway chassis. HA chassis group should be created in SB DB > -# for the redirect-chassis option. > +# Delete the gateway chassis. > ovn-nbctl clear logical_router_port lr0-public gateway_chassis > > -OVS_WAIT_UNTIL([test 1 = `ovn-sbctl --bare --columns name find \ > -ha_chassis_group | wc -l`]) > - > -ovn-sbctl list ha_chassis_group > - > -OVS_WAIT_UNTIL([test 1 = `ovn-sbctl --bare --columns name find \ > -ha_chassis_group name="lr0-public_ch1" | wc -l`]) > - > -ovn-sbctl --bare --columns _uuid find ha_chassis > -OVS_WAIT_UNTIL([test 1 = `ovn-sbctl list ha_chassis | grep chassis | > -grep -v chassis-name | wc -l`]) > - > -# Clear the redirect-chassis option. > -ovn-nbctl clear logical_router_port lr0-public options > - > OVS_WAIT_UNTIL([test 0 = `ovn-sbctl list ha_chassis_group | wc -l`]) > AT_CHECK([test 0 = `ovn-sbctl list ha_chassis | wc -l`]) > > diff --git a/tests/ovn.at b/tests/ovn.at > index 81c87629c055..f569bfb90f90 100644 > --- a/tests/ovn.at > +++ b/tests/ovn.at > @@ -10190,7 +10190,7 @@ ovn_start > # Logical network: > # One LR R1 that has switches foo (192.168.1.0/24) and > # alice (172.16.1.0/24) connected to it. The logical port > -# between R1 and alice has a "redirect-chassis" specified, > +# between R1 and alice has a gateway chassis specified, > # i.e. it is the distributed router gateway port. > # Switch alice also has a localnet port defined. > # An additional switch outside has a localnet port and the > @@ -10199,7 +10199,7 @@ ovn_start > # Physical network: > # Three hypervisors hv[123]. > # hv1 hosts vif foo1. > -# hv2 is the "redirect-chassis" that hosts the distributed > +# hv2 is the gateway chassis that hosts the distributed > # router gateway port. > # hv3 hosts vif outside1. > # In order to show that connectivity works only through hv2, > @@ -10257,7 +10257,7 @@ ovn-nbctl lsp-add foo rp-foo -- set Logical_Switch_Port rp-foo \ > > # Connect alice to R1 as distributed router gateway port on hv2 > ovn-nbctl lrp-add R1 alice 00:00:02:01:02:03 172.16.1.1/24 \ > - -- set Logical_Router_Port alice options:redirect-chassis="hv2" > + -- lrp-set-gateway-chassis alice hv2 > ovn-nbctl lsp-add alice rp-alice -- set Logical_Switch_Port rp-alice \ > type=router options:router-port=alice \ > -- lsp-set-addresses rp-alice router > @@ -10504,7 +10504,7 @@ OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [hv2-vif1.expected]) > AT_CHECK([ovn-sbctl --bare --columns _uuid find Port_Binding logical_port=cr-alice | wc -l], [0], [1 > ]) > > -ovn-nbctl --timeout=3 --wait=sb remove Logical_Router_Port alice options redirect-chassis > +ovn-nbctl --timeout=3 --wait=sb lrp-del-gateway-chassis alice hv2 > > AT_CHECK([ovn-sbctl find Port_Binding logical_port=cr-alice | wc -l], [0], [0 > ]) > @@ -10522,7 +10522,7 @@ ovn-nbctl ls-add ls1 > ovn-nbctl create Logical_Router name=lr0 > # Add distributed gateway port to distributed router > ovn-nbctl lrp-add lr0 lrp0 f0:00:00:00:00:01 192.168.0.1/24 \ > - -- set Logical_Router_Port lrp0 options:redirect-chassis="hv2" > + -- lrp-set-gateway-chassis lrp0 hv2 > ovn-nbctl lsp-add ls0 lrp0-rp -- set Logical_Switch_Port lrp0-rp \ > type=router options:router-port=lrp0 addresses="router" > # Add router port to ls1 > @@ -10660,7 +10660,7 @@ ovn_start > # Logical network: > # # One LR R1 that has switches foo (192.168.1.0/24) and > # # alice (172.16.1.0/24) connected to it. The logical port > -# # between R1 and alice has a "redirect-chassis" specified, > +# # between R1 and alice has a gateway chassis specified, > # # i.e. it is the distributed router gateway port(172.16.1.6). > # # Switch alice also has a localnet port defined. > # # An additional switch outside has the same subnet as alice > @@ -10671,7 +10671,7 @@ ovn_start > # Physical network: > # # Four hypervisors hv[1234]. > # # hv1 hosts vif foo1. > -# # hv2 is the "redirect-chassis" that hosts the distributed router gateway port. > +# # hv2 is the gateway chassis that hosts the distributed router gateway port. > # # Later to test GARPs for the router port - foo, hv2 and hv4 are added to the ha_chassis_group > # # hv3 hosts nexthop port vif outside1. > # # All other tests connect hypervisors to network n1 through br-phys for tunneling. > @@ -10755,7 +10755,7 @@ ovn-nbctl lsp-add foo rp-foo -- set Logical_Switch_Port rp-foo \ > > # Connect alice to R1 as distributed router gateway port (172.16.1.6) on hv2 > ovn-nbctl lrp-add R1 alice 00:00:02:01:02:03 172.16.1.6/24 \ > - -- set Logical_Router_Port alice options:redirect-chassis="hv2" > + -- lrp-set-gateway-chassis alice hv2 > ovn-nbctl lsp-add alice rp-alice -- set Logical_Switch_Port rp-alice \ > type=router options:router-port=alice \ > -- lsp-set-addresses rp-alice router \ > @@ -10921,7 +10921,7 @@ ovn-nbctl --wait=sb ha-chassis-group-add-chassis hagrp1 hv2 30 > ovn-nbctl --wait=sb ha-chassis-group-add-chassis hagrp1 hv4 20 > > hagrp1_uuid=`ovn-nbctl --bare --columns _uuid find ha_chassis_group name=hagrp1` > -ovn-nbctl remove logical_router_port alice options redirect-chassis > +ovn-nbctl lrp-del-gateway-chassis alice hv2 > ovn-nbctl --wait=sb set logical_router_port alice ha_chassis_group=$hagrp1_uuid > > # When hv2 claims the gw router port cr-alice, it should send out > @@ -12307,7 +12307,7 @@ ovn-nbctl lsp-set-options ln-public network_name=phys > > ovn-nbctl lrp-add lr0_ip6 ip6_public 00:00:02:01:02:04 \ > 2001:db8:1:0:200:02ff:fe01:0204/64 \ > --- set Logical_Router_port ip6_public options:redirect-chassis="hv1" > +-- lrp-set-gateway-chassis ip6_public hv1 > > # Install default static route. > ovn-nbctl -- --id=@lrt create Logical_Router_Static_Route \ > @@ -12335,7 +12335,7 @@ ovn-nbctl lsp-set-options lrp1_ip6-attachment router-port=lrp1_ip6 > > ovn-nbctl lrp-add lr1_ip6 ip6_public_1 00:01:02:01:02:04 \ > 2002:db8:1:0:200:02ff:fe01:0204/64 \ > --- set Logical_Router_port ip6_public_1 options:redirect-chassis="hv2" > +-- lrp-set-gateway-chassis ip6_public_1 hv2 > > # Install default static route. > ovn-nbctl -- --id=@lrt create Logical_Router_Static_Route \ > @@ -15810,7 +15810,7 @@ ovn-nbctl lsp-add sw0 rp-sw0 -- set Logical_Switch_Port rp-sw0 \ > -- lsp-set-addresses rp-sw0 router > > ovn-nbctl lrp-add lr0 sw1 00:00:02:01:02:03 172.16.1.1/24 2002:0:0:0:0:0:0:1/64 \ > - -- set Logical_Router_Port sw1 options:redirect-chassis="hv2" > + -- lrp-set-gateway-chassis sw1 hv2 > ovn-nbctl lsp-add sw1 rp-sw1 -- set Logical_Switch_Port rp-sw1 \ > type=router options:router-port=sw1 \ > -- lsp-set-addresses rp-sw1 router > diff --git a/tests/system-ovn.at b/tests/system-ovn.at > index 091b61f91d59..29f421685194 100644 > --- a/tests/system-ovn.at > +++ b/tests/system-ovn.at > @@ -2984,7 +2984,7 @@ ovn-nbctl ls-add alice > ovn-nbctl lrp-add R1 foo 00:00:01:01:02:03 192.168.1.1/24 > ovn-nbctl lrp-add R1 bar 00:00:01:01:02:04 192.168.2.1/24 > ovn-nbctl lrp-add R1 alice 00:00:02:01:02:03 172.16.1.1/24 \ > - -- set Logical_Router_Port alice options:redirect-chassis=hv1 > + -- lrp-set-gateway-chassis alice hv1 > > # Connect foo to R1 > ovn-nbctl lsp-add foo rp-foo -- set Logical_Switch_Port rp-foo \ > @@ -3125,7 +3125,7 @@ ovn-nbctl ls-add alice > ovn-nbctl lrp-add R1 foo 00:00:01:01:02:03 fd01::1/64 > ovn-nbctl lrp-add R1 bar 00:00:01:01:02:04 fd02::1/64 > ovn-nbctl lrp-add R1 alice 00:00:02:01:02:03 fd72::1/64 \ > - -- set Logical_Router_Port alice options:redirect-chassis=hv1 > + -- lrp-set-gateway-chassis alice hv1 > > # Connect foo to R1 > ovn-nbctl lsp-add foo rp-foo -- set Logical_Switch_Port rp-foo \ > @@ -3266,7 +3266,7 @@ ovn-nbctl ls-add alice > ovn-nbctl lrp-add R1 foo 00:00:01:01:02:03 192.168.1.1/24 > ovn-nbctl lrp-add R1 bar 00:00:01:01:02:04 192.168.2.1/24 > ovn-nbctl lrp-add R1 alice 00:00:02:01:02:03 172.16.1.1/24 \ > - -- set Logical_Router_Port alice options:redirect-chassis=hv1 > + -- lrp-set-gateway-chassis alice hv1 > > # Connect foo to R1 > ovn-nbctl lsp-add foo rp-foo -- set Logical_Switch_Port rp-foo \ > @@ -3445,7 +3445,7 @@ ovn-nbctl ls-add alice > ovn-nbctl lrp-add R1 foo 00:00:01:01:02:03 fd11::1/64 > ovn-nbctl lrp-add R1 bar 00:00:01:01:02:04 fd12::1/64 > ovn-nbctl lrp-add R1 alice 00:00:02:01:02:03 fd20::1/64 \ > - -- set Logical_Router_Port alice options:redirect-chassis=hv1 > + -- lrp-set-gateway-chassis alice hv1 > > # Connect foo to R1 > ovn-nbctl lsp-add foo rp-foo -- set Logical_Switch_Port rp-foo \ > @@ -3601,7 +3601,7 @@ ovn-nbctl ls-add alice > ovn-nbctl lrp-add R1 foo 00:00:01:01:02:03 192.168.1.1/24 > ovn-nbctl lrp-add R1 bar 00:00:01:01:02:04 192.168.2.1/24 > ovn-nbctl lrp-add R1 alice 00:00:02:01:02:03 172.16.1.1/24 \ > - -- set Logical_Router_Port alice options:redirect-chassis=hv1 > + -- lrp-set-gateway-chassis alice hv1 > > # Connect foo to R1 > ovn-nbctl lsp-add foo rp-foo -- set Logical_Switch_Port rp-foo \ > @@ -3778,7 +3778,7 @@ ovn-nbctl ls-add alice > ovn-nbctl lrp-add R1 foo 00:00:01:01:02:03 fd11::1/64 > ovn-nbctl lrp-add R1 bar 00:00:01:01:02:04 fd12::1/64 > ovn-nbctl lrp-add R1 alice 00:00:02:01:02:03 fd20::1/64 \ > - -- set Logical_Router_Port alice options:redirect-chassis=hv1 > + -- lrp-set-gateway-chassis alice hv1 > > # Connect foo to R1 > ovn-nbctl lsp-add foo rp-foo -- set Logical_Switch_Port rp-foo \ > @@ -4727,7 +4727,7 @@ ovn-nbctl ls-add public > ovn-nbctl lrp-add R1 rp-sw0 00:00:01:01:02:03 192.168.1.1/24 > ovn-nbctl lrp-add R1 rp-sw1 00:00:03:01:02:03 192.168.2.1/24 > ovn-nbctl lrp-add R1 rp-public 00:00:02:01:02:03 172.16.1.1/24 \ > - -- set Logical_Router_Port rp-public options:redirect-chassis=hv1 > + -- lrp-set-gateway-chassis rp-public hv1 > > ovn-nbctl lsp-add sw0 sw0-rp -- set Logical_Switch_Port sw0-rp \ > type=router options:router-port=rp-sw0 \ > @@ -5383,7 +5383,7 @@ ovn-nbctl ls-add public > > ovn-nbctl lrp-add R1 rp-sw0 00:00:01:01:02:03 192.168.1.1/24 > ovn-nbctl lrp-add R1 rp-public 00:00:02:01:02:03 172.16.1.1/24 \ > - -- set Logical_Router_Port rp-public options:redirect-chassis=hv1 > + -- lrp-set-gateway-chassis rp-public hv1 > > ovn-nbctl lsp-add sw0 sw0-rp -- set Logical_Switch_Port sw0-rp \ > type=router options:router-port=rp-sw0 \ > -- > 2.26.2 > > > _______________________________________________ > dev mailing list > [email protected] > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Acked-by: Han Zhou <[email protected]> _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
