kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.17k stars 4.87k forks source link

hyperv: Unable to start VM: create: creating: exit status 1 (reason unknown) #4303

Closed samgentile42 closed 5 years ago

samgentile42 commented 5 years ago

Ask Question

0

I installed Minikube on Windows 10 but can't get it to run. I tried to start it with: minikube start --vm-driver=hyperv The first error was: [HYPERV_NO_VSWITCH] create: precreate: no External vswitch found. A valid vswitch must be available for this command to run. I then searched on Google and found the solution to this error with this page: https://www.codingepiphany.com/2019/01/04/kubernetes-minikube-no-external-vswitch-found/ I then fixed the problem by defining a vswitch but I got this error: minikube start --vm-driver hyperv --hyperv-virtual-switch "Minikube" o minikube v1.0.1 on windows (amd64) $ Downloading Kubernetes v1.14.1 images in the background ...

Creating hyperv VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...

! Unable to start VM: create: creating: exit status 1

tstromberg commented 5 years ago

Hello Sam!

The HyperV driver doesn't yet show error messages by default. Do you mind running:

minikube start --vm-driver=hyperv --alsologtostderr -v=8

That should reveal more information about what's going on here. Thank you!

ghost commented 5 years ago

Hello!

I have the same problem, I fired the command and got: minikube start --vm-driver hyperv --hyperv-virtual-switch "Default Switch" --alsologtostderr -v=8

Starting VM... [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Hyper-V\Start-VM minikube I0522 10:47:54.780133 8952 cache_images.go:306] [stdout =====>] : [stderr =====>] : Hyper-V\Start-VM : 'minikube' failed to change state. The operation failed with error code '32788'. At line:1 char:1

I0522 10:47:56.178638 8952 cache_images.go:306] I0522 10:47:57.266970 8952 start.go:428] StartHost: create: creating: exit status 1 I0522 10:47:57.266970 8952 utils.go:122] non-retriable error: create: creating: exit status 1 W0522 10:47:57.268531 8952 exit.go:99] Unable to start VM: create: creating: exit status 1

! Unable to start VM: create: creating: exit status 1

edit: As a workaround I turned off Docker for windows and cleaned/stopped everything else in Hyper-V manager so I could bypass this one. Maybe just resource problem and the warning doesn't include clues how to go on. Now with the same command I got a container killed error for first time but it shows as running in Hyper-V. After delete and second try it is okay. There is some disturbance in the force around Hyperv-networking for sure, docker for win has problems too.

dr0pdb commented 5 years ago

Hi @tstromberg , I am facing the same issue as well.

Logs

output of minikube start --vm-driver hyperv --cpus 4 --memory=4096 --hyperv-virtual-switch "HV Virtual Switch"


* minikube v1.1.0 on windows (amd64)
* Creating hyperv VM (CPUs=4, Memory=4096MB, Disk=20000MB) ...
E0528 16:32:54.006018    5416 start.go:529] StartHost: create: creating: exit status 1

X Unable to start VM: create: creating: exit status 1

* Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
  - https://github.com/kubernetes/minikube/issues/new

Output of minikube start --vm-driver=hyperv --alsologtostderr -v=8

W0528 16:41:28.942655   13348 root.go:151] Error reading config file at C:\Users\t-satiwa\.minikube\config\config.json: open C:\Users\t-satiwa\.minikube\config\config.json: The system cannot find the file specified.
I0528 16:41:28.945657   13348 notify.go:128] Checking for updates...
* minikube v1.1.0 on windows (amd64)
I0528 16:41:30.122687   13348 downloader.go:60] Not caching ISO, using https://storage.googleapis.com/minikube/iso/minikube-v1.1.0.iso
I0528 16:41:30.123711   13348 start.go:721] Saving config:
{
    "MachineConfig": {
        "MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.1.0.iso",
        "Memory": 2048,
        "CPUs": 2,
        "DiskSize": 20000,
        "VMDriver": "hyperv",
        "ContainerRuntime": "docker",
        "HyperkitVpnKitSock": "",
        "HyperkitVSockPorts": [],
        "XhyveDiskDriver": "ahci-hd",
        "DockerEnv": null,
        "InsecureRegistry": null,
        "RegistryMirror": null,
        "HostOnlyCIDR": "192.168.99.1/24",
        "HypervVirtualSwitch": "",
        "KvmNetwork": "default",
        "DockerOpt": null,
        "DisableDriverMounts": false,
        "NFSShare": [],
        "NFSSharesRoot": "/nfsshares",
        "UUID": "",
        "GPU": false,
        "Hidden": false,
        "NoVTXCheck": false
    },
    "KubernetesConfig": {
        "KubernetesVersion": "v1.14.2",
        "NodeIP": "",
        "NodePort": 8443,
        "NodeName": "minikube",
        "APIServerName": "minikubeCA",
        "APIServerNames": null,
        "APIServerIPs": null,
        "DNSDomain": "cluster.local",
        "ContainerRuntime": "docker",
        "CRISocket": "",
        "NetworkPlugin": "",
        "FeatureGates": "",
        "ServiceCIDR": "10.96.0.0/12",
        "ImageRepository": "",
        "ExtraOptions": null,
        "ShouldLoadCachedImages": true,
        "EnableDefaultCNI": false
    }
}
I0528 16:41:30.129685   13348 cache_images.go:307] Attempting to cache image: k8s.gcr.io/kube-addon-manager:v9.0 at C:\Users\t-satiwa\.minikube\cache\images\k8s.gcr.io\kube-addon-manager_v9.0
I0528 16:41:30.124689   13348 cache_images.go:307] Attempting to cache image: gcr.io/k8s-minikube/storage-provisioner:v1.8.1 at C:\Users\t-satiwa\.minikube\cache\images\gcr.io\k8s-minikube\storage-provisioner_v1.8.1
I0528 16:41:30.124689   13348 cache_images.go:307] Attempting to cache image: k8s.gcr.io/pause:3.1 at C:\Users\t-satiwa\.minikube\cache\images\k8s.gcr.io\pause_3.1
I0528 16:41:30.124689   13348 cache_images.go:307] Attempting to cache image: k8s.gcr.io/kube-controller-manager:v1.14.2 at C:\Users\t-satiwa\.minikube\cache\images\k8s.gcr.io\kube-controller-manager_v1.14.2
I0528 16:41:30.124689   13348 cache_images.go:307] Attempting to cache image: k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.13 at C:\Users\t-satiwa\.minikube\cache\images\k8s.gcr.io\k8s-dns-kube-dns-amd64_1.14.13
I0528 16:41:30.124689   13348 cache_images.go:307] Attempting to cache image: k8s.gcr.io/kube-scheduler:v1.14.2 at C:\Users\t-satiwa\.minikube\cache\images\k8s.gcr.io\kube-scheduler_v1.14.2
I0528 16:41:30.125686   13348 cache_images.go:307] Attempting to cache image: k8s.gcr.io/kube-proxy:v1.14.2 at C:\Users\t-satiwa\.minikube\cache\images\k8s.gcr.io\kube-proxy_v1.14.2
I0528 16:41:30.125686   13348 cache_images.go:307] Attempting to cache image: k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:1.14.13 at C:\Users\t-satiwa\.minikube\cache\images\k8s.gcr.io\k8s-dns-dnsmasq-nanny-amd64_1.14.13
I0528 16:41:30.125686   13348 cache_images.go:307] Attempting to cache image: k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1 at C:\Users\t-satiwa\.minikube\cache\images\k8s.gcr.io\kubernetes-dashboard-amd64_v1.10.1
I0528 16:41:30.125686   13348 cache_images.go:307] Attempting to cache image: k8s.gcr.io/coredns:1.3.1 at C:\Users\t-satiwa\.minikube\cache\images\k8s.gcr.io\coredns_1.3.1
I0528 16:41:30.125686   13348 cache_images.go:307] Attempting to cache image: k8s.gcr.io/kube-apiserver:v1.14.2 at C:\Users\t-satiwa\.minikube\cache\images\k8s.gcr.io\kube-apiserver_v1.14.2
I0528 16:41:30.125686   13348 cache_images.go:307] Attempting to cache image: k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.13 at C:\Users\t-satiwa\.minikube\cache\images\k8s.gcr.io\k8s-dns-sidecar-amd64_1.14.13
I0528 16:41:30.130690   13348 cache_images.go:307] Attempting to cache image: k8s.gcr.io/etcd:3.3.10 at C:\Users\t-satiwa\.minikube\cache\images\k8s.gcr.io\etcd_3.3.10
I0528 16:41:30.148688   13348 cluster.go:81] Skipping create...Using existing machine configuration
* Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.
[executing ==>] : C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Hyper-V\Get-VM minikube ).state
[stdout =====>] :
[stderr =====>] : Hyper-V\Get-VM : Hyper-V was unable to find a virtual machine with name "minikube".
At line:1 char:3
+ ( Hyper-V\Get-VM minikube ).state
+   ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (minikube:String) [Get-VM], VirtualizationException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVM

