diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 42c40ab36b0a..2d2c2e63d4ec 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -369,7 +369,8 @@ "yang_config_validation": "disable", "rack_mgmt_map": "dummy_value", "timezone": "Europe/Kiev", - "bgp_router_id": "8.8.8.8" + "bgp_router_id": "8.8.8.8", + "chassis_hostname": "str-sonic-chassis-1" } }, "VLAN": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index 226107109944..5f81f02a3c7e 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -169,5 +169,8 @@ "DEVICE_METADATA_INVALID_BGP_ROUTER_ID": { "desc": "Verifying invalid bgp_router_id configuration.", "eStrKey": "Pattern" + }, + "DEVICE_METADATA_VALID_CHASSIS_HOSTNAME": { + "desc": "Verifying valid chassis hostname configuration." } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index cda0eef26e23..75d08694a5a5 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -462,5 +462,14 @@ } } } + }, + "DEVICE_METADATA_VALID_CHASSIS_HOSTNAME": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "chassis_hostname": "sonic-chassis-1" + } + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index 02f81283cf7d..e201b4bfde81 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -254,6 +254,11 @@ module sonic-device_metadata { type inet:ipv4-address; description "BGP Router identifier"; } + + leaf chassis_hostname { + description "hostname of the chassis to which this linecard or supervisor belongs to"; + type stypes:hostname; + } } /* end of container localhost */ }