[yang-models] Add chassis fields to device_metadata (#10006)

This change is adding asic_name, switch_id, switch_type and max_cores to sonic-device_metadata.yang
This should fix issue #9575

Co-authored-by: Maxime Lorrillere <mlorrillere@arista.com>
This commit is contained in:
Maxime Lorrillere 2022-03-02 00:10:04 -08:00 committed by GitHub
parent 3bb87c03a1
commit 7891760fd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 2 deletions

View File

@ -293,7 +293,11 @@
"hwsku": "Stone", "hwsku": "Stone",
"buffer_model": "dynamic", "buffer_model": "dynamic",
"cloudtype": "Public", "cloudtype": "Public",
"region": "usfoo" "region": "usfoo",
"asic_name": "Asic0",
"switch_id": "2",
"switch_type": "voq",
"max_cores": "8"
} }
}, },
"VLAN": { "VLAN": {

View File

@ -93,6 +93,13 @@
"DEVICE_METADATA_INVALID_STORAGE_DEVICE": { "DEVICE_METADATA_INVALID_STORAGE_DEVICE": {
"desc": "Verifying invalid storage device value", "desc": "Verifying invalid storage device value",
"eStrKey": "InvalidValue" "eStrKey": "InvalidValue"
} },
"DEVICE_METADATA_INCORRECT_VOQ_CONFIG": {
"desc": "Verifying incorrect switch_type configuration.",
"eStrKey": "Pattern"
},
"DEVICE_METADATA_CORRECT_VOQ_CONFIG": {
"desc": "Verifying VOQ configuration."
}
} }

View File

@ -250,5 +250,29 @@
} }
} }
} }
},
"DEVICE_METADATA_INCORRECT_VOQ_CONFIG": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"asic_name": "Asic0",
"switch_id": "2",
"switch_type": "incorrect_pattern",
"max_cores": "8"
}
}
}
},
"DEVICE_METADATA_CORRECT_VOQ_CONFIG": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"asic_name": "Asic0",
"switch_id": "2",
"switch_type": "voq",
"max_cores": "8"
}
}
}
} }
} }

View File

@ -153,6 +153,31 @@ module sonic-device_metadata {
leaf storage_device { leaf storage_device {
type boolean; type boolean;
} }
leaf asic_name {
type string;
description "On a VoQ switch, the ASIC Name is used as a qualifier in global
database keys to create a system wide unique key.";
}
leaf switch_id {
type uint16;
description "Vendor specific switch ID. Identifies switch chip.";
}
leaf switch_type {
type string {
pattern "chassis-packet|fabric|npu|voq";
}
description "Type of switch. Default is NPU, on a VOQ switch voq is used for a regular
switching device while fabric is used for a fabric device.
chassis-packet is used for chassis in packet mode.";
}
leaf max_cores {
type uint8;
description "Maximum number of cores in a VoQ Switch (chassis).";
}
} }
/* end of container localhost */ /* end of container localhost */
} }