Skip to content

Onboard show platform syseeprom command#216

Merged
Sreevanich16 merged 5 commits intoAzure:kubesonicfrom
Sreevanich16:platformSyseepromCmd
May 5, 2026
Merged

Onboard show platform syseeprom command#216
Sreevanich16 merged 5 commits intoAzure:kubesonicfrom
Sreevanich16:platformSyseepromCmd

Conversation

@Sreevanich16
Copy link
Copy Markdown

@Sreevanich16 Sreevanich16 commented Apr 30, 2026

MSFT ADO-37750120

Why I did it

Onboarded show platform syseeprom command to gNMI server system eeprom data can be queried programmatically via gNMI Get RPCs.

How I did it

The show platform syseeprom command reads EEPROM data from two paths: for most platforms, it queries EEPROM_INFO from STATE_DB (populated by syseepromd) and assembles a structured JSON with TLV header, entries, and checksum; for platforms without DB support (Arista), it runs decode_eeprom() via nsenter and wraps the raw vendor-specific text in {"eeprom_raw": "..."}. Platform detection uses regex patterns against the platform name to route between the DB path, the nsenter fallback, or an error for unsupported platforms like KVM.

How to verify it

Mellanox device
CLI output-

show platform syseeprom
TlvInfo Header:
   Id String:    TlvInfo
   Version:      1
   Total Length: 607
TLV Name          Code      Len  Value
----------------  ------  -----  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Product Name      0x21       64  MSN4600C
Part Number       0x22       20  MSN4600-CS2ROS
Serial Number     0x23       24  MT2349J00XZC
Base MAC Address  0x24        6  9C:05:91:CF:DC:00
Manufacture Date  0x25       19  12/13/2023 22:41:04
Device Version    0x26        1  19
Platform Name     0x28       64  x86_64-mlnx_msn4600C-r0
ONIE Version      0x29       21  2021.05-5.3.0008-9600
MAC Addresses     0x2A        2  254
Manufacturer      0x2B        8  Mellanox
Vendor Name       0x2D       10
Vendor Extension  0xFD       36  0x00 0x00 0x81 0x19 0x00 0x16 0x01 0x01 0x00 0x56 0x00 0x00 0x4D 0x4C 0x4E 0x58 0x02 0x01 0x0C 0x05 0x0E 0x02 0x10 0x06 0x12 0x07 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Vendor Extension  0xFD      164  0x00 0x00 0x81 0x19 0x00 0x92 0x00 0x03 0x01 0x1F 0x00 0x00 0x4D 0x54 0x32 0x33 0x34 0x39 0x4A 0x30 0x30 0x58 0x5A 0x43 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x4D 0x53 0x4E 0x34 0x36 0x30 0x30 0x2D 0x43 0x53 0x32 0x52 0x4F 0x53 0x00 0x00 0x00 0x00 0x00 0x00 0x42 0x32 0x00 0x00 0x00 0x7F 0x50 0xE0 0x54 0x69 0x67 0x6F 0x6E 0x20 0x45 0x74 0x68 0x20 0x31 0x30 0x30 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x7C 0x13 0x00 0x07 0x04 0xED 0x4D 0x53 0x4E 0x34 0x36 0x30 0x30 0x43 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Vendor Extension  0xFD       36  0x00 0x00 0x81 0x19 0x00 0x10 0x00 0x03 0x05 0xE8 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Vendor Extension  0xFD       36  0x00 0x00 0x81 0x19 0x00 0x1E 0x00 0x11 0x02 0x07 0x00 0x00 0x0D 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x9C 0x05 0x91 0xCF 0xDC 0x00 0x00 0xFE 0x9C 0x05 0x91 0x03 0x00 0xCF 0xDC 0x00
Vendor Extension  0xFD       36  0x00 0x00 0x81 0x19 0x00 0x12 0x00 0x01 0x06 0x85 0x00 0x00 0x00 0x46 0x00 0x00 0x08 0x00 0x05 0x05 0x05 0x05 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Vendor Extension  0xFD       20  0x00 0x00 0x81 0x19 0x00 0x0E 0x00 0x02 0x07 0x79 0x00 0x00 0x30 0x00 0x40 0x00 0x00 0x00 0x00 0x00
CRC-32            0xFE        4  0x0AD290EB