I0528 16:41:30.791629   13348 cluster.go:100] Machine state:
* Restarting existing hyperv VM for "minikube" ...
[executing ==>] : C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Hyper-V\Start-VM minikube
[stdout =====>] :
[stderr =====>] : Hyper-V\Start-VM : Hyper-V was unable to find a virtual machine with name "minikube".
At line:1 char:1
+ Hyper-V\Start-VM minikube
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [Start-VM], VirtualizationException
    + FullyQualifiedErrorId : ObjectNotFound,Microsoft.HyperV.PowerShell.Commands.StartVM

E0528 16:41:31.405057   13348 start.go:529] StartHost: start: exit status 1
I0528 16:41:31.408056   13348 utils.go:122] non-retriable error: start: exit status 1
W0528 16:41:31.408056   13348 exit.go:100] Unable to start VM: start: exit status 1

X Unable to start VM: start: exit status 1

* Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
  - https://github.com/kubernetes/minikube/issues/new
ghost commented 5 years ago

Do your minikube machine visible in HyperV?Since the error msg suggest it is not there anymore. Hyper-V\Start-VM : Hyper-V was unable to find a virtual machine with name "minikube". At line:1 char:1

dr0pdb commented 5 years ago

There are two issues that I am facing. I delete the .minikube directory in order to do a fresh start.

When I run minikube start --vm-driver hyperv --cpus 4 --memory=4096 --hyperv-virtual-switch "HV Virtual Switch", the VM is created and is visible in the Hyper-V Manager but the program just stalls and won't finish at all.

* minikube v1.1.0 on windows (amd64)                                  
* Creating hyperv VM (CPUs=4, Memory=4096MB, Disk=20000MB) ...
* Configuring environment for Kubernetes v1.14.2 on Docker 18.09.6

I have tried waiting for over an hour.

After that I used ctrl + c to exit. Then I used minikube delete to delete the VM. After that when I run minikube start --vm-driver hyperv --cpus 4 --memory=4096 --hyperv-virtual-switch "HV Virtual Switch", I get the error as shown in the above logs.

ghost commented 5 years ago

When you create the machine and it stalls you can login to in Hyperv via docker user and tcuser password to check what it does and why not moves on.Maybe you find something. For me the problem was the docker for windows, after I stopped that minikube started to work, so it had problem with an another container related service. Right now I created an Ubuntu vm for docker and using minikube on Windows until I get bored with the problems on it and create a linux vm for that too.

tstromberg commented 5 years ago

Regrettably, there isn't enough information from the original author in this issue to make it actionable. Since some time has passed, I'm going to close this issue. You may reopen this issue any point by commenting with /reopen, but if possible, please add some additional information, such as:

Thank you for sharing your experience!

m287867 commented 4 years ago

Hi I'am still facing almost the same error when starting minikube ! i tried minikube start --vm-driver=hyperv --alsologtostderr -v=8

and got the following Output :

PS C:\Users\M287867> minikube start --vm-driver=hyperv --alsologtostderr -v=8 W0821 10:51:42.377252 14668 root.go:241] Error reading config file at C:\Users\SADM-M287867.minikube\config\config.json: open C:\Users\SADM-M287867.minikube\config\config.json: The system cannot find the file specified. I0821 10:51:42.410254 14668 start.go:255] hostinfo: {"hostname":"LTDE114207","uptime":4583,"bootTime":1597995319,"procs":284,"os":"windows","platform":"Microsoft Windows 10 Enterprise","platformFamily":"Standalone Workstation","platformVersion":"10.0.16299 Build 16299","kernelVersion":"","virtualizationSystem":"","virtualizationRole":"","hostid":"96064378-f794-4296-99ba-6a84702f0034"} W0821 10:51:42.411258 14668 start.go:263] gopshost.Virtualization returned error: not implemented yet

SureshPaspula commented 3 years ago

This Command helped me to solve the issue minikube start --vm-driver hyperv --hyperv-virtual-switch "Default Switch" --alsologtostderr -v=8