antrea-io / antrea

Kubernetes networking based on Open vSwitch
https://antrea.io
Apache License 2.0
1.67k stars 369 forks source link

can not install ovs in windows server 2022 #3662

Closed hwdef closed 2 years ago

hwdef commented 2 years ago

Describe the bug

can not install ovs in windows use https://github.com/antrea-io/antrea/blob/main/hack/windows/Install-OVS.ps1 shell.

To Reproduce

.\install-ovs.ps1

Expected

successfully installed

Actual behavior

PS C:\windows_deploy> .\install-ovs.ps1
4/19/2022 2:38 PM Installation log location: C:\windows_deploy\install_ovs.log

4/19/2022 2:38 PM Extract C:\windows_deploy\ovs-win64.zip to C:\windows_deploy

4/19/2022 2:38 PM Copying OVS package from C:\windows_deploy\openvswitch to C:\openvswitch

4/19/2022 2:38 PM Installing OVS driver certificate.

   PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\TrustedPublisher

Thumbprint                                Subject
----------                                -------
6E1511B2601833C93E20F5E585DB1DF1A1577BE5  CN="WDKTestCert appveyor,132817604335078165"

   PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\Root

Thumbprint                                Subject
----------                                -------
6E1511B2601833C93E20F5E585DB1DF1A1577BE5  CN="WDKTestCert appveyor,132817604335078165"
4/19/2022 2:38 PM Installing OVS kernel driver

4/19/2022 2:38 PM Hyper-V Virtual Machine Management service status: Running

C:\openvswitch\driver>netcfg -l .\ovsext.inf -c s -i OVSExt
Trying to install OVSExt ...

... .\ovsext.inf was copied to C:\Windows\INF\oem12.inf.

... done.

C:\openvswitch\driver>net stop vmms
The Hyper-V Virtual Machine Management service is stopping.
The Hyper-V Virtual Machine Management service was stopped successfully.

C:\openvswitch\driver>net start vmms
The Hyper-V Virtual Machine Management service is starting.
The Hyper-V Virtual Machine Management service was started successfully.

4/19/2022 2:38 PM Creating ovsdb file

4/19/2022 2:38 PM Create and start ovsdb-server service

[SC] CreateService FAILED 1073:

The specified service already exists.

[SC] ChangeServiceConfig2 SUCCESS
Start-Service : Service 'ovsdb-server (ovsdb-server)' cannot be started due to the following error: Cannot start
service ovsdb-server on computer '.'.
At C:\windows_deploy\install-ovs.ps1:214 char:5
+     Start-Service ovsdb-server
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
   ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand

Versions:

kubernetes version: 1.21.11 windows version: windows server 2022 container runtime: containerd

Additional context

tnqn commented 2 years ago

@hwdef thanks for reporting. @wenyingd @XinShuYang could you check the issue?

wenyingd commented 2 years ago

Hi @hwdef could you help provide ovs version?

hwdef commented 2 years ago

ovs version is 2.15.3 download from https://downloads.antrea.io/ovs/ovs-2.15.3-antrea.0-win64.zip I guess it is a problem with the adaptation of windows server 2022, because I tested it on windows server 2019 and it is no problem.

wenyingd commented 2 years ago

ovs version is 2.15.3 download from https://downloads.antrea.io/ovs/ovs-2.15.3-antrea.0-win64.zip I guess it is a problem with the adaptation of windows server 2022, because I tested it on windows server 2019 and it is no problem.

May I know how did you run the powershell script "install_ovs.ps1"? By running ps script on a ssh connection or on a RDP connection? Please ensure to run it on a RDP (Remote desktop) connection or using console directly. I used to hit similar issues on a ssh connection because the path in the script is possible to be resolved as a wrong path on a ssh connection.

hwdef commented 2 years ago

yes, I run the powershell on a RDP connection. The service registration is successful, but it cannot be started

图片

hwdef commented 2 years ago

图片

wenyingd commented 2 years ago

Please help show the result of command "pnputil.exe -e".

Besides, could you try to run this command in powershell directly "C:\openvswitch\usr\sbin\ovsdb-server.exe C:\openvswitch\etc\openvswitch\conf.db -vfile:info --remote=punix:db.sock --remote=ptcp:6640 --log-file --pidfile", and paste the output here

