-
Notifications
You must be signed in to change notification settings - Fork 590
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
IPaddr2: add nic_monitor function so VIP can takeover by the other node WHEN t… #916
base: main
Are you sure you want to change the base?
Conversation
…he net wire been pulled
Useful, but beware, ethtool depends on the hardware and network
drivers. ethtool(8) says:
BUGS
Not supported (in part or whole) on all network drivers.
I am not sure whether this applies to the link detection, but
that may as well be the case.
|
Hi @dmuhamedagic : |
On Fri, Jan 27, 2017 at 11:47:40AM -0800, Xin Liang wrote:
Hi @dmuhamedagic :
I think this case(wire been pulled) is NOT rare,
No, it's not, though I cannot recall saying it was.
So, a more compatible way to the link detaction on different OS environment could be acceptable?
It's not about different OS environment, but different network
drivers and hardware. Maybe just checking the exit code would be
enough, sth like:
```
link_test() {
local output
output=$(ethtool $nic 2>/dev/null)
if [ $? -ne 0 ]; then
: interface most probably not supported
elif echo "$output" | grep 'Link detected: no' > /dev/null; then
return 1
fi
return 0
}
if ! link_test; then
ocf_log err "ethtool reports no link"
return $OCF_ERR_GENERIC
fi
```
I'm not sure whether this should be run on probes too: the driver
may not be loaded at the time.
NB: The code above may not be 100% correct.
|
This wont work on any interfaces except ethernet ones. bond, bridge, IPoOB, tunnels, ppp, etc.etc.etc. |
Hi @dmuhamedagic : Hi @bubble75 : |
Do you care to update this pull request with the above suggestion? @bubble75, I find the code in my comment safe for non-ethernet interfaces too. Do you agree?
|
@dmuhamedagic Probably it is, but it should be thoroughly tested. Anyways, link status has nothing to IP addess IMHO. |
IPaddr2: add nic_monitor function so VIP can takeover by the other node WHEN the net wire been pulled