Skip to content
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 overlay backend depends on external HNS network #1111

Closed
benmoss opened this issue Mar 11, 2019 · 4 comments · Fixed by #1137
Closed

Windows overlay backend depends on external HNS network #1111

benmoss opened this issue Mar 11, 2019 · 4 comments · Fixed by #1137

Comments

@benmoss
Copy link
Contributor

benmoss commented Mar 11, 2019

Expected Behavior

The Windows overlay backend assumes you have created an external HNS network, and fails if it can't find one. This isn't very clearly documented and we had to dig into Microsoft's SDN code to find reference to what this backend is expecting. This also has the unfortunate consequence of requiring users to import Microsoft's hns.psm1 library to add the Add-HNSNetwork function to Powershell. If it were just part of Flannel it could use hcsshim to do the same thing.

It would be better and more intuitive if the overlay backend would just create this itself. I don't know if there's a reason it can't do that.

Possible Solution

Create the external network if it doesn't already exist.

@ksubrmnn

@benmoss benmoss changed the title Windows overlay backend doesn' Windows overlay backend doesn't create HNS Network Mar 11, 2019
@ksubrmnn
Copy link
Contributor

ksubrmnn commented Mar 11, 2019

Hi Ben,

In Overlay, the vxlan0 network is created by FlannelD here

However, you need to create a separate Overlay Network for vxlan0 to be layered on top of as is done here

Note that this is also done for L2Bridge (this is so that the host won't lose connectivity as the cbr0 network is created/torn down). For L2Bridge, Flannel will still work properly without that External network.

The reason that you need the External for Overlay is because in Windows, the DR NIC is created when an Overlay network is present. This NIC's MAC address is needed in the subnet lease attributes. So we create an Overlay network called "External" to get that DR MAC. Then when we have the subnet lease, we can create the vxlan0 network.

I agree with you that it is preferable to not have to depend on that external network.

Can you edit this issue to reflect what I've explained above? Regarding the actual backend network, both implementations will either reuse an existing network or create a new one. The only difference is that Overlay has a hard dependency on that external network.

In the meantime, I'll look into changing this and will update this issue soon.

@benmoss benmoss changed the title Windows overlay backend doesn't create HNS Network Windows overlay backend depends on external HNS network Mar 11, 2019
@benmoss
Copy link
Contributor Author

benmoss commented Mar 11, 2019

Thanks Kalya, I started digging in more and realized it is the external network and not the container subnet as it is on L2Bridge. I updated my issue to try to describe the problem better.

@ksubrmnn
Copy link
Contributor

ksubrmnn commented Mar 12, 2019

@madhanrm @daschott FYI

@ksubrmnn
Copy link
Contributor

ksubrmnn commented Apr 9, 2019

@zawachte-msft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants