Skip to content

Commit

Permalink
[Windows] Provide workaround to install Hyper-V without CPU check (an…
Browse files Browse the repository at this point in the history
…trea-io#1744)

Provide workaround to install Hyper-V without CPU virtualization
capability check. In this way, users could deploy antrea on the
node without virtualization capability.

Signed-off-by: Rui Cao <[email protected]>
  • Loading branch information
ruicao93 authored Jan 16, 2021
1 parent d1c3fb6 commit 30ba724
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion docs/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ and daemons are pre-installed on the Windows Nodes in the demo.
updates.
* Deploy a Linux-based Kubernetes cluster.
* Install [Hyper-V](https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/get-started/install-the-hyper-v-role-on-windows-server)
with management tools.
with management tools. If your Nodes do not have the virtualization
capabilities required by Hyper-V, you could try the workaround
described in the [Known issues](#Known-issues) section.
* Install [Docker](https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=Windows-Server).
* [Install OVS](http://docs.openvswitch.org/en/latest/intro/install/windows/)
and configure the daemons as Windows service.
Expand Down Expand Up @@ -328,3 +330,47 @@ the HNS Network created by antrea-agent is removed, and the Open vSwitch
Extension is disabled by default. In this case, the stale OVS bridge and ports
should be removed. A help script [Clean-AntreaNetwork.ps1](https://raw.githubusercontent.com/vmware-tanzu/antrea/master/hack/windows/Clean-AntreaNetwork.ps1)
can be used to clean the OVS bridge.

2. Hyper-V feature cannot be installed on Windows Node due to the processor not
having the required virtualization capabilities.

If the processor of the Windows Node does not have the required
virtualization capabilities. The installation of Hyper-V feature will fail
with the following error:

```powershell
PS C:\Users\Administrator> Install-WindowsFeature Hyper-V
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
False Maybe Failed {}
Install-WindowsFeature : A prerequisite check for the Hyper-V feature failed.
1. Hyper-V cannot be installed: The processor does not have required virtualization capabilities.
At line:1 char:1
+ Install-WindowsFeature hyper-v
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Hyper-V:ServerComponentWrapper) [Install-WindowsFeature], Exception
+ FullyQualifiedErrorId : Alteration_PrerequisiteCheck_Failed,Microsoft.Windows.ServerManager.Commands.AddWindowsF
eatureCommand
```

The capabilities are required by the Hyper-V `hypervisor` components to
support [Hyper-V isolation](https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/hyperv-container#hyper-v-isolation).
If you only need [Process Isolation](https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/hyperv-container#process-isolation)
on the Nodes. You could apply the following workaround to skip CPU check for
Hyper-V feature installation.

```powershell
# 1. Install containers feature
Install-WindowsFeature containers
# 2. Install Hyper-V management powershell module
Install-WindowsFeature Hyper-V-Powershell
# 3. Install Hyper-V feature without CPU check and disable the "hypervisor"
dism /online /enable-feature /featurename:Microsoft-Hyper-V /all /NoRestart
dism /online /disable-feature /featurename:Microsoft-Hyper-V-Online /NoRestart
# 4. Restart-Computer to take effect
Restart-Computer
```

0 comments on commit 30ba724

Please sign in to comment.