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

[YANG MODEL] Fix breakout validation failed #13022

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cyo-chang
Copy link

Why I did it

The interface fails to breakout when:

  • IPv6 auto link-local address generation is enabled in interfaces or vlan.
admin@sonic:~$ cat /etc/sonic/config_dg.json
...omitted...
    "Ethernet46": {
        "ipv6_use_link_local_only": "enable"
    },
    "Ethernet47": {
        "ipv6_use_link_local_only": "enable"
    }
...omitted...

admin@sonic:~$ sudo config interface breakout Ethernet48 4x25G -y
Running Breakout Mode : 1x100G[40G]
Target Breakout Mode : 4x25G
...omitted...
sonic_yang(6):Note: Below table(s) have no YANG models: REST_SERVER, SNMP, SNMP_COMMUNITY, SNMP_TRAP_CONFIG, VXLAN_EVPN_NVO, VXLAN_TUNNEL, VXLAN_TUNNEL_MAP, XCVRD_LOG
sonic_yang(3):All Keys are not parsed in INTERFACE
dict_keys(['Ethernet46', 'Ethernet47'])
sonic_yang(3):exceptionList:["'ipv6_use_link_local_only'", "'ipv6_use_link_local_only'", 'Value not found for name ip-prefix in Ethernet46', 'Value not found for name ip-prefix in Ethernet47']
sonic_yang(3):Data Loading Failed:All Keys are not parsed in INTERFACE
dict_keys(['Ethernet46', 'Ethernet47'])
Data Loading Failed
All Keys are not parsed in INTERFACE
dict_keys(['Ethernet46', 'Ethernet47'])
ConfigMgmt Class creation failed
Failed to break out Port. Error: Failed to load the config. Error: ConfigMgmtDPB Class creation failed
...omitted...
  • There is no default gateway in the static management IP.
admin@sonic:~$ cat /etc/sonic/config_dg.json
...omitted...
    "MGMT_INTERFACE": {
        "eth0|192.168.200.71/24": {}
    },
...omitted...

admin@sonic:~$ sudo config interface breakout Ethernet48 4x25G -y
Running Breakout Mode : 1x100G[40G]
Target Breakout Mode : 4x25G
...omitted...
sonic_yang(6):Note: Below table(s) have no YANG models: REST_SERVER, SNMP, SNMP_COMMUNITY, SNMP_TRAP_CONFIG, XCVRD_LOG
libyang[0]: Must condition "(contains(current(), ':') and contains(../gwaddr, ':')) or (contains(current(), '.') and contains(../gwaddr, '.'))" not satisfied. (path: /sonic-mgmt_interface:sonic-mgmt_interface/MGMT_INTERFACE/MGMT_INTERFACE_LIST[name='eth0'][ip_prefix='192.168.200.71/24']/ip_prefix)
sonic_yang(3):Data Loading Failed:Must condition "(contains(current(), ':') and contains(../gwaddr, ':')) or (contains(current(), '.') and contains(../gwaddr, '.'))" not satisfied.
Data Loading Failed
Must condition "(contains(current(), ':') and contains(../gwaddr, ':')) or (contains(current(), '.') and contains(../gwaddr, '.'))" not satisfied.
ConfigMgmt Class creation failed
Failed to break out Port. Error: Failed to load the config. Error: ConfigMgmtDPB Class creation failed
...omitted...

How I did it

Add 'ipv6_use_link_local_only' field to vlan and interface yang files.
Remove the restriction about no default gateway from mgmt-interface yang file.

How to verify it

Add 'ipv6_use_link_local_only' field and remove 'gwaddr' constraint, and apply breakout setting on interface, breakout process got successfully completed.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

- Missing 'ipv6_use_link_local_only' key
- Remove the restriction about no default gateway in the static management IP
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 12, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: werty75708 / name: Chao Cheng, Chang (700b353)

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

Successfully merging this pull request may close these issues.

None yet

1 participant