-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid ip address fix #193
Conversation
… behavior when obtaining the ssh IP address This commit adds an option that forces get_ssh_ip to filter the vm.guest.net entries for a network adapter that ‘exists’ on the VM, as vsphere does not always return the correct primary ipAddress if new interfaces have been defined at provision time or later. We encountered the situation at NSIDC when provisioning VMs which were running docker/docker-compose and had docker-defined internal interfaces that vsphere picked up and assumed were the primary IP. This will not address situations where users have defined a VM with multiple ‘legitimate’ interfaces, and throws an error if that situation is encountered.
@app.call env | ||
end | ||
|
||
private | ||
|
||
def filter_guest_nic(vm, machine) | ||
return vm.guest.ipAddress unless machine.provider_config.real_nic_ip | ||
adapters = vm.guest.net.select { |g| g.deviceConfigId > 0 }.map { |g| g.ipAddress[0] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the map
call here will end up giving us an array of IP addresses, not adapter objects. If I'm reading this correctly, adapters
should be renamed to ips
or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent point. Will update accordingly.
- Bump version should be a minor rev, not a patch - updated/tagged accordingly - Updated variable name from adapter to ip_addresses for clarity - Move error text into localization yaml
@@ -1,3 +1,8 @@ | |||
## [1.9.0 (2016-05-17)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.8.2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed a spot (in the link url)
Fix in response to #192
Adds an configurable option to allow the plugin to filter the machine network interfaces for one with an actual adapter and return that IP instead of the vsphere primary ip address.