kubernetes / cloud-provider-vsphere

Kubernetes Cloud Provider for vSphere https://cloud-provider-vsphere.sigs.k8s.io
Apache License 2.0
242 stars 177 forks source link

CPI cannot find a suitable IP on VMs with only one interface listed in vSphere #390

Closed tuxiem closed 3 years ago

tuxiem commented 4 years ago

Is this a BUG REPORT or FEATURE REQUEST?: /kind bug

What happened: After installing cloud-provider-vsphere, not all VMs can be provisioned, as the CPI cannot find a suitable IP, even though vSphere lists an IP on the VMs. VM's where several interfaces are listed, works correctly.

VM that won't work:

govc vm.info -json=true "NODE1" | jq -r ".VirtualMachines[].Guest.IpAddress"
172.187.18.185
govc vm.info -json=true "NODE1" | jq -r ".VirtualMachines[].Guest.Net.IpAddress"
null

VM that works as expected:

govc vm.info -json=true "NODE2" | jq -r ".VirtualMachines[].Guest.IpAddress"
172.187.18.191
govc vm.info -json=true "NODE2" | jq -r ".VirtualMachines[].Guest.Net[].IpAddress[]"
172.187.18.191
10.42.5.0
I0910 07:53:36.419648       1 search.go:208] Found node 42336a7c-ca0f-77ca-7fb1-094c735bec09 as vm=VirtualMachine:vm-25845 in vc=VSPHERE and datacenter=DC
I0910 07:53:36.419679       1 search.go:210] Hostname: NODE1, UUID: 42336a7c-ca0f-77ca-7fb1-094c735bec09
I0910 07:53:36.419697       1 nodemanager.go:134] Discovered VM using normal UUID format
I0910 07:53:36.422285       1 nodemanager.go:241] Adding Hostname: NODE1
E0910 07:53:36.422308       1 node_controller.go:140] unable to find suitable IP address for node 42336a7c-ca0f-77ca-7fb1-094c735bec09 with IP family [ipv4]

What you expected to happen: The lookup gives a more precise error description of what action needs to be done. And Either a method on how to fix the missing interfaces in the VM, described in the docs/deployment guide. Or Fix the govc lookup, if everything fails in VirtualMachines[].Guest.Net[].IpAddress[] it should try to use VirtualMachines[].Guest.IpAddress before giving up. (depends ofc on how the communication is handled within k8s for the CPI)

How to reproduce it (as minimally and precisely as possible): Install a linux VM with docker as the container engine, where only one interface is present in vSphere. In the linux VM several interfaces should be present. In govc, lookup the machine. VirtualMachines[].Guest.Net[].IpAddress[] - should return null VirtualMachines[].Guest.IpAddress - should return an IP

Deploy using https://github.com/kubernetes/cloud-provider-vsphere/blob/master/docs/book/tutorials/kubernetes-on-vsphere-with-kubeadm.md and https://github.com/kubernetes-sigs/vsphere-csi-driver/tree/master/manifests/v2.0.0/vsphere-67u3/vanilla

Anything else we need to know?: Work-a-round, a reinstall of the VM might fix the issue with interfaces.

Environment:

davidvonthenen commented 4 years ago

This sounds like this problem... Did you run though these steps?

https://github.com/kubernetes/cloud-provider-vsphere/blob/master/docs/book/known_issues.md

davidvonthenen commented 4 years ago

This sounds like this problem... Did you run though these steps?

https://github.com/kubernetes/cloud-provider-vsphere/blob/master/docs/book/known_issues.md

@tuxiem were you able to give this a try?

tuxiem commented 3 years ago

Sorry for the late reply. The known issue guide you linked to, was the correct answer to our issue :)

Thanks for the help.