Skip to content

deploy script changes for smartswitch lit mode#21174

Open
nnelluri-cisco wants to merge 3 commits intosonic-net:masterfrom
nnelluri-cisco:smartswicth-litmode
Open

deploy script changes for smartswitch lit mode#21174
nnelluri-cisco wants to merge 3 commits intosonic-net:masterfrom
nnelluri-cisco:smartswicth-litmode

Conversation

@nnelluri-cisco
Copy link
Copy Markdown
Contributor

@nnelluri-cisco nnelluri-cisco commented Nov 3, 2025

Description of PR

incorporated the DPC role fix in the minigraph by replacing port_name with port_alias, since port_name was not functioning correctly.

Summary:
Fixes # (issue)

Type of change

  • [ X] Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • [ X] 202505
  • [ X] 202506

Approach

What is the motivation for this PR?

port_name is causing deploy_mg to be failed.
replaced port_name with port_alias

How did you do it?

Deployed minigraph and make sure deploy-mg went fine without any error.

How did you verify/test it?

Deployed minigraph and make sure deploy-mg went fine without any error.

Any platform specific information?

Smartswitch

Supported testbed topology if it's a new test case?

Documentation

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@nnelluri-cisco
Copy link
Copy Markdown
Contributor Author

@prabhataravind and @rameshraghupathy
Please review and approve the changes

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@prabhataravind
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@KrisNey-MSFT
Copy link
Copy Markdown

hi @nnelluri-cisco - looks like we are failing some checks

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@nnelluri-cisco
Copy link
Copy Markdown
Contributor Author

@KrisNey-MSFT
Can you please ask some one MSFT to merge this PR.

@KrisNey-MSFT
Copy link
Copy Markdown

Hi @prabhataravind - looks like this is fixed. Would you mind merging please?

@prabhataravind
Copy link
Copy Markdown
Contributor

hi @yxieca could you help merge this?

vmittal-msft
vmittal-msft previously approved these changes Dec 15, 2025
<PortName>0</PortName>
<Priority>0</Priority>
{% set intf = port_name[index] %}
{% set intf = port_alias[index] %}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This could be a dangerous change. It could potentially break the other platforms where port_name works.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@wangxin @lolyu can you chime in here? This PR passed all checkers.

Copy link
Copy Markdown
Contributor

@prabhataravind prabhataravind Dec 15, 2025

Choose a reason for hiding this comment

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

@yxieca this was added for smartswitch in PR #20244. I don't think any other platform needs this change. It should be a no-op for other platforms.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hi @yxieca I checked again. This won't work. I have requested changes..

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@nnelluri-cisco please confirm what port_alias[index] resolves to. If it is etp, this change won't work.

Copy link
Copy Markdown
Contributor Author

@nnelluri-cisco nnelluri-cisco Dec 16, 2025

Choose a reason for hiding this comment

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

Thanks @prabhataravind for catching the error.
I have provided the correct fix , please review it and I deployed minigrapg and changes are wokring fine "Dpc" role is generated in "minigraph.xml" file.

Sample snippet for etp28 and etp29 ports. <a:EthernetInterface> <ElementType>DeviceInterface</ElementType> <AlternateSpeeds i:nil="true"/> <EnableFlowControl>true</EnableFlowControl> <Index>1</Index> <InterfaceName>etp28</InterfaceName> <InterfaceType i:nil="true"/> <MultiPortsInterface>false</MultiPortsInterface> <PortName>0</PortName> <Priority>0</Priority> <role>Dpc</role> <Speed>200000</Speed> </a:EthernetInterface> <a:EthernetInterface> <ElementType>DeviceInterface</ElementType> <AlternateSpeeds i:nil="true"/> <EnableFlowControl>true</EnableFlowControl> <Index>1</Index> <InterfaceName>etp29</InterfaceName> <InterfaceType i:nil="true"/> <MultiPortsInterface>false</MultiPortsInterface> <PortName>0</PortName> <Priority>0</Priority> <role>Dpc</role> <Speed>200000</Speed>

Copy link
Copy Markdown
Contributor

@prabhataravind prabhataravind left a comment

