-
Notifications
You must be signed in to change notification settings - Fork 363
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] Fix br-int NetIPAddress not found issue #1660
Conversation
/test-all |
Codecov Report
@@ Coverage Diff @@
## master #1660 +/- ##
==========================================
+ Coverage 63.31% 64.41% +1.09%
==========================================
Files 170 181 +11
Lines 14250 15410 +1160
==========================================
+ Hits 9023 9927 +904
- Misses 4292 4460 +168
- Partials 935 1023 +88
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Do not remove the NetIPAddress on br-int anymore to avoid the "No matching MSFT_NetIPAddress objects found" issue because the NetIPAddress may not exist on br-int. Instead, always try to configure NetIPAddress on the interface and ignore the "MSFT_NetIPAddress already exists" error. Fixes: antrea-io#1644 Signed-off-by: Rui Cao <rcao@vmware.com>
98a05a1
to
93b612d
Compare
/test-all |
/test-all |
@@ -150,14 +150,14 @@ func (i *Initializer) prepareOVSBridge() error { | |||
if err = util.SetAdapterMACAddress(brName, &uplinkNetConfig.MAC); err != nil { | |||
return err | |||
} | |||
// Remove existing IP addresses to avoid a candidate error of "Instance MSFT_NetIPAddress already exists" when |
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 didn't the call fail before? When it initializes the node the first time, will it have IP on bright interface?
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.
Because in our private CI, DHCP service is enabled. br-int
always has chance to get IP from DHCP server.
Let me double check it.
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.
Then could we have another issue if we don't clean up IPs got from DHCP server? or it's fine to keep as is?
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.
Let me double check it.
I double check the testbed, the reason truly as I mentioned above.
I think it's fine to keep the IP from DHCP server.
Actually a potential issue is that if br-int might get a different IP from DHCP server intead of the IP we expect.
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.
thanks for confirming.
any way we can merge this relatively quickly and iterate any minor issues huge blocker for us on the CAPV side :) |
pkg/agent/agent_windows.go
Outdated
return err | ||
if strings.Contains(err.Error(), "Instance MSFT_NetIPAddress already exists") { | ||
err = nil | ||
klog.V(4).Infof("Address: %s already exists on interface %s", uplinkNetConfig.IP.String(), brName) |
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.
Could you explain to me when this can happen?
It is for IP already exists on br-int, or also when the IP exists on another adapter of the host?
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.
Could you explain to me when this can happen?
- The IP is on Ethernet0 at first.
- Set the Ethernet0 as uplink and the Ethernet0 wil have no IP. The corresponding
MSFT_NetIPAddress
item will also be removed. - Add
br-int
to OVS and set the MAC same asEthernet0
.- If the DHCP is enabled.
br-int
may get the same IP, which will causeInstance MSFT_NetIPAddress already exists
when we try to set the IP later.
- If the DHCP is enabled.
It is for IP already exists on br-int, or also when the IP exists on another adapter of the host?
It's for IP already exists on br-int. Actually the IP has change exist on another adapter. But I think it's almost impossible unless some other process set the IP on another adapter during these steps. So I didn't put too much check here.
Change log info to: klog.V(4).Infof("Address: %s already exists when configuring IP on interface %s", uplinkNetConfig.IP.String(), brName)
. It should be more accurate.
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.
Could be better if you add the explanation (DHCP etc.) to the code comments.
- Remove dead functions: - RemoveIPv4AddrsFromAdapter - GetAdapterIPv4Addr - Update if/else order. - Update log info Signed-off-by: Rui Cao <rcao@vmware.com>
/test-all |
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
@@ -150,14 +150,14 @@ func (i *Initializer) prepareOVSBridge() error { | |||
if err = util.SetAdapterMACAddress(brName, &uplinkNetConfig.MAC); err != nil { | |||
return err | |||
} | |||
// Remove existing IP addresses to avoid a candidate error of "Instance MSFT_NetIPAddress already exists" when |
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.
thanks for confirming.
* [Windows] Fix br-int NetIPAddress not found issue Do not remove the NetIPAddress on br-int anymore to avoid the "No matching MSFT_NetIPAddress objects found" issue because the NetIPAddress may not exist on br-int. Instead, always try to configure NetIPAddress on the interface and ignore the "MSFT_NetIPAddress already exists" error. Fixes: #1644 Signed-off-by: Rui Cao <rcao@vmware.com> * Address comments - Remove dead functions: - RemoveIPv4AddrsFromAdapter - GetAdapterIPv4Addr - Update if/else order. - Update log info Signed-off-by: Rui Cao <rcao@vmware.com>
Do not remove the NetIPAddress on br-int anymore to avoid the
"No matching MSFT_NetIPAddress objects found" issue because the
NetIPAddress may not exist on br-int.
Instead, always try to configure NetIPAddress on the interface
and ignore the "MSFT_NetIPAddress already exists" error.
Fixes: #1644
Signed-off-by: Rui Cao rcao@vmware.com