chef-boneyard / chef-provisioning-vsphere

DEPRECATED: A chef-provisioning provisioner for VMware vSphere
MIT License
17 stars 15 forks source link

Fix issue when checking guest IP of the VM with Docker installed #98

Open jessehu opened 5 years ago

jessehu commented 5 years ago

When docker daemon runs in the VM, there will be a NIC created by Docker and usually has IP like 172.17.x.x. When VM is booting up, VM Tools sometimes reports this IP to vCenter, although the real IP of the non-docker nic will be reported later.

This patch can filter out the docker IP by specifying the prefix of the invalid machine IP via the bootstrap option 'invalid_ip_prefix'. e.g. invalid_ip_prefix: '172.17'.

ticobotbot commented 5 years ago

Can one of the admins verify this patch?

jjlimepoint commented 5 years ago

This will absolutely break my environment as is - 172.18.x.x is a valid internal IP set, not just used by docker. Please don't merge as is! :)

jjlimepoint commented 5 years ago

If you really do need to filter by IP, maybe add something to bootstrap options as a IP filter list, and then filter based on that - then at least it's something you have to specifically turn on, and you can choose your range.

jessehu commented 5 years ago

Thanks @jjlimepoint. Your case "172.18.x.x" makes sense. "add something to bootstrap options as a IP filter list" is a good solution. I will update it later.

jessehu commented 5 years ago

Hi @jjlimepoint , I have updated the patch to use bootstrap options for the IP filter. Please take a look.