Skip to content

Commit

Permalink
network, bridge binding: Enable container interface
Browse files Browse the repository at this point in the history
Migrating a VM with secondary interfaces that uses bridge binding may cause long
periods of traffic disruption. This occurs when the interface is defined with an
explicit MAC address (manually or automatically through KubeMacPool) on nodes
that have IPv6 enabled.

During the migration, frames may be forwarded to the destination node while the
domain is active on the source and still not running at the destination.

When the migration destination pod is created an IPv6 NS (Neighbor Solicitation)
and NA (Neighbor Advertisement) are sent automatically by the kernel.
The switches at the endpoints (e.g.: migration destination node) tables
get updated and the traffic is forwarded to the migration destination before
the migration is completed [1].

Assuming the used bridge CNI to connect the pod to the node can create the pod
interface in a "link-down" state [2], the IPv6 NS/NA packets are avoided.
However, there is a need to explicitly set the "link-up" when Kubevirt later
processes them.

As part of the pod network configuration calculation, Kubevirt now explicitly
asks to set the relevant interfaces for the bridge binding as "UP".

Fixes: https://issues.redhat.com/browse/CNV-28040

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2186372#c6
[2] containernetworking/plugins#951

Signed-off-by: Or Mergi <ormergi@redhat.com>
  • Loading branch information
ormergi committed Jan 29, 2024
1 parent 0e80ce5 commit 6f0742a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/network/setup/netpod/netpod.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ func (n NetPod) bridgeBindingSpec(podIfaceName string, vmiIfaceIndex int, ifaceS
podIface := nmstate.Interface{
Index: podStatusIface.Index,
Name: podIfaceAlternativeName,
State: nmstate.IfaceStateUp,
CopyMacFrom: bridgeIface.Name,
Controller: bridgeIface.Name,
IPv4: nmstate.IP{Enabled: pointer.P(false)},
Expand Down
7 changes: 7 additions & 0 deletions pkg/network/setup/netpod/netpod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ var _ = Describe("netpod", func() {
Index: 0,
CopyMacFrom: "k6t-eth0",
Controller: "k6t-eth0",
State: nmstate.IfaceStateUp,
IPv4: ipDisabled,
IPv6: ipDisabled,
LinuxStack: nmstate.LinuxIfaceStack{PortLearning: pointer.P(false)},
Expand Down Expand Up @@ -470,6 +471,7 @@ var _ = Describe("netpod", func() {
Index: 0,
CopyMacFrom: "k6t-eth0",
Controller: "k6t-eth0",
State: nmstate.IfaceStateUp,
IPv4: ipDisabled,
IPv6: ipDisabled,
LinuxStack: nmstate.LinuxIfaceStack{PortLearning: pointer.P(false)},
Expand Down Expand Up @@ -678,6 +680,7 @@ var _ = Describe("netpod", func() {
Index: secondaryPodInterfaceIndex,
CopyMacFrom: "k6t-914f438d88d",
Controller: "k6t-914f438d88d",
State: nmstate.IfaceStateUp,
IPv4: ipDisabled,
IPv6: ipDisabled,
LinuxStack: nmstate.LinuxIfaceStack{PortLearning: pointer.P(false)},
Expand Down Expand Up @@ -860,6 +863,7 @@ var _ = Describe("netpod", func() {
Index: secondaryPodInterfaceIndex,
CopyMacFrom: "k6t-net1",
Controller: "k6t-net1",
State: nmstate.IfaceStateUp,
IPv4: ipDisabled,
IPv6: ipDisabled,
LinuxStack: nmstate.LinuxIfaceStack{PortLearning: pointer.P(false)},
Expand Down Expand Up @@ -1135,6 +1139,7 @@ var _ = Describe("netpod", func() {
Name: "bc6cc93fa1e-nic",
CopyMacFrom: "k6t-bc6cc93fa1e",
Controller: "k6t-bc6cc93fa1e",
State: nmstate.IfaceStateUp,
IPv4: ipDisabled,
IPv6: ipDisabled,
LinuxStack: nmstate.LinuxIfaceStack{PortLearning: pointer.P(false)},
Expand Down Expand Up @@ -1338,6 +1343,7 @@ var _ = Describe("netpod", func() {
Name: "7087ef4cd1f-nic",
CopyMacFrom: "k6t-7087ef4cd1f",
Controller: "k6t-7087ef4cd1f",
State: nmstate.IfaceStateUp,
IPv4: ipDisabled,
IPv6: ipDisabled,
LinuxStack: nmstate.LinuxIfaceStack{PortLearning: pointer.P(false)},
Expand Down Expand Up @@ -1536,6 +1542,7 @@ var _ = Describe("netpod", func() {
Name: "7087ef4cd1f-nic",
CopyMacFrom: "k6t-7087ef4cd1f",
Controller: "k6t-7087ef4cd1f",
State: nmstate.IfaceStateUp,
IPv4: ipDisabled,
IPv6: ipDisabled,
LinuxStack: nmstate.LinuxIfaceStack{PortLearning: pointer.P(false)},
Expand Down

0 comments on commit 6f0742a

Please sign in to comment.