sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

Add solution for changing port_config.ini at fanout switch according to assigned hwsku

Open echuawu opened this issue 1 year ago • 6 comments

Description of PR

During SONiC fanout deployment, when port split is needed. But there is no port name exists in port_config.ini for the split port. Then SONiC fanout deployment would failed due to this reason.

There would be 2 ways to fix this issue:

[Solution 1] There would be a dynamic mechanism to generate a fake hwsku to meet this requirement. The solution is depend on a script called sonic_sku_create.py, it would based on lab connection graph xml to generate a suite of fake hwsku

In this implementation, only device and link csv files need to be updated:

  1. HwSkuType="dynamic" should be set for the fanout switch, such as: Hostname,ManagementIp,HwSku,Type,Protocol,Os,HwSkuType r-tigon-21,10.210.24.193/22,Mellanox-SN4600C-C64,DevSonic,,sonic, r-tigon-22,10.210.24.194/22,Mellanox-SN4600C-C64,FanoutLeaf,,sonic,dynamic r-r640-13,10.215.20.120,TestServ,Server,,, pdu-10-208-2-11,10.208.2.11,Emerson,Pdu,snmp,, rcon-sws-3-5,10.208.0.44,,ConsoleServer,ssh,sonic,

  2. Split ports should be set in the link csv file for the fanout switch, such as: StartDevice,StartPort,EndDevice,EndPort,BandWidth,VlanID,VlanMode r-tigon-21,Ethernet0,r-tigon-22,Ethernet0,50000,201,Access r-tigon-21,Ethernet2,r-tigon-22,Ethernet2,50000,202,Access <--- r-tigon-21,Ethernet4,r-tigon-22,Ethernet4,50000,203,Access r-tigon-21,Ethernet6,r-tigon-22,Ethernet6,50000,204,Access <--- r-tigon-21,Ethernet8,r-tigon-22,Ethernet8,100000,205,Access r-tigon-21,Ethernet12,r-tigon-22,Ethernet12,100000,206,Access

[Solution 2] There would be an assigned port_config.ini for the fanout switch.

In this implementation, port_config.ini should be saved in sonic-mgmt, and PortConfigIni in device csv file would be used to indicate the file path Then copy the port_config.ini file to the fanout switch, then do a normal sonic fanout switch deployment

  1. Save the user defined port_config.ini in the folder in sonic-mgmt: ansible/files/hwsku_vars/{setup name}/{setup hwsku}/port_config.ini

  2. PortConfigIni should be set with the file path: Hostname,ManagementIp,HwSku,Type,Protocol,Os,PortConfigIni <--- r-moose-01,10.210.24.105/22,ACS-SN5600,DevSonic,,sonic r-liger-12,10.210.24.76/22,ACS-MSN4600,FanoutLeaf,,sonic,ansible/files/hwsku_vars/r-moose-01_setup/ACS-SN5600/port_config.ini <--- r-r640-15,10.215.22.1,TestServ,Server,, pdu-10-208-2-47,10.208.2.47,Vertiv,Pdu,snmp, rcon-SWS-1-3,10.208.0.80,,ConsoleServer,ssh,sonic

Summary: Fixes # (issue)

Type of change

  • [ ] Bug fix
  • [x] Testbed and Framework(new/improvement)
  • [ ] Test case(new/improvement)

Back port request

  • [ ] 202012
  • [ ] 202205
  • [ ] 202305
  • [x] 202311
  • [x] 202405

Approach

What is the motivation for this PR?

During deploying the SONiC fanout switch, when the fanout switch type is different with the dut switch type. The hwsku and port_config.ini supported in fanout switch usually could not match the requirement of dut. Then a fake hwsku and port_config.ini file is needed to meet this requirement.

How did you do it?

Add two way to meet the requirement:

  1. Generate a fake hwsku and its port_config.ini
  2. Assign a port_config.ini file

How did you verify/test it?

Run it in internal regression

Any platform specific information?

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

Documentation

echuawu avatar Sep 03 '24 04:09 echuawu

/azpw run

echuawu avatar Sep 03 '24 08:09 echuawu

/AzurePipelines run

mssonicbld avatar Sep 03 '24 08:09 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Sep 03 '24 08:09 azure-pipelines[bot]

/azpw run

echuawu avatar Sep 05 '24 02:09 echuawu

/AzurePipelines run

mssonicbld avatar Sep 05 '24 02:09 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Sep 05 '24 02:09 azure-pipelines[bot]

Hi @wangxin, can you please help review this change? Thanks

bingwang-ms avatar Oct 23 '24 20:10 bingwang-ms

@wangxin Kindly reminder.

bingwang-ms avatar Oct 30 '24 20:10 bingwang-ms

@wangxin Can you please help review?

bingwang-ms avatar Dec 18 '24 17:12 bingwang-ms

i see no comment for weeks now. As this is needed for stabilization of the nightly regression i am moving forward with merging it. If any issue will be popped up will be handled as issue with prio

liat-grozovik avatar Dec 24 '24 11:12 liat-grozovik