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

T2-VOQ-Chassis: VS support #18512

Merged

Conversation

deepak-singhal0408
Copy link
Contributor

@deepak-singhal0408 deepak-singhal0408 commented Mar 29, 2024

Why I did it

Changes to ensure sonic_vs.img has everything required for it to be emulated as T2-VOQ-Chassis: Supervisor/Linecard..
With this change,

  1. The image could be used to emulate Supervisor or Linecard
  2. the image could be used to emulate different Linecard HWSKus.
Work item tracking
  • Microsoft ADO (number only):
    27402561

How I did it

Following Changes are made as part of this PR:

  1. On VS image, Database containers to be recreated again upon reboot. This will help change single asic VS image to multi-asic(docker_image_ctl.j2).
  2. Copy all Sup and Linecard HWSKUs directories under kvm_platform directory. Create lanemap.ini, coreportindexmap.ini, fabriclanemap.ini under each hwsku/Asic directory. Copy asic.conf file from each platform directories to their child HW_SKU directories under kvm platform directory (This will help emulate different HW-Sku's with their respective num_asic asics): (sonic-device-data/Makefile).
  3. New sonic-platform package for VS platforms. This is needed
    3.1: To ensure, that database containers bring up goes through. The database containers on linecards fetch the supervisor slot_num, current_slot num etc.
    PS: This package will be available on pizza box vs platforms as well. However, it will be noop there, as the package expects a metadata file, which will only be available on chassis VS platforms.
  4. Changes to generate unique mac-address on VS platforms. This is done by using the device_hostname string (which will always be unique). Change to provide unique MAC address per asic on multi-asic VOQ VS platforms(sonic-cfggen, device_info.py, minigraph.py)
  5. topology.service file to be dependent on sonic.target so that as part of config load_minigraph/config reload this service gets invoked.
  6. topology.sh changes to move ports to their respective namespace (only applicable on multi-asic platforms)

How to verify it

  1. Verified that sonic-vs.img.gz gets built succesfully and single asic VS DUT comes up fine(deployed vms-kvm-t0 topology) and could see that all containers come up fine. The show commands work as expected.
  2. Verified bringup on VOQ chassis with different flavor of linecard emulation.

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)

Description for the changelog

Link to config_db schema for YANG module changes

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

Copy link
Contributor

@arlakshm arlakshm left a comment

Choose a reason for hiding this comment

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

as comments.