(checksum valid)

gNMI output

docker exec -it telemetry bash
root@bjw2-can-4600c-5:/# gnmi_get -xpath_target SHOW -xpath platform/syseeprom -target_addr 127.0.0.1:50051 -logtostderr -insecure true
== getRequest:
prefix: <
  target: "SHOW"
>
path: <
  elem: <
    name: "platform"
  >
  elem: <
    name: "syseeprom"
  >
>
encoding: JSON_IETF

== getResponse:
notification: <
  timestamp: 1777542592436191007
  prefix: <
    target: "SHOW"
  >
  update: <
    path: <
      elem: <
        name: "platform"
      >
      elem: <
        name: "syseeprom"
      >
    >
    val: <
      json_ietf_val: "{\"tlv_info_header\":{\"id_string\":\"TlvInfo\",\"version\":\"1\",\"total_length\":\"607\"},\"tlv_list\":[{\"tlv_name\":\"Product Name\",\"code\":\"0x21\",\"length\":\"64\",\"value\":\"MSN4600C\"},{\"tlv_name\":\"Part Number\",\"code\":\"0x22\",\"length\":\"20\",\"value\":\"MSN4600-CS2ROS\"},{\"tlv_name\":\"Serial Number\",\"code\":\"0x23\",\"length\":\"24\",\"value\":\"MT2349J00XZC\"},{\"tlv_name\":\"Base MAC Address\",\"code\":\"0x24\",\"length\":\"6\",\"value\":\"9C:05:91:CF:DC:00\"},{\"tlv_name\":\"Manufacture Date\",\"code\":\"0x25\",\"length\":\"19\",\"value\":\"12/13/2023 22:41:04\"},{\"tlv_name\":\"Device Version\",\"code\":\"0x26\",\"length\":\"1\",\"value\":\"19\"},{\"tlv_name\":\"Platform Name\",\"code\":\"0x28\",\"length\":\"64\",\"value\":\"x86_64-mlnx_msn4600C-r0\"},{\"tlv_name\":\"ONIE Version\",\"code\":\"0x29\",\"length\":\"21\",\"value\":\"2021.05-5.3.0008-9600\"},{\"tlv_name\":\"MAC Addresses\",\"code\":\"0x2A\",\"length\":\"2\",\"value\":\"254\"},{\"tlv_name\":\"Manufacturer\",\"code\":\"0x2B\",\"length\":\"8\",\"value\":\"Mellanox\"},{\"tlv_name\":\"Vendor Name\",\"code\":\"0x2D\",\"length\":\"10\",\"value\":\"\"},{\"tlv_name\":\"Vendor Extension\",\"code\":\"0xFD\",\"length\":\"36\",\"value\":\"0x00 0x00 0x81 0x19 0x00 0x16 0x01 0x01 0x00 0x56 0x00 0x00 0x4D 0x4C 0x4E 0x58 0x02 0x01 0x0C 0x05 0x0E 0x02 0x10 0x06 0x12 0x07 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00\"},{\"tlv_name\":\"Vendor Extension\",\"code\":\"0xFD\",\"length\":\"164\",\"value\":\"0x00 0x00 0x81 0x19 0x00 0x92 0x00 0x03 0x01 0x1F 0x00 0x00 0x4D 0x54 0x32 0x33 0x34 0x39 0x4A 0x30 0x30 0x58 0x5A 0x43 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x4D 0x53 0x4E 0x34 0x36 0x30 0x30 0x2D 0x43 0x53 0x32 0x52 0x4F 0x53 0x00 0x00 0x00 0x00 0x00 0x00 0x42 0x32 0x00 0x00 0x00 0x7F 0x50 0xE0 0x54 0x69 0x67 0x6F 0x6E 0x20 0x45 0x74 0x68 0x20 0x31 0x30 0x30 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x7C 0x13 0x00 0x07 0x04 0xED 0x4D 0x53 0x4E 0x34 0x36 0x30 0x30 0x43 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00\"},{\"tlv_name\":\"Vendor Extension\",\"code\":\"0xFD\",\"length\":\"36\",\"value\":\"0x00 0x00 0x81 0x19 0x00 0x10 0x00 0x03 0x05 0xE8 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00\"},{\"tlv_name\":\"Vendor Extension\",\"code\":\"0xFD\",\"length\":\"36\",\"value\":\"0x00 0x00 0x81 0x19 0x00 0x1E 0x00 0x11 0x02 0x07 0x00 0x00 0x0D 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x9C 0x05 0x91 0xCF 0xDC 0x00 0x00 0xFE 0x9C 0x05 0x91 0x03 0x00 0xCF 0xDC 0x00\"},{\"tlv_name\":\"Vendor Extension\",\"code\":\"0xFD\",\"length\":\"36\",\"value\":\"0x00 0x00 0x81 0x19 0x00 0x12 0x00 0x01 0x06 0x85 0x00 0x00 0x00 0x46 0x00 0x00 0x08 0x00 0x05 0x05 0x05 0x05 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00\"},{\"tlv_name\":\"Vendor Extension\",\"code\":\"0xFD\",\"length\":\"20\",\"value\":\"0x00 0x00 0x81 0x19 0x00 0x0E 0x00 0x02 0x07 0x79 0x00 0x00 0x30 0x00 0x40 0x00 0x00 0x00 0x00 0x00\"},{\"tlv_name\":\"CRC-32\",\"code\":\"0xFE\",\"length\":\"4\",\"value\":\"0x0AD290EB\"}],\"checksum_valid\":true}"
    >
  >
