• Kubernetes Submit Queue's avatar
    Merge pull request #40892 from hpcloud/vsphere_findbyuuid · 93bd6b3b
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 41223, 40892, 41220, 41207, 41242)
    
    Fixes #40819 and Fixes #33114
    
    **What this PR does / why we need it**:
    
    Start looking up the virtual machine by it's UUID in vSphere again. Looking up by IP address is problematic and can either not return a VM entirely, or could return the wrong VM.
    
    Retrieves the VM's UUID in one of two methods - either by a `vm-uuid` entry in the cloud config file on the VM, or via sysfs. The sysfs route requires root access, but restores the previous functionality.
    
    Multiple VMs in a vCenter cluster can share an IP address - for example, if you have multiple VM networks, but they're all isolated and use the same address range. Additionally, flannel network address ranges can overlap.
    
    vSphere seems to have a limitation of reporting no more than 16 interfaces from a virtual machine, so it's possible that the IP address list on a VM is completely untrustworthy anyhow - it can either be empty (because the 16 interfaces it found were veth interfaces with no IP address), or it can report the flannel IP.
    
    **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
    
    Fixes #40819
    Fixes #33114
    
    **Special notes for your reviewer**:
    
    **Release note**:
    
    ```release-note
    Reverts to looking up the current VM in vSphere using the machine's UUID, either obtained via sysfs or via the `vm-uuid` parameter in the cloud configuration file.
    ```
    93bd6b3b
Name
Last commit
Last update
..
providers Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
cloud.go Loading commit data...
doc.go Loading commit data...
plugins.go Loading commit data...