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

problem with bond/bridge interface #174

Open
ravjeetsinghb opened this issue Nov 6, 2020 · 0 comments
Open

problem with bond/bridge interface #174

ravjeetsinghb opened this issue Nov 6, 2020 · 0 comments

Comments

@ravjeetsinghb
Copy link

ravjeetsinghb commented Nov 6, 2020

I am trying to setup agent to fill information into netbox but get this error. It seems to be issue with getting information for bonding.
The debug output

h01-san1 ~ # netbox_agent -c netbox_agent.yml --register --debug
DEBUG:root:Ignore interface vethRA7Y61
DEBUG:root:Ignore interface vethQP6YIJ
DEBUG:root:Ignore interface veth9KN6H1
DEBUG:root:Ignore interface vethSHWO4N
DEBUG:root:Ignore interface vethUH9K5D
DEBUG:root:Ignore interface vethPH0SHW
DEBUG:root:Ignore interface veth58UQ5P
DEBUG:root:Ignore interface vethL3IIMY
DEBUG:root:Ignore interface vethN29UP4
DEBUG:root:Ignore interface vethM04X5S
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): netbox22a.xxxx.net:80
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "OPTIONS /api/dcim/interfaces/ HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): netbox22a.xxxx.net:443
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "OPTIONS /api/dcim/interfaces/ HTTP/1.1" 200 8738
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "OPTIONS /api/ipam/ip-addresses/ HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "OPTIONS /api/ipam/ip-addresses/ HTTP/1.1" 200 4700
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "GET /api/dcim/devices/?serial=3L8W382 HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "GET /api/dcim/devices/?serial=3L8W382 HTTP/1.1" 200 52
Datacenter: sandiego1
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "GET /api/dcim/sites/?slug=sandiego1 HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "GET /api/dcim/sites/?slug=sandiego1 HTTP/1.1" 200 656
Netbox Datacenter: Sandiego1
Rack: None
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "GET /api/dcim/sites/?slug=sandiego1 HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "GET /api/dcim/sites/?slug=sandiego1 HTTP/1.1" 200 656
Netbox Rack: None
Is blade: False
Product Name: PowerEdge R730xd
Chassis: PowerEdge R730xd
Chassis service tag: xxxxxxxx
Service tag: xxxxxxxxx
NIC:
[{'bonding': False,
  'bonding_slaves': [],
  'ethtool': {'duplex': '-', 'link': 'yes', 'speed': '-'},
  'ip': ['10.98.2.1/20', 'fe80::eef4:bbff:feee:c5a8/64'],
  'mac': 'ec:f4:bb:ee:c5:a8',
  'name': 'br0',
  'virtual': False,
  'vlan': None},
 {'bonding': True,
  'bonding_slaves': ['eth0', 'eth1'],
  'ethtool': {'adv_autoneg': 'No',
              'adv_link_modes': 'Not reported',
              'autoneg': 'off',
              'duplex': 'Full',
              'link': 'yes',
              'port': 'Other',
              'ports': '[ ]',
              'speed': '10000Mb/s',
              'sup_autoneg': 'No',
              'sup_link_modes': 'Not reported'},
  'ip': ['fe80::eef4:bbff:feee:c5a8/64'],
  'mac': 'ec:f4:bb:ee:c5:a8',
  'name': 'bond0',
  'virtual': False,
  'vlan': None},
 {'bonding': False,
  'bonding_slaves': [],
  'ethtool': {'adv_autoneg': 'Yes',
              'adv_link_modes': '10baseT/Half 10baseT/Full',
              'autoneg': 'on',
              'duplex': 'Unknown! (255)',
              'link': 'no',
              'port': 'Twisted Pair',
              'ports': '[ TP ]',
              'speed': 'Unknown!',
              'sup_autoneg': 'Yes',
              'sup_link_modes': '10baseT/Half 10baseT/Full'},
  'ip': None,
  'mac': 'ec:f4:bb:ee:c5:ac',
  'name': 'eth2',
  'virtual': False,
  'vlan': None},
 {'bonding': False,
  'bonding_slaves': [],
  'ethtool': {'adv_autoneg': 'Yes',
              'adv_link_modes': '100baseT/Full',
              'autoneg': 'on',
              'duplex': 'Full',
              'link': 'yes',
              'port': 'Twisted Pair',
              'ports': '[ TP ]',
              'speed': '10000Mb/s',
              'sup_autoneg': 'Yes',
              'sup_link_modes': '100baseT/Full'},
  'ip': None,
  'mac': 'ec:f4:bb:ee:c5:a8',
  'name': 'eth0',
  'virtual': False,
  'vlan': None},
 {'bonding': False,
  'bonding_slaves': [],
  'ethtool': {'adv_autoneg': 'Yes',
              'adv_link_modes': '10baseT/Half 10baseT/Full',
              'autoneg': 'on',
              'duplex': 'Unknown! (255)',
              'link': 'no',
              'port': 'Twisted Pair',
              'ports': '[ TP ]',
              'speed': 'Unknown!',
              'sup_autoneg': 'Yes',
              'sup_link_modes': '10baseT/Half 10baseT/Full'},
  'ip': None,
  'mac': 'ec:f4:bb:ee:c5:ad',
  'name': 'eth3',
  'virtual': False,
  'vlan': None},
 {'bonding': False,
  'bonding_slaves': [],
  'ethtool': {'adv_autoneg': 'Yes',
              'adv_link_modes': '100baseT/Full',
              'autoneg': 'on',
              'duplex': 'Full',
              'link': 'yes',
              'port': 'Twisted Pair',
              'ports': '[ TP ]',
              'speed': '10000Mb/s',
              'sup_autoneg': 'Yes',
              'sup_link_modes': '100baseT/Full'},
  'ip': None,
  'mac': 'ec:f4:bb:ee:c5:a8',
  'name': 'eth1',
  'virtual': False,
  'vlan': None},
 {'bonding': False,
  'bonding_slaves': [],
  'ethtool': {'duplex': '-', 'link': 'yes', 'speed': '-'},
  'ip': ['::1/128'],
  'mac': None,
  'name': 'lo',
  'virtual': False,
  'vlan': None},
 {'bonding': False,
  'ip': ['10.83.15.1/24'],
  'ipmi': True,
  'mac': '14:18:77:5b:49:f5',
  'name': 'IPMI',
  'vlan': None}]
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "GET /api/dcim/sites/?slug=sandiego1 HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "GET /api/dcim/sites/?slug=sandiego1 HTTP/1.1" 200 656
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "GET /api/dcim/sites/?slug=sandiego1 HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "GET /api/dcim/sites/?slug=sandiego1 HTTP/1.1" 200 656
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "GET /api/dcim/devices/?serial=3L8W382 HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "GET /api/dcim/devices/?serial=3L8W382 HTTP/1.1" 200 52
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "GET /api/dcim/device-roles/?name=Server HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "GET /api/dcim/device-roles/?name=Server HTTP/1.1" 200 254
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "GET /api/dcim/device-types/?model=PowerEdge+R730xd HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "GET /api/dcim/device-types/?model=PowerEdge+R730xd HTTP/1.1" 200 571
INFO:root:Creating server (serial: xxxxxxxx) h01-san1
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "POST /api/dcim/devices/ HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "GET /api/dcim/devices/ HTTP/1.1" 200 52
DEBUG:root:Updating Server...
DEBUG:root:Ignore interface vethRA7Y61
DEBUG:root:Ignore interface vethQP6YIJ
DEBUG:root:Ignore interface veth9KN6H1
DEBUG:root:Ignore interface vethSHWO4N
DEBUG:root:Ignore interface vethUH9K5D
DEBUG:root:Ignore interface vethPH0SHW
DEBUG:root:Ignore interface veth58UQ5P
DEBUG:root:Ignore interface vethL3IIMY
DEBUG:root:Ignore interface vethN29UP4
DEBUG:root:Ignore interface vethM04X5S
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "OPTIONS /api/dcim/interfaces/ HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "OPTIONS /api/dcim/interfaces/ HTTP/1.1" 200 8738
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "OPTIONS /api/ipam/ip-addresses/ HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "OPTIONS /api/ipam/ip-addresses/ HTTP/1.1" 200 4700
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "GET /api/dcim/devices/?serial=3L8W382 HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "GET /api/dcim/devices/?serial=3L8W382 HTTP/1.1" 200 52
DEBUG:root:Creating/Updating NIC...
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "GET /api/dcim/interfaces/ HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "GET /api/dcim/interfaces/ HTTP/1.1" 200 52
DEBUG:urllib3.connectionpool:http://netbox22a.xxxx.net:80 "GET /api/dcim/interfaces/?mac_address=ec%3Af4%3Abb%3Aee%3Ac5%3Aa8&name=br0 HTTP/1.1" 301 194
DEBUG:urllib3.connectionpool:https://netbox22a.xxxx.net:443 "GET /api/dcim/interfaces/?mac_address=ec%3Af4%3Abb%3Aee%3Ac5%3Aa8&name=br0 HTTP/1.1" 200 52
INFO:root:Interface ec:f4:bb:ee:c5:a8 not found, creating..
Traceback (most recent call last):
  File "/usr/local/bin/netbox_agent", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/netbox_agent/cli.py", line 44, in main
    return run(config)
  File "/usr/local/lib/python3.6/dist-packages/netbox_agent/cli.py", line 39, in run
    server.netbox_create_or_update(config)
  File "/usr/local/lib/python3.6/dist-packages/netbox_agent/server.py", line 292, in netbox_create_or_update
    self.network.create_or_update_netbox_network_cards()
  File "/usr/local/lib/python3.6/dist-packages/netbox_agent/network.py", line 403, in create_or_update_netbox_network_cards
    interface = self.create_netbox_nic(nic)
  File "/usr/local/lib/python3.6/dist-packages/netbox_agent/network.py", line 251, in create_netbox_nic
    name=nic['name'], mac=nic['mac'], device=self.device.name))
AttributeError: 'NoneType' object has no attribute 'name'

We have a setup of 2 interfaces and bonding on them with bridge interface.

h01-san1 ~ # ifconfig 
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
        inet6 fe80::eef4:bbff:feee:c5a8  prefixlen 64  scopeid 0x20<link>
        ether ec:f4:bb:ee:c5:a8  txqueuelen 1000  (Ethernet)
        RX packets 268588184682  bytes 245511024399107 (245.5 TB)
        RX errors 0  dropped 2516252  overruns 0  frame 0
        TX packets 145134142071  bytes 86632108119723 (86.6 TB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.98.2.1  netmask 255.255.240.0  broadcast 10.98.15.255
        inet6 fe80::eef4:bbff:feee:c5a8  prefixlen 64  scopeid 0x20<link>
        ether ec:f4:bb:ee:c5:a8  txqueuelen 1000  (Ethernet)
        RX packets 22402283915  bytes 85553047450675 (85.5 TB)
        RX errors 0  dropped 23  overruns 0  frame 0
        TX packets 17438390546  bytes 69227577798703 (69.2 TB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST>  mtu 1500
        ether ec:f4:bb:ee:c5:a8  txqueuelen 1000  (Ethernet)
        RX packets 264645896218  bytes 245274484478146 (245.2 TB)
        RX errors 0  dropped 1251016  overruns 0  frame 0
        TX packets 145134133460  bytes 86632106147804 (86.6 TB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST>  mtu 1500
        ether ec:f4:bb:ee:c5:a8  txqueuelen 1000  (Ethernet)
        RX packets 3942288505  bytes 236539923421 (236.5 GB)
        RX errors 0  dropped 8281  overruns 0  frame 0
        TX packets 8611  bytes 1971919 (1.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
@ravjeetsinghb ravjeetsinghb changed the title problem with bond interface problem with bond/bridge interface Nov 6, 2020
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