xcat-core
xcat-core copied to clipboard
No SNMP fallback when getting MAC table on ONIE switches?
Description
For ONIE switches, the MacMap / refresh_switches routine first tries to connect via SSH to retrieve the MAC table: https://github.com/xcat2/xcat-core/blob/c8cb1d6a38f9dc204313ff7b12b055f03ca233e6/perl-xCAT/xCAT/MacMap.pm#L720-L728
Unfortunately, when the SSH connection fails, and despite the "fall back to snmp" comment, there doesn't seem to be any kind of fallback to SNMP, an error is reported and the function exists.
Example
For instance, let's consider the following ONIE switch:
$ lsdef -c esw -i nodetype,switchtype,snmpversion
esw: nodetype=switch
esw: snmpversion=2c
esw: switchtype=onie
If passwordless SSH is not configured, xcatprobe switch_macmap
fails with the following error:
# xcatprobe switch_macmap esw
esw: [mn01]: Error: Failed to get MAC table from esw. Make sure passwordless SSH to the ...[FAIL]
and logs this to cluster.log
:
xcat[28008]: INFO Failed to get mac table with ssh to esw, fall back to snmp! To obtain mac table with ssh, please make sure the passwordless root ssh to esw is available
xcat[28008]: INFO xcatprobe refresh_switch esw ElapsedTime:0 sec
It doesn't seem like it tries to retrieve the MAC table via SNMP, although it should work, because removing the switchtype=onie
attribute makes switch_macmap
work, which proves that SNMP discovery is working:
# chdef esw switchtype=""
1 object definitions have been created or modified.
# xcatprobe switch_macmap esw
Switch Port(MTU) MAC address(VLAN) Node
--------------------------------------------------------------------------------------
esw bond1(9216) b8:cb:29:a7:7d:d9(1) nm01
[...]
Do you have any insight as why the SNMP fallback mechanism doesn't work here?