>

root@bjw2-can-4600c-5:/# exit

Arista device-
CLI output

admin@str4-7060x6-512-11:~$ show platform syseeprom
ASY: ASY0899401A0
HwApi: 02.00
HwRev: 11.00
MAC: d8:06:f3:5a:a9:b1
MfgTime: 20200101000000
MfgTime2: 20250323092804
SID: QuicksilverP512
SKU: DCS-7060X6-64PE-B
SerialNumber: HBG251204WB

gNMI output - returning raw string here for below reasons-
-> The output here is fetched from platform apis(not db) which can be any format, so merely parsing it based on newline characters/colons may break.
-> The raw string can be returned as-is, since the client already incorporates an extra level of parsing logic to handle it appropriately.

root@str4-7060x6-512-11:/# gnmi_get -xpath_target SHOW -xpath platform/syseeprom -target_addr 127.0.0.1:50051 -logtostderr -insecure true
== getRequest:
prefix: <
  target: "SHOW"
>
path: <
  elem: <
    name: "platform"
  >
  elem: <
    name: "syseeprom"
  >
>
encoding: JSON_IETF

== getResponse:
notification: <
  timestamp: 1777542151584832178
  prefix: <
    target: "SHOW"
  >
  update: <
    path: <
      elem: <
        name: "platform"
      >
      elem: <
        name: "syseeprom"
      >
    >
    val: <
      json_ietf_val: "{\"eeprom_raw\":\"ASY: ASY0899401A0\\nHwApi: 02.00\\nHwRev: 11.00\\nMAC: d8:06:f3:5a:a9:b1\\nMfgTime: 20200101000000\\nMfgTime2: 20250323092804\\nSID: QuicksilverP512\\nSKU: DCS-7060X6-64PE-B\\nSerialNumber: HBG251204WB\"}"
    >
  >
>

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

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

@Sreevanich16
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@Sreevanich16
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@Sreevanich16
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@Sreevanich16
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown

@sharmavijay-ms sharmavijay-ms left a comment

Choose a reason for hiding this comment

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

LGTM

@Sreevanich16 Sreevanich16 merged commit a5c9988 into Azure:kubesonic May 5, 2026
10 checks passed
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.

3 participants