Skip to content

Commit

Permalink
northd: Make sure that we keep explicit chassis for remote PB.
Browse files Browse the repository at this point in the history
Ensure the chassis for remote port binding is not cleared when it's
set explicitly by CMS. The requested-chassis is still preferred
method to direct changes to SB DB, this option remains for
backward compatibility.

Fixes: 0688d7e ("northd: Allow multichassis port to be bound on remote chassis.")
Signed-off-by: Ales Musil <amusil@redhat.com>
Acked-by: Xavier Simonart <xsimonar@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
almusil authored and numansiddique committed Nov 15, 2024
1 parent 185849b commit 8a3e6ab
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
5 changes: 4 additions & 1 deletion northd/northd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3209,8 +3209,11 @@ ovn_port_update_sbrec(struct ovsdb_idl_txn *ovnsb_txn,
"is-remote", false)) {
sbrec_port_binding_set_chassis(op->sb,
op->sb->requested_chassis);
} else {
smap_add(&options, "is-remote-nb-bound", "true");
} else if (smap_get_bool(&op->sb->options,
"is-remote-nb-bound", false)) {
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,
Expand Down
34 changes: 34 additions & 0 deletions tests/ovn.at
Original file line number Diff line number Diff line change
Expand Up @@ -39727,3 +39727,37 @@ OVN_CLEANUP([hv1])

AT_CLEANUP
])

# ovn-kubernetes used to explicitly set chassis,
# test if we don't accidentally remove it.
OVN_FOR_EACH_NORTHD([
AT_SETUP([Remote port with explicit SB 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 lsp
check ovn-nbctl lsp-set-type lsp remote

remote_chassis=$(fetch_column Chassis _uuid name=hv2)
lsp_uuid=$(fetch_column Port_Binding _uuid logical_port=lsp)

check ovn-sbctl set Port_Binding $lsp_uuid chassis=$remote_chassis

check ovn-nbctl --wait=hv sync

check_column $remote_chassis Port_Binding chassis logical_port=lsp

OVN_CLEANUP([hv1])

AT_CLEANUP
])

0 comments on commit 8a3e6ab

Please sign in to comment.