Skip to content
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

No SNMP fallback when getting MAC table on ONIE switches? #7462

Open
kcgthb opened this issue Aug 8, 2024 · 0 comments
Open

No SNMP fallback when getting MAC table on ONIE switches? #7462

kcgthb opened this issue Aug 8, 2024 · 0 comments
Labels

Comments

@kcgthb
Copy link
Member

kcgthb commented Aug 8, 2024

Description

For ONIE switches, the MacMap / refresh_switches routine first tries to connect via SSH to retrieve the MAC table:

if($self->{switchparmhash}->{$switch}->{switchtype} eq 'onie'){
#for cumulus switch, the MAC table can be retrieved with ssh
#which is much faster than snmp
my $mymac;
my $myport;
my @res=xCAT::Utils->runcmd("ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no $switch 'bridge fdb show|grep -i -v permanent|tr A-Z a-z 2>/dev/null' 2>/dev/null",-1);
if ($::RUNCMD_RC) {
xCAT::MsgUtils->message("S", "Failed to get mac table with ssh to $switch, fall back to snmp! To obtain mac table with ssh, please make sure the passwordless root ssh to $switch is available");

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants