-
Notifications
You must be signed in to change notification settings - Fork 886
Updating IPAM config with results from HNS create network call. #2429
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
Conversation
|
This is a fix for moby/moby#38358. However, this is a fix for only the original issue. I.e. The default docker NAT network is missing. This root cause is that when the user does not specify a subnet, windows (HNS) will chose one for them. However, we do not show the subnet/gateway in the output of docker inspect. However, the subnet and gateway are present and will work. Unfortunately any scripts that parse the output of "docker inspect nat" will fail. Another simpler way to repro this issue is: The output of |
|
Regarding the solution, I investigated @arkodg's suggesting of using docker's ipam and getting rid of the window's ipam plugin (https://github.com/docker/libnetwork/blob/master/ipams/windowsipam/windowsipam.go). |
|
@pradipd, would it be possible to add an API to HNS to |
|
Sorry for the delayed response. I was OOF. |
|
@arkodg: Adding an API would require us to backport the change to 2016. I don't think this issue is important enough to backport to 2016. There are workarounds that can unblock users. |
|
Oops. Sorry. Did not mean to resolve conversation. Will try and reopen |
|
@pradipd is it possible to use this CMD or the underlying API - https://docs.microsoft.com/en-us/powershell/module/ipamserver/find-ipamfreeaddress?view=win10-ps |
|
No. That API is for a different windows server role/feature that is not involved with HNS. I.e. that API is for when you setup your Windows Server as a DHCP server. |
aaaaf5a to
c6c6036
Compare
|
Could you pls rebase and submit again? |
In windows HNS manages IPAM. If the user does not specify a subnet, HNS will choose one for them. However, in order for the IPAM to show up in the output of "docker inspect", we need to update the network IPAMv4Config field. Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
c6c6036 to
64f88ad
Compare
selansen
left a comment
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
|
@arkodg PTAL . |
| return nil | ||
| } | ||
|
|
||
| func (n *network) UpdateIpamConfig(ipV4Data []driverapi.IPAMData) { |
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.
Can we make this generic to ipv4 and ipv6
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 just undid that change based off feedback from @selansen . Windows wasn't using it, so, we decided we can add it later when we (or some other driver) needs 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.
I mean windows wasn't passing any IPv6 data in using UpdateIpamConfig()
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 still stick by my comment. if we are not using it, we dont need it. It will confuse everyone who is looking into the code after few months wondering why is this code exists if we are not using it.
full diff: moby/libnetwork@92d1fbe...96bcc0d changes included: - moby/libnetwork#2429 Updating IPAM config with results from HNS create network call - addresses moby#38358 - moby/libnetwork#2450 Always configure iptables forward policy - related to moby#14041 and moby/libnetwork#1526 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: moby/libnetwork@92d1fbe...96bcc0d changes included: - moby/libnetwork#2429 Updating IPAM config with results from HNS create network call - addresses moby/moby#38358 - moby/libnetwork#2450 Always configure iptables forward policy - related to moby/moby#14041 and moby/libnetwork#1526 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 75477f0b3c77f2108a6b5586dbc246c52b479941 Component: engine
full diff: moby/libnetwork@92d1fbe...96bcc0d changes included: - moby/libnetwork#2429 Updating IPAM config with results from HNS create network call - addresses moby#38358 - moby/libnetwork#2450 Always configure iptables forward policy - related to moby#14041 and moby/libnetwork#1526 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 75477f0) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: moby/libnetwork@92d1fbe...96bcc0d changes included: - moby/libnetwork#2429 Updating IPAM config with results from HNS create network call - addresses moby/moby#38358 - moby/libnetwork#2450 Always configure iptables forward policy - related to moby/moby#14041 and moby/libnetwork#1526 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 75477f0b3c77f2108a6b5586dbc246c52b479941) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 559be42fc26048f4069de64f84202803a113413a Component: engine
full diff: moby/libnetwork@92d1fbe...96bcc0d changes included: - moby/libnetwork#2429 Updating IPAM config with results from HNS create network call - addresses moby#38358 - moby/libnetwork#2450 Always configure iptables forward policy - related to moby#14041 and moby/libnetwork#1526 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Signed-off-by: zach <Zachary.Joyner@linux.com>
|
Hi, How to know if this change is release in latest docker enterprise version? |
|
@subbunori can you please update to latest 19.03 version and this fix should be present |
In windows HNS manages IPAM. If the user does not specify a subnet, HNS will choose one
for them. However, in order for the IPAM to show up in the output of "docker inspect",
we need to update the network IPAMv4Config field.
Signed-off-by: Pradip Dhara pradipd@microsoft.com