-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows] Use Windows management virtual network adapter for OVS bridge #3067
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3067 +/- ##
==========================================
- Coverage 58.88% 50.81% -8.08%
==========================================
Files 302 293 -9
Lines 25864 35110 +9246
==========================================
+ Hits 15230 17841 +2611
- Misses 8950 15579 +6629
- Partials 1684 1690 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
b1a26a9
to
b3b18e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have enough context to be the sole reviewer, but this LGTM.
Out of curiosity, did you test your change and did you observe a significant improvement in downtime?
pkg/agent/agent_windows.go
Outdated
// Rename the vnic created by Windows host with the OVS bridge name, then it can be used by OVS directly. | ||
if err := util.RenameVMNetworkAdapter(hnsNetwork.Name, uplinkMACStr, brName); err != nil { | ||
return err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we never need to undo this change? deleting the HNSNetwork will still take care of all the clean-up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, the vnic created by Windows host is removed even if we have renamed it when the HNSNetwork is removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if I understood all the changes. Would you update Windows design doc too reflect the changes?
With our original implementation, the Windows IP address of the uplink address (e.g., we name it as Ethernet0) is lost when we created the HNSNetwork, and then came back after the virtual adapter is created by Windows, then it dismissed again when we removed the vnic until we configured it on the OVS bridge. Using this PR, the IP address is lost only when creating the HNS Network. I have tried to ping the IP address inside the Windows host, and its lost time can be reduced to 1s with this PR, while it lost about 20-30 seconds in the original implementation. |
b3b18e3
to
e1e6020
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we should change "vnic" in the commit message to "virtual network adapter".
44fb592
to
b5f9e41
Compare
b5f9e41
to
8f451a5
Compare
/test-integration |
@@ -67,6 +67,9 @@ func TestRouteOperation(t *testing.T) { | |||
}, | |||
} | |||
called := false | |||
getOVSBridgeInterfaceNameFunc = func(bridge string) string { | |||
return bridge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the test needs to change getOVSBridgeInterfaceNameFunc in this way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test case is actually using the network adapter name directly, which doesn't need a prefix "vEthernet"
return err | ||
} | ||
if hypervEnabled { | ||
if err := RemoveManagementInterface(LocalHNSNetwork); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the step that removes the vnic we use since this PR?
Do we still need the two functions? WindowsHyperVEnabled and RemoveManagementInterface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RemoveManagementInterface is not needed any more (and I would remove it), but WindowsHyperVEnabled is used in the integration test for HyperV features check on the setup.
pkg/agent/agent_windows.go
Outdated
@@ -142,6 +142,10 @@ func (i *Initializer) prepareOVSBridge() error { | |||
if _, err = i.ovsBridgeClient.GetOFPort(brName, false); err == nil { | |||
klog.Infof("OVS bridge local port %s already exists, skip the configuration", brName) | |||
} else { | |||
// Rename the vnic created by Windows host with the OVS bridge name, then it can be used by OVS directly. | |||
if err = util.RenameVMNetworkAdapter(hnsNetwork.Name, uplinkMACStr, brName); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we rename it to br-int
, it will actually get vEthernet (br-int)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
br-int is actually a name of VMNetworkAdapter, but the name of the NetAdapter is "vEthernet (br-int)".
1dd7803
to
14ae92e
Compare
/test-windows-all |
14ae92e
to
3c340ce
Compare
/test-integration |
/test-windows-all |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, some nits
3c340ce
to
c8b6827
Compare
/test-windows-all |
71353b1
to
55c9640
Compare
Rebase code on TOT and resolve the conflict. /test-windows-all |
/test-windows-all |
/test-e2e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Rename the vnic created by Windows host when creating the HNS Network as the OVS bridge name, and add OVS internal port for the bridge port. Then OVS uses the vnic created by Windows host directly, and IP/MAC/route migrations is not needed. With this workflow, the time of losing IP on the Windows host is reduced. Signed-off-by: wenying <wenyingd@vmware.com>
55c9640
to
b4b2a98
Compare
/test-windows-all |
/test-windows-conformance |
/test-e2e |
/skip-e2e failure is unrelated |
…ge (antrea-io#3067) Rename the vnic created by Windows host when creating the HNS Network as the OVS bridge name, and add OVS internal port for the bridge port. Then OVS uses the vnic created by Windows host directly, and IP/MAC/route migrations is not needed. With this workflow, the time of losing IP on the Windows host is reduced. Signed-off-by: wenyingd <wenyingd@vmware.com>
Rename the vnic created by Windows host when creating the HNS Network as
the OVS bridge name, and add OVS internal port for the bridge port. Then
OVS uses the vnic created by Windows host directly, and IP/MAC/route
migrations is not needed. With this workflow, the time of losing IP on
the Windows host is cut off.
Fixes #3057
Signed-off-by: wenying wenyingd@vmware.com