hwdef commented 2 years ago
PS C:\Users\Administrator>  pnputil.exe -e
Microsoft PnP Utility

Published name :            oem3.inf
Driver package provider :   INTEL
Class :                     System devices
Driver date and version :   07/18/1968 10.1.11.4
Signer name :               Microsoft Windows Hardware Compatibility Publisher

Published name :            oem4.inf
Driver package provider :   INTEL
Class :                     System devices
Driver date and version :   07/18/1968 10.1.11.4
Signer name :               Microsoft Windows Hardware Compatibility Publisher

Published name :            oem5.inf
Driver package provider :   INTEL
Class :                     System devices
Driver date and version :   07/18/1968 10.1.11.4
Signer name :               Microsoft Windows Hardware Compatibility Publisher

Published name :            oem6.inf
Driver package provider :   Marvell
Class :                     Network adapters
Driver date and version :   07/05/2021 3.1.3.0
Signer name :               Microsoft Windows Hardware Compatibility Publisher

Published name :            oem7.inf
Driver package provider :   Intel
Class :                     Network adapters
Driver date and version :   06/22/2021 12.19.1.37
Signer name :               Microsoft Windows Hardware Compatibility Publisher

Published name :            oem2.inf
Driver package provider :   ASIX
Class :                     Network adapters
Driver date and version :   11/09/2021 2.22.2.0
Signer name :               Microsoft Windows Hardware Compatibility Publisher

Published name :            oem9.inf
Driver package provider :   NVIDIA Corporation
Class :                     Sound, video and game controllers
Driver date and version :   01/02/2022 1.3.39.3
Signer name :               Microsoft Windows Hardware Compatibility Publisher

Published name :            oem8.inf
Driver package provider :   NVIDIA
Class :                     Display adapters
Driver date and version :   03/17/2022 30.0.15.1215
Signer name :               Microsoft Windows Hardware Compatibility Publisher

Published name :            oem11.inf
Driver package provider :   The Linux Foundation (R)
Class :                     Network Service
Driver date and version :   10/13/2021 2.15.2.0
Signer name :               WDKTestCert appveyor,132785990465004813

Published name :            oem10.inf
Driver package provider :   The Linux Foundation (R)
Class :                     Network Service
Driver date and version :   07/30/2021 2.14.2.0
Signer name :               WDKTestCert appveyor,132720997603577275

Published name :            oem12.inf
Driver package provider :   The Linux Foundation (R)
Class :                     Network Service
Driver date and version :   11/19/2021 2.15.3.0
Signer name :               WDKTestCert appveyor,132817604335078165

Published name :            oem1.inf
Driver package provider :   Microsoft
Class :                     Printers
Driver date and version :   06/21/2006 10.0.20348.1
Signer name :               Microsoft Windows

Published name :            oem0.inf
Driver package provider :   Microsoft
Class :                     Printers
Driver date and version :   06/21/2006 10.0.20348.1
Signer name :               Microsoft Windows

图片

wenyingd commented 2 years ago

Please try to re-install OVS first. The steps include:

  1. PS> uninstall-OVS.ps1 (download from here: https://github.com/antrea-io/antrea/blob/main/hack/windows/Uninstall-OVS.ps1)
  2. PS> rm -r C:/openvswitch
  3. PS> install-OVS.ps1

We tried to install OVS on Server 2022, and succeeded.

XinShuYang commented 2 years ago

We tried to install OVS on Server 2022, and succeeded.

image
hwdef commented 2 years ago

I followed the instructions above to reinstall once, and it still failed, The error message is the same as before. Now that you have successfully tested, I think this is a problem with my environment, I will continue to investigate, thank you for your help. 图片

hwdef commented 2 years ago

图片

All executables have no output, is this normal?

@wenyingd @XinShuYang

hwdef commented 2 years ago

图片

Maybe this is the reason

hwdef commented 2 years ago

图片 图片

hwdef commented 2 years ago

I finally confirmed that the issues were caused by missing the three dll above. The reason for the lack is that these three dll are brought when installing docker, and I am using containerd. 图片

hwdef commented 2 years ago

By the way, docker has been deprecated in k8s 1.24, should the ovs installation script be equipped with containerd?