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:
-
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.
-
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.
-
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
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 intoDEVICE_METADATA.hwskuin ConfigDB. All downstream file lookupshwsku.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.pyreads<HwSku>from the minigraph XML and sets it asDEVICE_METADATA.hwsku.hwsku.json,sai.profile, QoS templates, etc.) are resolved using this HWSKU name as the directory.Proposed Behavior
To support generic HWSKU in minigraph-based deployments, the following changes are needed:
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 toget_hwsku_file_name()inportconfig.pyandget_path_to_hwsku_config_file()insonic_py_common/device_info.py.Minigraph HWSKU normalization: Optionally,
minigraph.pycould map an old specific HWSKU name to the generic HWSKU name during parsing if the specific folder no longer exists, to ensureDEVICE_METADATA.hwskuis consistent with the new naming convention.sonic-cfggentemplate rendering: Templates (buffer, QoS, SAI profile) rendered duringconfig load_minigraphshould resolve using the generic HWSKU path when the specific HWSKU folder is missing.Related Issues