Change:
// 	t.Fatalf("Cannot delete VMDK volume %s: %v", volPath, err) // } } <ins> func TestGetVMName(t *testing.T) { cfg, ok := configFromEnv() if !ok { t.Skipf("No config found in environment") } // Create vSphere configuration object vs, err := newVSphere(cfg) if err != nil { t.Fatalf("Failed to construct/authenticate vSphere: %s", err) } // Create context ctx, cancel := context.WithCancel(context.Background()) defer cancel() // Create vSphere client err = vSphereLogin(ctx, vs) if err != nil { t.Errorf("Failed to create vSpere client: %s", err) } defer vs.client.Logout(ctx) // Get VM name vmName, err := getVMName(vs.client, &cfg) if err != nil { t.Fatalf("Failed to get VM name: %s", err) } if vmName != "vmname" { t.Errorf("Expect VM name 'vmname', got: %s", vmName) } } </ins>

Discussion:
Is this a BUG REPORT or FEATURE REQUEST? (choose one): Kubernetes version (use ): Environment: Cloud provider or hardware configuration: 4 VMs via ESXI 6.5 on a single physical server OS (e.g. from /etc/os-release): Ubuntu 16.04.2 Kernel (e.g. ):Install tools: kubeadm Others: docker What happened: When bootstraping a new cluster with and the cloud-provider, the cant' start because of the following panic error. Moreover, it is not possible to specify the manually in the cloud-provider config file because of the following error: What you expected to happen: My kubernetes cluster initialized on my master node with cloud-provider enabled. How to reproduce it (as minimally and precisely as possible): /etc/systemd/system/kubelet.service.d/10- /etc/kubernetes/cloud-config kubeadm init Anything else we need to know: Each VM has 2 network interfaces, one with a public IP (requirement of when doing virtualisation on a single physical server) and one with a private IP.
1 doesn't support yet, so you got this error: But I find that there is no field in your file. That's strange. Where did you configure ? Once kubelet gets the error above, it will fail to run.
I didn't put the in my example because it was just a try to get around the main issue.
As for the panic, it seems like because the below reason: The code panics : The is from : Dig into , we can find that it may return a nil : A nil will lead to the panic. cc
:) Don't know when and why the Returnval is nil. may know more about this :)
I will give a quick fix to avoid the panic.
if vmuuid is not specified in the config file, we retrieve the vm uuid at we have observed with ubuntu 16.04 incorrect uuid is present in /sys/devices/virtual/dmi/id/product_uuid with incorrect uuid, you may not be getting VM ref. Is it the issue? can you verify VM UUID using power cli. Result on Ubuntu 16.04 Result on Photon OS VM
Since you are retrieving incorrect UUID, for the FindByUUID method if no managed entities corresponding to the vm-uuid is found, null is returned. addresses this fix.

However to overcome the problem, you can specify the correct vm-uuid in the and it will read the vm reference form this UUID and it will all work fine.
Thanks for explanation! Could you please verify this on your env? Since you are retrieving incorrect UUID, for the FindByUUID method if no managed entities corresponding to the vm-uuid is found, null is returned. Since no managed entity is found in this case, should we return error here? So that can catch the error.
oh yes, thanks for the information, that was totally the issue.
We are in the process of fixing the way we fetch vmuuid. we will be parsing the serial number from which is seems tobe matching with the vmuuid we want.
I have this issue still on CentOS 7.3 with kube-controller-manager. I am running Kubernetes 1.6.4 installed using kubeadm. I have used your tip to convert productserial to the right uuid using this script: This solves the invalid memory pointer error above, but it now fails to register the master node. But that is probably a different issue not related to this issue.
We can help debugging the issue. Can you create an issue at please provide kubelet logs.
I manually enabled vsphere cloud provider after kubeadm init which solved the problem. I am happy! Thanks for your help!