minikube: Increase vm-driver detection timeout from 2s to 4s for hyperV

The exact command to reproduce the issue: minikube start --vm-driver=hyperv

The full output of the command that failed:

  • minikube v1.7.2 on Microsoft Windows 10 Pro 10.0.17763 Build 17763
  • Using the hyperv driver based on user configuration

! ‘hyperv’ driver reported an issue: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online failed:

X hyperv does not appear to be installed

The output of the minikube logs command:

* X Error getting config: cluster “minikube” does not exist *

The operating system version: Windows 10 Pro

Hyper-V is installed, enabled, and works fine for docker desktop:

Output of Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online:

PS C:\WINDOWS\system32> Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online

FeatureName : Microsoft-Hyper-V-All DisplayName : Hyper-V Description : Provides services and management tools for creating and running virtual machines and their resources. RestartRequired : Possible State : Enabled CustomProperties :

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 18 (2 by maintainers)

Most upvoted comments

I’m running into the same issue, and my results for the Powershell command are as stated. I did measure the timing and mine is running at 2 sec and 9 ms so technically over by just a hair. PR #6422 looks like it was a recent add, can we extend the timeout to 3 or 4 sec?

Also a note that for now adding a ‘–force’ to your start command got me around it.

I’m running into the same issue, and my results for the Powershell command are as stated. I did measure the timing and mine is running at 2 sec and 9 ms so technically over by just a hair. PR #6422 looks like it was a recent add, can we extend the timeout to 3 or 4 sec?

Also a note that for now adding a ‘–force’ to your start command got me around it.

The “–force” worked for me. For me, the HyperV response is taking more than 5 Sec. the command “minikube start --vm-driver=hyperv --force” resolve it.

image

flag --force doesn’t help

image

@ajjensen13 If you really has hyperv configured correctly, you might have the same problem as I had

For me the problem was the hyperv driver timed out during state check (Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online). It has a fix 2sec timeout (see #6422) and for me it need 3-4sec to return.

To confirm this please run this command in powershell and copy the output here:

measure-command {Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online | out-host}

For example my output to this command:

FeatureName      : Microsoft-Hyper-V-All
DisplayName      : Hyper-V
Description      : Provides services and management tools for creating and running virtual machines and their resources                    .
RestartRequired  : Possible
State            : Enabled
CustomProperties :

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 3
Milliseconds      : 182
Ticks             : 31827615
TotalDays         : 3,68375173611111E-05
TotalHours        : 0,000884100416666667
TotalMinutes      : 0,053046025
TotalSeconds      : 3,1827615
TotalMilliseconds : 3182,7615

So it takes 3sec to run the command for me. If you also see that more than 2sec (or close to 2sec) in TotalSeconds you probably has the timeout problem.