Skip to content

Enhancement: Ensure minigraph-based provisioning is compatible with generic HWSKU #25751

@bingwang-ms

Description

@bingwang-ms

Is it platform specific

generic

Importance or Severity

High

Description of the enhancement

In minigraph-based provisioning (used in many production deployments), each device is assigned a specific HWSKU name via the <HwSku> element in the minigraph XML file, for example:

xml <Device> <Hostname>switch1</Hostname> <HwSku>Arista-7060X6-64PE-B-P64</HwSku> ... </Device>

This HWSKU name is parsed by minigraph.py (parse_device(), parse_chassis_hwsku()) and written into DEVICE_METADATA.hwsku in ConfigDB. All downstream file lookups hwsku.json, sai.profile, pg_profile_lookup.ini, buffer/QoS templates then resolve using this HWSKU name.

When Generic HWSKU is introduced (see related issues below), per-HWSKU folders are removed. A device provisioned with a minigraph that still references an old specific HWSKU name (e.g., Arista-7060X6-64PE-B-P64) will fail to locate any of the required platform files, since the corresponding folder no longer exists.

Current Behavior

  • minigraph.py reads <HwSku> from the minigraph XML and sets it as DEVICE_METADATA.hwsku.
  • All platform file lookups (hwsku.json, sai.profile, QoS templates, etc.) are resolved using this HWSKU name as the directory.
  • There is no fallback mechanism: if the HWSKU-specific folder is absent, provisioning fails.

Proposed Behavior

To support generic HWSKU in minigraph-based deployments, the following changes are needed:

  1. Fallback lookup in file resolution: When the HWSKU-specific folder/file is not found, fall back to the platform-level folder (e.g., /usr/share/sonic/device/{platform}/hwsku.json). This applies to get_hwsku_file_name() in portconfig.py and get_path_to_hwsku_config_file() in sonic_py_common/device_info.py.

  2. Minigraph HWSKU normalization: Optionally, minigraph.py could map an old specific HWSKU name to the generic HWSKU name during parsing if the specific folder no longer exists, to ensure DEVICE_METADATA.hwsku is consistent with the new naming convention.

  3. sonic-cfggen template rendering: Templates (buffer, QoS, SAI profile) rendered during config load_minigraph should resolve using the generic HWSKU path when the specific HWSKU folder is missing.

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions