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] Add Vnet Support for Interface #21956

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

miatttao
Copy link
Contributor

@miatttao miatttao commented Mar 7, 2025

Why I did it

  • Need to configure vlan subinterfaces within a vnet as detailed in https://github.com/sonic-net/SONiC/blob/gh-pages/doc/vxlan/Vxlan_hld.md.
  • vnet_name support is required to be added in INTERFACE, VLAN_SUB_INTERFACE, VLAN tables, but YANG models have never been updated to reflect that change. Updated yang model and added more test cases to reflect the change.
Work item tracking
  • Microsoft ADO (number only): Do not have an issue number available right now.

How I did it

  • Added a new leaf vnet_name to sonic-interface, sonic-vlan, sonic-vlan-sub-interface , type as leafref path to the sonic-vnet model
  • Added more test cases for the new leaf vnet_name

How to verify it

cd src/sonic-yang-models && python3 setup.py test

test_configs tests passed

image

sample_config_db.json passed (Ignore the assertion error)

image

image

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

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

Tested branch (Please provide the tested image version)

  • master of 202411

Description for the changelog

Link to config_db schema for YANG module changes

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

@miatttao miatttao requested a review from qiluo-msft as a code owner March 7, 2025 06:31
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft qiluo-msft requested review from prsunny and ganglyu March 7, 2025 18:35
@qiluo-msft
Copy link
Collaborator

Do you have a HLD PR to explain the big picture? What is the motivation of this PR?

@miatttao
Copy link
Contributor Author

miatttao commented Mar 7, 2025

Do you have a HLD PR to explain the big picture? What is the motivation of this PR?

Hi @qiluo-msft,

I don't have a HLD PR. My manager Anish @anish-n told me to do that. Here is his original words:
"Enhance the existing yang model for VLAN_SUB_INTERFACE to include a field called vnet_name
There is already a vrf name, but needs to be enhanced for vnet_name"

If this doesn't make sense, let me know and I will check with him. Thanks!

@anish-n
Copy link
Contributor

anish-n commented Mar 7, 2025

@qiluo-msft here is the HLD for vnet/vxlan https://github.com/sonic-net/SONiC/blob/gh-pages/doc/vxlan/Vxlan_hld.md. We will be configuring vlan subinterfaces within a vnet as detailed by the above HLD. Do let me know if you have any further questions on the use case etc!

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@miatttao miatttao requested a review from ganglyu March 10, 2025 15:11
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ganglyu
Copy link
Contributor

ganglyu commented Mar 10, 2025

unit test failed:

ERROR YANG-TEST:test_yang_model.py:72 Failed to load file ./tests/yang_model_tests/tests/interface.json

@miatttao
Copy link
Contributor Author

unit test failed:

ERROR YANG-TEST:test_yang_model.py:72 Failed to load file ./tests/yang_model_tests/tests/interface.json

Hi Gang,

Thank you for reviewing! The unit tests failed because of merge issue.

Previously, my changes have resulted in successful pipeline runs, see: 2d77a95. (Only one testbed failed out of automatic cancellation due to running over 240 minutes.)

I will push latest changes in minutes. Many thanks again!

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@miatttao
Copy link
Contributor Author

miatttao commented Mar 11, 2025

unit test failed:

ERROR YANG-TEST:test_yang_model.py:72 Failed to load file ./tests/yang_model_tests/tests/interface.json

@ganglyu Hi Gang! I have fixed the unit tests, could you please check this pr again? Many thanks!

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link
Contributor

@prsunny prsunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@qiluo-msft qiluo-msft enabled auto-merge (squash) March 11, 2025 21:42
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@miatttao
Copy link
Contributor Author

/azp run Azure.sonic-buildimage

Copy link

Commenter does not have sufficient privileges for PR 21956 in repo sonic-net/sonic-buildimage

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.

6 participants