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

[202012][show platform summary] Add chassis hardware info to platform summary and version #2259

Closed

Conversation

alexrallen
Copy link
Contributor

@alexrallen alexrallen commented Jul 7, 2022

Backports #1624

What I did

I added chassis model number, serial number, and hardware revision to the commands show platform summary and show version

How I did it

I refactored and modified the existing get_hw_info_dict() function to make calls to STATE_DB and get the chassis information populated by sonic-net/sonic-platform-daemons#183 script.

The new refactored versions of get_hw_info_dict() are added here sonic-net/sonic-buildimage#7652

How to verify it

Run show platform summary and show version and verify that following fields are populated:

  • Serial Number
  • Model Number
  • Hardware Rev

Previous command output (if the output of a command-line utility has changed)

Previous output for show version (example run on Mellanox MSN2700)

SONiC Software Version: SONiC.202012.74-59cae24e
Distribution: Debian 10.9
Kernel: 4.19.0-12-2-amd64
Build commit: 59cae24e
Build date: Wed Apr 28 07:35:32 UTC 2021
Built by: johnar@jenkins-worker-1

Platform: x86_64-mlnx_msn2700-r0
HwSKU: Mellanox-SN2700
ASIC: mellanox
ASIC Count: 1
Serial Number: MT1623X09522
Uptime: 15:21:47 up 10:27,  2 users,  load average: 2.29, 2.69, 2.68

Docker images:
REPOSITORY                    TAG                  IMAGE ID            SIZE
docker-syncd-mlnx             202012.74-59cae24e   5550823089ae        665MB
docker-syncd-mlnx             latest               5550823089ae        665MB
docker-teamd                  202012.74-59cae24e   7de136e8e8e8        410MB
docker-teamd                  latest               7de136e8e8e8        410MB
docker-nat                    202012.74-59cae24e   02ab418f2434        413MB
docker-nat                    latest               02ab418f2434        413MB
docker-router-advertiser      202012.74-59cae24e   9e6114a80f74        400MB
docker-router-advertiser      latest               9e6114a80f74        400MB
docker-platform-monitor       202012.74-59cae24e   e559a10095cd        691MB
docker-platform-monitor       latest               e559a10095cd        691MB
docker-lldp                   202012.74-59cae24e   7e271e7a4528        440MB
docker-lldp                   latest               7e271e7a4528        440MB
docker-database               202012.74-59cae24e   3231c2b690ab        400MB
docker-database               latest               3231c2b690ab        400MB
docker-orchagent              202012.74-59cae24e   ede2c8f72aed        429MB
docker-orchagent              latest               ede2c8f72aed        429MB
docker-snmp                   202012.74-59cae24e   52ed10642661        441MB
docker-snmp                   latest               52ed10642661        441MB
docker-sonic-telemetry        202012.74-59cae24e   a21ce94d4d11        490MB
docker-sonic-telemetry        latest               a21ce94d4d11        490MB
docker-dhcp-relay             202012.74-59cae24e   2b0d0905cd67        407MB
docker-dhcp-relay             latest               2b0d0905cd67        407MB
docker-sonic-mgmt-framework   202012.74-59cae24e   18b35d7d34e4        619MB
docker-sonic-mgmt-framework   latest               18b35d7d34e4        619MB
docker-fpm-frr                202012.74-59cae24e   4685e0764319        429MB
docker-fpm-frr                latest               4685e0764319        429MB
docker-sflow                  202012.74-59cae24e   e6fed87a0155        411MB
docker-sflow                  latest               e6fed87a0155        411MB

Previous output for show platform summary (example run on Mellanox MSN2700)

Platform: x86_64-mlnx_msn2700-r0
HwSKU: Mellanox-SN2700
ASIC: mellanox
ASIC Count: 1

New command output (if the output of a command-line utility has changed)

New output for show version (example run on Mellanox MSN2700)

admin@sonic:~$ show version

SONiC Software Version: SONiC.master_debugging.0-9f24b609
Distribution: Debian 10.9
Kernel: 4.19.0-12-2-amd64
Build commit: 9f24b609
Build date: Fri Apr 30 14:25:07 UTC 2021
Built by: arallen@r-build-sonic06

Platform: x86_64-mlnx_msn2700-r0
HwSKU: Mellanox-SN2700
ASIC: mellanox
ASIC Count: 1
Serial Number: MT1822K07815
Model Number: MSN2700-CS2FO
Hardware Rev: A1
Uptime: 14:40:15 up 3 min,  1 user,  load average: 1.26, 1.45, 0.66

Docker images:
REPOSITORY                    TAG                           IMAGE ID            SIZE
docker-platform-monitor       latest                        25eeef9cd044        692MB
docker-platform-monitor       master_debugging.0-9f24b609   25eeef9cd044        692MB
docker-syncd-mlnx             latest                        ac8e7da3f256        665MB
docker-syncd-mlnx             master_debugging.0-9f24b609   ac8e7da3f256        665MB
docker-sflow                  latest                        ba260dbaf2ed        412MB
docker-sflow                  master_debugging.0-9f24b609   ba260dbaf2ed        412MB
docker-snmp                   latest                        e0edd7585de1        441MB
docker-snmp                   master_debugging.0-9f24b609   e0edd7585de1        441MB
docker-dhcp-relay             latest                        1884e80a3342        407MB
docker-dhcp-relay             master_debugging.0-9f24b609   1884e80a3342        407MB
docker-teamd                  latest                        ebfacefde68e        411MB
docker-teamd                  master_debugging.0-9f24b609   ebfacefde68e        411MB
docker-nat                    latest                        413d85b6a0ea        414MB
docker-nat                    master_debugging.0-9f24b609   413d85b6a0ea        414MB
docker-router-advertiser      latest                        aeb413b0f1f0        400MB
docker-router-advertiser      master_debugging.0-9f24b609   aeb413b0f1f0        400MB
docker-lldp                   latest                        117730f901e7        440MB
docker-lldp                   master_debugging.0-9f24b609   117730f901e7        440MB
docker-database               latest                        399ba6b1a398        400MB
docker-database               master_debugging.0-9f24b609   399ba6b1a398        400MB
docker-sonic-mgmt-framework   latest                        be25c6c41871        619MB
docker-sonic-mgmt-framework   master_debugging.0-9f24b609   be25c6c41871        619MB
docker-orchagent              latest                        0472c0f05efa        429MB
docker-orchagent              master_debugging.0-9f24b609   0472c0f05efa        429MB
docker-macsec                 latest                        dcae9f883026        414MB
docker-macsec                 master_debugging.0-9f24b609   dcae9f883026        414MB
docker-sonic-telemetry        latest                        a28909569592        489MB
docker-sonic-telemetry        master_debugging.0-9f24b609   a28909569592        489MB
docker-fpm-frr                latest                        a5d6de3fb526        429MB
docker-fpm-frr                master_debugging.0-9f24b609   a5d6de3fb526        429MB

New output for show platform summary (example run on Mellanox MSN2700)

admin@sonic:~$ show platform summary
Platform: x86_64-mlnx_msn2700-r0
HwSKU: Mellanox-SN2700
ASIC: mellanox
ASIC Count: 1
Serial Number: MT1822K07815
Model Number: MSN2700-CS2FO
Hardware Rev: A1

… and version (sonic-net#1624)

I added chassis model number, serial number, and hardware revision to the commands `show platform summary` and `show version`

I refactored and modified the existing `get_hw_info_dict()` function to make calls to STATE_DB and get the chassis information populated by sonic-net/sonic-platform-daemons#183 script.

The new refactored versions of `get_hw_info_dict()` are added here sonic-net/sonic-buildimage#7652
@alexrallen
Copy link
Contributor Author

Requires the following PRs to also be backported:

Add chassisdb-init script to sonic-platform-daemons to populate STATE_DB
sonic-net/sonic-platform-daemons#183

Enabled chassisdb-init script in docker-platform-monitor and related bugfixes:
sonic-net/sonic-buildimage#7596
sonic-net/sonic-buildimage#9017
sonic-net/sonic-buildimage#9858
sonic-net/sonic-buildimage#10071

Refactor sonic-py-common to include necessary functions to get chassis information from STATE_DB
sonic-net/sonic-buildimage#7652

Also please remember to update the command reference for 202012 with this change
https://github.com/Azure/sonic-utilities/blob/202012/doc/Command-Reference.md#show-hardware-platform

I added chassis model number, serial number, and hardware revision to the commands show platform summary and show version

@alexrallen alexrallen changed the title [show platform summary] Add chassis hardware info to platform summary and version [202012][show platform summary] Add chassis hardware info to platform summary and version Jul 7, 2022
@alexrallen
Copy link
Contributor Author

NOTE: Tests are failing because requisite PRs are not backported.

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.

1 participant