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

Error: get_interfaces() not working with FC and VFC Interfaces - NXOS #1876

Open
1 task done
Swaeltjie opened this issue Mar 23, 2023 · 0 comments
Open
1 task done

Comments

@Swaeltjie
Copy link

Description of Issue/Question

When making use of get_interfaces() for a driver for nxos_ssh, there is an error. The error is specifically pertaining to Fibre Channel or Virtual Fiber Channel interfaces. For normal Ethernet Interfaces, all works as expected. For each of these interfaces, there is no speed or bandwidth when completing a show interface fc {number} or show interface vfc {number}.

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

(Place an x between the square brackets where applicable)

  • Yes
  • [] No

Setup

napalm version

(Paste verbatim output from pip freeze | grep napalm between quotes below)

napalm==4.0.0

Network operating system version

(Paste verbatim output from show version - or equivalent - between quotes below)

Cisco Nexus Operating System (NX-OS) Software
Software
  BIOS:      version 2.6.0
  Power Sequencer Firmware:
             Module 1: v1.0
             Module 1: v2.0
             Module 2: v4.8
             Module 3: v1.0
  Fabric Power Sequencer Firmware: Module 0: version v3.0
  Microcontroller Firmware:        version v1.2.2.0
  QSFP Microcontroller Firmware:
             Module 3: v1.7.0.0
  SFP Microcontroller Firmware:
             Module 1: v1.4.0.0
  CXP Microcontroller Firmware:
             Module 2: v1.13.0.0
  kickstart: version 7.3(9)N1(1)
  system:    version 7.3(9)N1(1)
  BIOS compile time:       07/22/2016
  kickstart image file is: bootflash:///n6000-uk9-kickstart.7.3.9.N1.1.bin
  kickstart compile time:  1/28/2021 10:00:00 [01/28/2021 21:09:46]
  system image file is:    bootflash:///n6000-uk9.7.3.9.N1.1.bin
  system compile time:     1/28/2021 10:00:00 [01/28/2021 21:11:20]

Hardware
  cisco Nexus 5696 Chassis ("Nexus 5696 Supervisor")

Steps to Reproduce the Issue

import napalm
from pprint import pprint as pp

driver = napalm.get_network_driver('nxos_ssh')

with driver(hostname='', username='', password='') as device:  
  pp(device.get_interfaces())

The Cisco Nexus device should have interfaces for Fibre Channel or Virtual Fiber Channel as the following:

NXOS_DEVICE# sh int fc1/11 
fc1/11 is up
    Hardware is Fibre Channel, SFP is short wave laser w/o OFC (SN)
    Port WWN is 20:0b:00:de:fb:3a:23:80
    Admin port mode is auto, trunk mode is on
    snmp link state traps are enabled
    Port mode is F, FCID is 0x640140
    Port vsan is 903
    Speed is 8 Gbps
    Transmit B2B Credit is 6
    Receive B2B Credit is 15
    Receive data field Size is 2112
    Beacon is turned off

NXOS_DEVICE# sh int vfc93
vfc93 is trunking
    Bound interface is port-channel93
    Hardware is Ethernet
    Port WWN is 20:5c:00:de:fb:3a:23:bf
    Admin port mode is F, trunk mode is on
    snmp link state traps are enabled
    Port mode is TF
    Port vsan is 903
    Trunk vsans (admin allowed and active) (903)
    Trunk vsans (up)                       (903)
    Trunk vsans (isolated)                 ()
    Trunk vsans (initializing)             ()
    1 minute input rate 112408 bits/sec, 14051 bytes/sec, 1 frames/sec
    1 minute output rate 2944 bits/sec, 368 bytes/sec, 2 frames/sec

Error Traceback

(Paste the complete traceback of the exception between quotes below)

Traceback (most recent call last):
  File "/root/projects/test.py", line 9, in <module>
    all_interfaces = device.get_interfaces()
  File "/usr/local/lib/python3.10/dist-packages/napalm/nxos_ssh/nxos_ssh.py", line 739, in get_interfaces
    interfaces.update(parse_intf_section(entry))
  File "/usr/local/lib/python3.10/dist-packages/napalm/nxos_ssh/nxos_ssh.py", line 165, in parse_intf_section
    speed_data = match.groupdict(-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant