In my Ubuntu 16.04.2 VM created by chef-provisioning-vsphere, there is a network interface 'docker0' created for docker. Its IP 172.17.0.1 will be displayed on vSphere Client and returned by vm.guest.ipAddress.
After adding the following configuration in /etc/vmware-tools/tools.conf, the vSphere Client will not display docker0 IP, but only the expected ens192 IP. However, when powering on the VM, there is still a few seconds that vSphere Client gets docker0 IP and displays it, and it's captured by chef-provisioning-vsphere's vm.guest.ipAddress call. Then chef-provisioning-vsphere still use 172.17.0.1 to connect to the VM. If stop the stuck chef-client and run again, chef-client will get the expected IP of ens192.
Versions:
Platform Details
Scenario:
In my Ubuntu 16.04.2 VM created by chef-provisioning-vsphere, there is a network interface 'docker0' created for docker. Its IP 172.17.0.1 will be displayed on vSphere Client and returned by
vm.guest.ipAddress
.After adding the following configuration in /etc/vmware-tools/tools.conf, the vSphere Client will not display docker0 IP, but only the expected ens192 IP. However, when powering on the VM, there is still a few seconds that vSphere Client gets docker0 IP and displays it, and it's captured by chef-provisioning-vsphere's
vm.guest.ipAddress
call. Then chef-provisioning-vsphere still use 172.17.0.1 to connect to the VM. If stop the stuck chef-client and run again, chef-client will get the expected IP of ens192.In order to bypass this issue, I changed this line https://github.com/chef-partners/chef-provisioning-vsphere/blob/master/lib/chef/provisioning/vsphere_driver/driver.rb#L651 to: