networkop / cx

Containerised Cumulus VX
19 stars 4 forks source link

Interfaces not being renamed to swp# #8

Closed jhlasnik closed 1 year ago

jhlasnik commented 1 year ago

In my initial testing of the 5.3 image I found that the current build is not changing the port names from eth1+ over to swp1+

root@cvx1:mgmt:~# nv set interface eth1 ip address 3.3.3.3/32
root@cvx1:mgmt:~# nv set interface eth2 ip address 3.3.3.3/32
root@cvx1:mgmt:~# nv set interface eth2 router ospf area 0
root@cvx1:mgmt:~# nv set interface eth1 router ospf area 0
root@cvx1:mgmt:~# nv set vrf default router ospf router-id 3.3.3.3
root@cvx1:mgmt:~# nv set interface lo router ospf area 0
root@cvx1:mgmt:~# nv config apply -y
Invalid config [rev_id: 3]
  Config invalid at interface.eth1: {'x-cue-marker': 'def', 'properties': {'type': {'enum': ['eth']}}} is not allowed for {'ip': {'address': {'3.3.3.3/32': {}}}, 'type': 'eth', 'router': {'ospf': {'area': 0, 'enable': 'on'}}}
root@cvx1:mgmt:~# net show interface swp1
     Name  MAC  Speed  MTU  Mode
---  ----  ---  -----  ---  -------------
UNK  swp1       N/A         NotConfigured

Routing
-------
  % Can't find interface swp1

Looking into the code for the netq agent on a physical switch I found this under the same file referenced below: https://github.com/networkop/cx/blob/main/Dockerfile-5.0.2#L151

line 931:


class PortNameRegex:
    # Examples: swp1, swp1s0, sw1p1, sw1p1s0
    SWP = re.compile(r'^sw(\d)*p(\d)+(s\d)?')

https://github.com/networkop/cx/blob/main/Dockerfile-5.3.0#L33 However it looks like we're no longer using that package based on the 5.1+ images so I'm not sure what packages is handling the name changes now.

networkop commented 1 year ago

hey @jhlasnik , was it working before? can you explain why you want to name interfaces ethX instead of swpX?

jhlasnik commented 1 year ago

Hey @networkop, I found what my issue was I referenced the wrong topo file that I thought had them set as eth instead of swp in the file.

I ran into some other issues when trying to commit, once I have a chance to look at it again I'll open up another issue with the errors I'm having there.