@@ -3197,25 +3197,25 @@ ovn_port_update_sbrec(struct ovsdb_idl_txn *ovnsb_txn,
}
}
- if (lsp_is_remote(op->nbsp)) {
+ if (lsp_is_remote(op->nbsp) ||
+ op->sb->requested_additional_chassis) {
/* ovn-northd is supposed to set port_binding for remote ports
- * if requested chassis is marked as remote. */
+ * if requested chassis is marked as remote. In addition,
+ * if the primary chassis is remote bind it.*/
if (op->sb->requested_chassis &&
smap_get_bool(&op->sb->requested_chassis->other_config,
"is-remote", false)) {
sbrec_port_binding_set_chassis(op->sb,
op->sb->requested_chassis);
- smap_add(&options, "is-remote-nb-bound", "true");
- } else if (smap_get_bool(&op->sb->options,
- "is-remote-nb-bound", false)) {
+ } else {
sbrec_port_binding_set_chassis(op->sb, NULL);
- smap_add(&options, "is-remote-nb-bound", "false");
}
} else if (op->sb->chassis &&
smap_get_bool(&op->sb->chassis->other_config,
"is-remote", false)) {
- /* Its not a remote port but if the chassis is set and if its a
- * remote chassis then clear it. */
+ /* It's not a remote port but if the chassis is set and if
+ * it's a remote chassis, and we don't have any additional
+ * chassis then clear it. */
sbrec_port_binding_set_chassis(op->sb, NULL);
}
@@ -39027,3 +39027,53 @@ OVN_CLEANUP([hv1],[hv2])
AT_CLEANUP
])
+
+OVN_FOR_EACH_NORTHD([
+AT_SETUP([Multichassis port with remote chassis])
+ovn_start
+
+net_add n1
+
+sim_add hv1
+as hv1
+check ovs-vsctl add-br br-phys
+ovn_attach n1 br-phys 192.168.0.11
+
+check ovn-sbctl chassis-add hv2 geneve 192.168.0.12 \
+ -- set chassis hv2 other_config:is-remote=true
+
+check ovn-nbctl ls-add ls
+check ovn-nbctl lsp-add ls multi
+
+check ovs-vsctl -- add-port br-int multi \
+ -- set Interface multi external-ids:iface-id=multi
+
+local_chassis=$(fetch_column Chassis _uuid name=hv1)
+remote_chassis=$(fetch_column Chassis _uuid name=hv2)
+
+check ovn-nbctl --wait=hv lsp-set-options multi requested-chassis=hv1
+wait_for_ports_up multi
+
+# Check that it is bound locally
+check_column $local_chassis Port_Binding chassis logical_port=multi
+check_column "[]" Port_Binding additional_chassis logical_port=multi
+
+check ovn-nbctl --wait=hv lsp-set-options multi requested-chassis=hv2,hv1
+wait_for_ports_up multi
+
+# Check that it is bound on remote as primary and additional locally
+check_column $remote_chassis Port_Binding chassis logical_port=multi
+check_column "[$local_chassis]" Port_Binding additional_chassis logical_port=multi
+
+check ovn-nbctl --wait=hv lsp-set-options multi requested-chassis=hv2 \
+ -- lsp-set-type multi remote
+wait_for_ports_up multi
+
+# Check that it is bound remotely
+check_column $remote_chassis Port_Binding chassis logical_port=multi
+check_column "[]" Port_Binding additional_chassis logical_port=multi
+
+OVN_CLEANUP([hv1])
+
+AT_CLEANUP
+])
In order to support tunneling with multichassis port across multiple AZ allow the port to be bound to remote chassis if there is multiple chassis requested. Reported-at: https://issues.redhat.com/browse/FDP-850 Signed-off-by: Ales Musil <amusil@redhat.com> --- northd/northd.c | 16 ++++++++-------- tests/ovn.at | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 8 deletions(-)