files/build_templates/docker_image_ctl.j2 Show resolved Hide resolved
files/image_config/topology/topology.sh Outdated Show resolved Hide resolved
files/image_config/topology/topology.sh Show resolved Hide resolved
files/image_config/topology/topology.sh Show resolved Hide resolved
src/sonic-py-common/sonic_py_common/device_info.py Outdated Show resolved Hide resolved
qiluo-msft pushed a commit to sonic-net/sonic-utilities that referenced this pull request Apr 3, 2024
…age support for VS (#3250)

### What I did
For T2-Chassis VS support, we are adding new sonic_platform package for vs platforms. Please refer sonic-net/sonic-buildimage#18512 for more details.
Due to this new platform package, need to modify excpetion handling as now the Module would be found, but the metadata file will not be found for pizzabox vs platforms.

#### How I did it
Modified the exception handling logic.
MSFT ADO: 27414904

#### How to verify it
Bring up vms-kvm-t0 topology. ran show interface status. The output is proper.

PS: the Main PR(sonic-net/sonic-buildimage#18512) is dependent on this PR to be merged in first.
@saiarcot895
Copy link
Contributor

Looks like there's a new loganalyzer error message on t0:

Apr  8 07:23:49.040082 vlab-01 ERR sfputil: Failed to instantiate Chassis due to FileNotFoundError('Metadata file /etc/sonic/vs_chassis_metadata.json not found')

Is this expected? Does it need to be added to the ignore list?

@deepak-singhal0408
Copy link
Contributor Author

Looks like there's a new loganalyzer error message on t0:

Apr  8 07:23:49.040082 vlab-01 ERR sfputil: Failed to instantiate Chassis due to FileNotFoundError('Metadata file /etc/sonic/vs_chassis_metadata.json not found')

Is this expected? Does it need to be added to the ignore list?

Thanks @saiarcot895 .. Added above to loganalyzer_ignore file as discussed. PR sonic-net/sonic-mgmt#12345

@deepak-singhal0408
Copy link
Contributor Author

/azp run

Copy link

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

@judyjoseph
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@deepak-singhal0408
Copy link
Contributor Author

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

Hi @rlhui @yxieca , it seems I dont have permission to re run the pipeline? Could you please help check and let me know if this is expected or am I missing anything here?

@saiarcot895
Copy link
Contributor

@deepak-singhal0408 use /azpw instead of /azp.

@judyjoseph
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@deepak-singhal0408
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@deepak-singhal0408 deepak-singhal0408 added the Chassis for 202205 branch PRs needed for 202205 branch in msft repo label Apr 15, 2024
@deepak-singhal0408
Copy link
Contributor Author

@arlakshm @judyjoseph @abdosi could you please help review when get a chance? Thanks!

@deepak-singhal0408
Copy link
Contributor Author

Thanks @arlakshm.
@rlhui, could you please help merge this PR? Thanks!

@rlhui rlhui merged commit f60ef62 into sonic-net:master Apr 19, 2024
19 checks passed
@gechiang
Copy link
Collaborator

@deepak-singhal0408 Cherry-pick conflict for MSFT repo 202205 branch. Please raise PR directly to MSFT repo and mention this PRin the new PR.

@gechiang gechiang added the Included in Chassis for 202205 Branch Indicate PR is already in MSFT repo 202205 branch label Apr 20, 2024
@prsunny
Copy link
Contributor

prsunny commented Apr 24, 2024

@deepak-singhal0408 , seems like swss PR checks are failing with this docker change. Could you confirm all swss tests were tested with this docker vs build?

@deepak-singhal0408
Copy link
Contributor Author

@deepak-singhal0408 , seems like swss PR checks are failing with this docker change. Could you confirm all swss tests were tested with this docker vs build?

@prsunny , this PR is merged in sonic-buildimage on April 19th. And there is a PR merge in sonic-swss on April 22nd(sonic-net/sonic-swss#3118). The PR checker for April 22nd change would have already taken my changes.. right? May I know why you think this PR would have caused issue?

mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request May 9, 2024
…age support for VS (sonic-net#3250)

### What I did
For T2-Chassis VS support, we are adding new sonic_platform package for vs platforms. Please refer sonic-net/sonic-buildimage#18512 for more details.
Due to this new platform package, need to modify excpetion handling as now the Module would be found, but the metadata file will not be found for pizzabox vs platforms.

#### How I did it
Modified the exception handling logic.
MSFT ADO: 27414904

#### How to verify it
Bring up vms-kvm-t0 topology. ran show interface status. The output is proper.

PS: the Main PR(sonic-net/sonic-buildimage#18512) is dependent on this PR to be merged in first.
mssonicbld pushed a commit to sonic-net/sonic-utilities that referenced this pull request May 9, 2024
…age support for VS (#3250)

### What I did
For T2-Chassis VS support, we are adding new sonic_platform package for vs platforms. Please refer sonic-net/sonic-buildimage#18512 for more details.
Due to this new platform package, need to modify excpetion handling as now the Module would be found, but the metadata file will not be found for pizzabox vs platforms.

#### How I did it
Modified the exception handling logic.
MSFT ADO: 27414904

#### How to verify it
Bring up vms-kvm-t0 topology. ran show interface status. The output is proper.

PS: the Main PR(sonic-net/sonic-buildimage#18512) is dependent on this PR to be merged in first.
@ishidawataru
Copy link
Collaborator

@deepak-singhal0408 Where can I find vs_chassis_metadata.json? I built the multi-asic vs image from this repo but there is no vs_chassis_metadata.json under /etc/sonic.

@yutongzhang-microsoft
Copy link
Contributor

Hi, @deepak-singhal0408 , I got the same error

Jun 21 03:01:42 vlab-01 determine-reboot-cause[15110]:   File "/usr/lib/python3/dist-packages/sonic_platform/chassis.py", line 26, in __init__
Jun 21 03:01:42 vlab-01 determine-reboot-cause[15110]:     self.metadata = self._read_metadata()
Jun 21 03:01:42 vlab-01 determine-reboot-cause[15110]:                     ^^^^^^^^^^^^^^^^^^^^^
Jun 21 03:01:42 vlab-01 determine-reboot-cause[15110]:   File "/usr/lib/python3/dist-packages/sonic_platform/chassis.py", line 34, in _read_metadata
Jun 21 03:01:42 vlab-01 determine-reboot-cause[15110]:     raise FileNotFoundError("Metadata file {} not found".format(self.metadata_file))
Jun 21 03:01:42 vlab-01 determine-reboot-cause[15110]: FileNotFoundError: Metadata file /etc/sonic/vs_chassis_metadata.json not found

@deepak-singhal0408
Copy link
Contributor Author

Hi, @deepak-singhal0408 , I got the same error

Jun 21 03:01:42 vlab-01 determine-reboot-cause[15110]:   File "/usr/lib/python3/dist-packages/sonic_platform/chassis.py", line 26, in __init__
Jun 21 03:01:42 vlab-01 determine-reboot-cause[15110]:     self.metadata = self._read_metadata()
Jun 21 03:01:42 vlab-01 determine-reboot-cause[15110]:                     ^^^^^^^^^^^^^^^^^^^^^
Jun 21 03:01:42 vlab-01 determine-reboot-cause[15110]:   File "/usr/lib/python3/dist-packages/sonic_platform/chassis.py", line 34, in _read_metadata
Jun 21 03:01:42 vlab-01 determine-reboot-cause[15110]:     raise FileNotFoundError("Metadata file {} not found".format(self.metadata_file))
Jun 21 03:01:42 vlab-01 determine-reboot-cause[15110]: FileNotFoundError: Metadata file /etc/sonic/vs_chassis_metadata.json not found

Hi @yutongzhang-microsoft , please give a try with this Fix. sonic-net/sonic-host-services#133
JFYI, this file is not expected to be present on pizza box vs platforms.
Even on chassis based vs image, this is not mandatory to be present..

@ishidawataru
Copy link
Collaborator

ishidawataru commented Jun 23, 2024

Even on chassis based vs image, this is not mandatory to be present..

How about stopping raising an exception instead of catching FileNotFoundError everywhere the exception can be ignored if the metadata file is not mandatory?

https://github.com/sonic-net/sonic-buildimage/pull/18512/files#diff-1837abe4216c07096db3b47b74a8ce47b0097622773caf92e9dc9f3c42636d06R34

@yutongzhang-microsoft
Copy link
Contributor

Even on chassis based vs image, this is not mandatory to be present..

How about stopping raising an exception instead of catching FileNotFoundError everywhere the exception can be ignored if the metadata file is not mandatory?

https://github.com/sonic-net/sonic-buildimage/pull/18512/files#diff-1837abe4216c07096db3b47b74a8ce47b0097622773caf92e9dc9f3c42636d06R34

I agree with you, some other commands also failed because of this error.
@deepak-singhal0408 Can you fix as suggested?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chassis for 202205 branch PRs needed for 202205 branch in msft repo Cherry Pick Conflict_202305 Included in Chassis for 202205 Branch Indicate PR is already in MSFT repo 202205 branch Request for 202305 Branch
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

10 participants