Choose a reason for hiding this comment

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

Port alias index check against 227 will never work. This is not right.

@prabhataravind prabhataravind removed Request for 202511 branch Request to backport a change to 202511 branch Approved for 202511 branch labels Dec 15, 2025
auto-merge was automatically disabled December 16, 2025 00:42

Head branch was pushed to by a user without write access

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

{% set intf = port_name[index] %}
{% if subtype is defined and subtype == 'SmartSwitch' and intf[8:]|int >= 224 %}
{% set alias = port_alias[index] %}
{% if alias in port_alias_map %}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@nnelluri-cisco can we check if "port_alias_map is defined" as shown {% if port_alias_map is defined and alias in port_alias_map %}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@rameshraghupathy
Check the "port_alias_map" which will be defined during deploy-mg workflow.

"port_alias_map": { "etp0": "Ethernet0", "etp1": "Ethernet8", "etp10": "Ethernet80", "etp11": "Ethernet88", "etp12": "Ethernet96", "etp13": "Ethernet104", "etp14": "Ethernet112", "etp15": "Ethernet120", "etp16": "Ethernet128", "etp17": "Ethernet136", "etp18": "Ethernet144", "etp19": "Ethernet152", "etp2": "Ethernet16", "etp20": "Ethernet160", "etp21": "Ethernet168", "etp22": "Ethernet176", "etp23": "Ethernet184", "etp24": "Ethernet192", "etp25": "Ethernet200", "etp26": "Ethernet208", "etp27": "Ethernet216", "etp28": "Ethernet224", "etp29": "Ethernet232", "etp3": "Ethernet24", "etp30": "Ethernet240", "etp31": "Ethernet248", "etp32": "Ethernet256", "etp33": "Ethernet264", "etp34": "Ethernet272", "etp35": "Ethernet280", "etp4": "Ethernet32", "etp5": "Ethernet40", "etp6": "Ethernet48", "etp7": "Ethernet56", "etp8": "Ethernet64", "etp9": "Ethernet72" },

@rameshraghupathy
Copy link
Copy Markdown

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@nnelluri-cisco
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 21174 in repo sonic-net/sonic-mgmt

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: nnelluri-cisco <nnelluri@cisco.com>
Signed-off-by: nnelluri-cisco <nnelluri@cisco.com>
Signed-off-by: nnelluri-cisco <nnelluri@cisco.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@KrisNey-MSFT
Copy link
Copy Markdown

hi guys, are all of the fixes in here?

@nnelluri-cisco
Copy link
Copy Markdown
Contributor Author

yes @KrisNey-MSFT
Can you please request some one to merge from MSFT side.

@KrisNey-MSFT
Copy link
Copy Markdown

hi @prsunny or @prabhataravind - could we have someone to review/merge on the SONiC team please?

@KrisNey-MSFT
Copy link
Copy Markdown

@vvolam to possibly help?

@prabhataravind
Copy link
Copy Markdown
Contributor

@rameshraghupathy is this needed now that port "role" is part of the image itself?

@nnelluri-cisco
Copy link
Copy Markdown
Contributor Author

@rameshraghupathy
we need this change other wise deploy-mg still fails.
TASK [create new minigraph file for SONiC device] **********************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: 'port_name' is undefined
fatal: [MtFuji-dut01]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'port_name' is undefined"}
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: 'port_name' is undefined
fatal: [MtFuji-dut02]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'port_name' is undefined"}

PLAY RECAP *************************************************************************************************************************************************
MtFuji-dut01 : ok=55 changed=4 unreachable=0 failed=1 skipped=41 rescued=0 ignored=0
MtFuji-dut02 : ok=55 changed=4 unreachable=0 failed=1 skipped=40 rescued=0 ignored=0

sco@swicth1:~$ show ver | head

SONiC Software Version: SONiC.20251110.16
SONiC OS Version: 13
Distribution: Debian 13.3
Kernel: 6.12.41+deb13-sonic-amd64
Build commit: 0c2696527c
Build date: Sat Mar 14 02:38:41 UTC 2026
Built by: azureuser@b02344a1c000000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants