简体   繁体   中英

vswitch not found hyperV while running minikube start

I had created a Virtual switch with the name "Minikube2" . Previously I had created Virtual switch with the name "minikube" ,but deleted it later as there was config issue.

Did all the required configuration -"sharing on ethernet .."

Now when I try to run

minikube start --kubernetes-version="v1.10.3" --vm-driver="hyperv" --hyperv-virtual-switch="minikube2"

it downloads the ISO , but fails to configure the switch -

it says vswitch "minikube2" not found

Short answer is to delete C:\\Users\\%USERNAME%\\.minikube and try again. Below is my investigation:

First I have created Virtual Switch "minikube", started the cluster and it worked as expected. Then I stopped minikube, created new "Minikube2" switch and started minikube

minikube start --kubernetes-version="v1.10.3" --vm-driver="hyperv" --hyperv-virtual-switch="minikube2" --v=9

Appeared issue:

Starting local Kubernetes v1.10.3 cluster... Starting VM... [executing ==>] : C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NoProfile -NonInteractive ( Hyper-V\\Get-VM minikube ).state [stdout =====>] : Off

[stderr =====>] : [executing ==>] : C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NoProfile -NonInteractive Hyper-V\\Start-VM minikube [stdout =====>] : [stderr =====>] : Hyper-V\\Start-VM : 'minikube' failed to start. Synthetic Ethernet Port (Instance ID AF9D08DC-2625-4F24-93E5-E09BAD904899): Error 'Insufficient system resources exist to complete the requested service.'. Failed to allocate resources while connecting to a virtual network. The Ethernet switch may not exist. 'minikube' failed to start. (Virtual machine ID 863D6558-78EC-4648-B712-C1FDFC907588) 'minikube' Synthetic Ethernet Port: Failed to finish reserving resources with Error 'Insufficient system resources exist to complete the requested service.' (0x800705AA). (Virtual machine ID 863D6558-78EC-4648-B712-C1FDFC907588) 'minikube' failed to allocate resources while connecting to a virtual network: Insufficient system resources exist to complete the requested service. (0x800705AA) (Virtual Machine ID 863D6558-78EC-4648-B712-C1FDFC907588). The Ethernet switch may not exist. Could not find Ethernet switch 'minikube'. At line:1 char:1 + Hyper-V\\Start-VM minikube + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Start-VM], VirtualizationException + FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.StartVM

E1022 12:50:43.384867 6216 start.go:168] Error starting host: Error starting stopped host: exit status 1.

Retrying. E1022 12:50:43.398832 6216 start.go:174] Error starting host: Error starting stopped host: exit status 1 PS C:\\Windows\\system32>

Then I deleted C:\\Users\\%USERNAME%\\.minikube , minikube vm inside Hyper-V and started again:

C:\Windows\system32> minikube start --kubernetes-version="v1.10.3" --vm-driver="hyperv" --hyperv-virtual-switch="minikube2" --v=9

Result:

Starting local Kubernetes v1.10.3 cluster... Starting VM...

Downloading Minikube ISO

170.78 MB / 170.78 MB [============================================] 100.00% 0s Creating CA: C:\\Users\\Vitalii.minikube\\certs\\ca.pem

Creating client certificate: C:\\Users\\Vitalii.minikube\\certs\\cert.pem

----- [stderr =====>] : Using switch "Minikube2"

----- Moving files into cluster...

Downloading kubeadm v1.10.3

Downloading kubelet v1.10.3 Finished

Downloading kubeadm v1.10.3 Finished

Finished Downloading kubelet v1.10.3

Setting up certs... Connecting to

cluster... Setting up kubeconfig...

Starting cluster components...

Kubectl is now configured to use the cluster.

PS C:\Windows\system32> kubectl get pods --all-namespaces
NAMESPACE     NAME                                    READY     STATUS    RESTARTS   AGE
kube-system   coredns-c4cffd6dc-cjzsm                 1/1       Running   0          1m
kube-system   etcd-minikube                           1/1       Running   0          56s
kube-system   kube-addon-manager-minikube             1/1       Running   0          13s
kube-system   kube-apiserver-minikube                 1/1       Running   0          41s
kube-system   kube-controller-manager-minikube        1/1       Running   0          1m
kube-system   kube-dns-86f4d74b45-w62rv               2/3       Running   0          1m
kube-system   kube-proxy-psgss                        1/1       Running   0          1m
kube-system   kube-scheduler-minikube                 1/1       Running   0          21s
kube-system   kubernetes-dashboard-6f4cfc5d87-jz266   1/1       Running   0          1m
kube-system   storage-provisioner                     1/1       Running   0          1m

It looks like HyperV driver has some problems running Minikube. For me when trying to run it on Windows it was much simpler to use the docker driver. Just run:

minikube start --driver=docker

and it works without problems. Make sure your docker daemon is running eg with Docker Desktop. For reference about drivers look here: https://kubernetes.io/docs/setup/learning-environment/minikube/#specifying-the-vm-driver

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM