You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
SONiC switch is running the t0 topology. On my DUT switch, ports Ethernet4 to Ethernet96 are in Vlan1000. If use command like config vlan member del 1000 Ethernet4 to remove a port from vlan, the cmd would fail with error "Ethernet4 is not a member of Vlan1000"
Steps to reproduce the issue:
Deploy SONiC switch with t0 topology defined in sonic-mgmt.
Run command config vlan member del 1000 Ethernet4. Here Ethernet4 can be any other port in Vlan1000.
Describe the results you received:
The command failed with Ethernet4 is not a member of Vlan1000.
Describe the results you expected:
The command should be able to remove the specified port from VLAN.
Additional information you deem important (e.g. issue happens only occasionally):
My DUT switch was deployed with minigraph firstly. Vlan related configuration in my minigraph.xml:
After this minigraph was loaded, command config save -y was used to save the config to configDB. VLAN related information in /etc/sonic/config_db.json:
As we can see that config VLAN.Vlan1000 does not have a key with name members. The code of config vlan member del firstly checks whether the interface to be removed is in the members field of VLAN.Vlan1000. If not, then it will fail with error like "Ethernet4 is not a member of Vlan1000".
admin@sonic-sw:~$ sudo config vlan member del 1000 Ethernet4
Usage: config vlan member del [OPTIONS] <vid> <interface_name>
Error: Ethernet4 is not a member of Vlan1000
If I add members field to VLAN.Vlan1000 in configDB:
Then command config vlan member del Ethernet4 will be successful without issue. And the interface can be successfully removed from VLAN.
So, the problem here is that if we load configuration using only minigraph, there is no way to add members field for VLAN interface. The members field of VLAN interface is only supported by configdb, not by minigrah. There is a gap between minigraph and configDB.
Evenafter adding the vlan port in config_db and deleting later , upon assigning ip address to the port , It shows Master as Bridge. Only config save and reload helps.
root@sonic-s6100-07:~# config vlan member add 1000 Ethernet6
root@sonic-s6100-07:~# config vlan member del 1000 Ethernet6
root@sonic-s6100-07:~# config interface ip add Ethernet6 1.1.1.1/24
root@sonic-s6100-07:~#
root@sonic-s6100-07:~# show ip interfae
Usage: show ip [OPTIONS] COMMAND [ARGS]...
Error: No such command "interfae".
root@sonic-s6100-07:~# show ip interface
Interface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP
--------------- -------- ------------------- ------------ -------------- -------------
Ethernet6 Bridge 1.1.1.1/24 up/up N/A N/A <<<<<<<<<<<<
Loopback0 10.1.0.32/32 up/up N/A N/A
PortChannel0001 10.0.0.0/31 up/up ARISTA01T1 10.0.0.1
PortChannel0002 10.0.0.4/31 up/up ARISTA02T1 10.0.0.5
Description
SONiC switch is running the t0 topology. On my DUT switch, ports Ethernet4 to Ethernet96 are in Vlan1000. If use command like
config vlan member del 1000 Ethernet4
to remove a port from vlan, the cmd would fail with error "Ethernet4 is not a member of Vlan1000"Steps to reproduce the issue:
config vlan member del 1000 Ethernet4
. HereEthernet4
can be any other port in Vlan1000.Describe the results you received:
The command failed with
Ethernet4 is not a member of Vlan1000
.Describe the results you expected:
The command should be able to remove the specified port from VLAN.
Additional information you deem important (e.g. issue happens only occasionally):
My DUT switch was deployed with minigraph firstly. Vlan related configuration in my minigraph.xml:
After this minigraph was loaded, command
config save -y
was used to save the config to configDB. VLAN related information in /etc/sonic/config_db.json:VLAN related configurations output by CLI:
As we can see that config
VLAN.Vlan1000
does not have a key with namemembers
. The code ofconfig vlan member del
firstly checks whether the interface to be removed is in themembers
field ofVLAN.Vlan1000
. If not, then it will fail with error like "Ethernet4 is not a member of Vlan1000".If I add members field to VLAN.Vlan1000 in configDB:
Then run
config reload -y
. After config is reloaded,show vlan config
will have different output:Then command
config vlan member del Ethernet4
will be successful without issue. And the interface can be successfully removed from VLAN.So, the problem here is that if we load configuration using only minigraph, there is no way to add members field for VLAN interface. The members field of VLAN interface is only supported by configdb, not by minigrah. There is a gap between minigraph and configDB.
Output of
show version
:Attach debug file
sudo generate_dump
:The text was updated successfully, but these errors were encountered: