Swarm overlay networking in Windows 1709 - HNS failed

Hi,

Does anyone have experience working with overlay networks in swarm mode on Windows? As I understand it, this is supported on Windows Server Core 1709 and Win10 1709 (fall creators update.) - If so, is there a HOWTO on overlay networks because I think I’m missing something.

I have Docker set up and it works. I can say:

docker run -ti microsoft/windowsservercore:1709 powershell

and I can ping 8.8.8.8 just fine.

I can set up a swarm with:

docker swarm init --advertise-addr 192.168.my.ip
docker network create -d overlay swarmtest

If I say: (note, no overlay network)

docker service create -d --replicas 1 --name pinger microsoft/windowsservercore:1709 ping -t localhost

the service replicates and I can exec powershell within the cointainer and ping 8.8.8.8.

If I say:

docker service create -d --replicas 1 --name pinger --network swarmtest microsoft/windowsservercore:1709 ping -t localhost

I end up with a container that constantly restarts. In the event log says:

fatal task error [module=node/agent/taskmanager node.id=4780g0h0r1i74i5yar94dck2e task.id=qz340cpeacn6dgzwq6s510rud service.id=y3mewjin7uvt6s9ipsanjd4hl error=HNS failed with error : Unspecified error ]

or:

fatal task error [module=node/agent/taskmanager node.id=4780g0h0r1i74i5yar94dck2e task.id=oahevqcqzh9ljcvgy8viwto4t service.id=9ny1tjbzz681eeod1lyd10jp6 error=HNS failed with error : An adapter was not found. ]

or, sometimes I end up with a running container with no network access. (ping 8.8.8.8 fails.) - In this case, if I run ipconfig within the container I see a default gateway of 10.0.0.1. I can’t ping this either.

version:

Client:
 Version:      17.11.0-ce-rc3
 API version:  1.34
 Go version:   go1.8.4
 Git commit:   5b4af4f
 Built:        Wed Nov  8 03:03:30 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.11.0-ce-rc3
 API version:  1.34 (minimum version 1.24)
 Go version:   go1.8.5
 Git commit:   5b4af4f
 Built:        Wed Nov  8 03:13:48 2017
 OS/Arch:      windows/amd64
 Experimental: true

docker network inspect nat:

[
    {
        "Name": "nat",
        "Id": "774bed6bc7540bf66c661ada06c2e96b04195c57f24e4795e17d66faf1cc5d7d",
        "Created": "2017-11-16T12:05:44.0374593Z",
        "Scope": "local",
        "Driver": "nat",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "windows",
            "Options": null,
            "Config": [
                {
                    "Subnet": "0.0.0.0/0",
                    "Gateway": "0.0.0.0"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {},
        "Options": {
            "com.docker.network.windowsshim.hnsid": "234c1b80-dc92-47e6-a820-ab239550080d",
            "com.docker.network.windowsshim.networkname": "nat"
        },
        "Labels": {}
    }
]

docker network inspect swarmtest

[
    {
        "Name": "swarmtest",
        "Id": "vo4chg3xe1zs4v9u183r5jrkc",
        "Created": "2017-11-16T12:36:42.1182509Z",
        "Scope": "swarm",
        "Driver": "overlay",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "10.0.0.0/24",
                    "Gateway": "10.0.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "a9f7414fe144ab2d6d19aca199115c22972ee50067d733c1eeba22daaa2e3d98": {
                "Name": "pinger.1.m7gylby2za9dv2u4tri49hd4j",
                "EndpointID": "8d97ff2ff403d76a79ef45bd44d243383133377ea5b0e191462886907779ae4c",
                "MacAddress": "00:15:5d:e5:02:cf",
                "IPv4Address": "10.0.0.36/24",
                "IPv6Address": ""
            },
            "swarmtest-sbox": {
                "Name": "swarmtest-endpoint",
                "EndpointID": "494c5ded0725e38c1f39c42834124e1bc9589bda3b00a0cb113519f744fde457",
                "MacAddress": "00:15:5d:e5:0e:2c",
                "IPv4Address": "10.0.0.2/24",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "4097",
            "com.docker.network.windowsshim.hnsid": "1e1ec50d-3df6-4e67-8497-e14bb7a799b1"
        },
        "Labels": {},
        "Peers": [
            {
                "Name": "b4969417aa35",
                "IP": "192.168.my.ip"
            }
        ]
    }
]

Any ideas, please? :slight_smile:

1 Like

No ideas really, just a “me too” :frowning:

My Docker for Windows on Win10 broke this morning and I haven’t been able to fix it, in desperation I tried to use the Edge version (Version 17.11.0-ce-win40 (14328)). I had previously used the Stable version (17.09 ?) and with:

docker create network -d overlay --attachable my-network

it worked perfectly for adding my swarm services too. Now, using the Edge version I get the same error as you are getting:

HNS failed with error : An adapter was not found.

Haven’t been able to resolve it yet. I’ve tried specifying some additional options like:

docker network create --attachable -d overlay --subnet=10.0.0.0/24 my-network

but no luck as yet. I’m using the “Enable Linux containers on Windows” option (un-checking it breaks Docker, which is why I tried upgrading to Edge). I’ve compared my network inspect with a “working” docker running on stable 17.10.0-ce (on Azure VMs) and the only visual differences I can see are:

STABLE: “Created”: “2017-11-24T10:51:12.630779858Z”,
EDGE: “Created”: “0001-01-01T00:00:00Z”

STABLE: “Labels”: {},
EDGE: “Labels”: null

STABLE:
“Peers”: [
{
“Name”: “10d3542417ed”,
“IP”: “192.168.0.10”
}
EDGE: (no Peers entry)

@gh2k did you solve your problem? I have the same issue.