-
Notifications
You must be signed in to change notification settings - Fork 648
Description
Severity: Major (Blocks port configuration)
Component: swssconfig, portmgrd (Configuration Validator)
Description:
On a clean install, if a static IP address is configured for the management port eth0, an entry is created in the MGMT_INTERFACE table of the database.
However, no corresponding entry is created in the MGMT_PORT table.
This causes the config interface breakout command to fail its validation check, as it seems to expect a MGMT_PORT entry for every MGMT_INTERFACE entry. The command fails with a ConfigMgmt Class creation failed error, preventing any port breakouts.
Steps to Reproduce:
- Start with a clean, stable switch (management on DHCP).
- Assign a static IP to the management port:
sudo config interface ip add eth0 10.18.0.36/23 10.18.0.1 - Save the configuration:
sudo config save -y - Attempt to break out any data port:
sudo config interface breakout Ethernet240 '1x100G(4)'
Expected Behavior:
The breakout command should succeed. The configuration of the management port (eth0) should be irrelevant to a data port (Ethernet240) breakout operation.
Actual Behavior:
The breakout command fails with a configuration validation error. The log shows ConfigMgmt Class creation failed and leafref errors, indicating the validator is unhappy with the MGMT_INTERFACE entry not having a MGMT_PORT counterpart.
Workaround:
The validation bug can be fixed by manually adding a MGMT_PORT block to /etc/sonic/config_db.json and reloading the config:
"MGMT_PORT": {
"eth0": {
"alias": "eth0",
"admin_status": "up"
}
}After running sudo config reload, the breakout command works as expected.
Suggested Fix:
The configuration logic should be fixed in one of two ways:
- Fix the Validator: The config validator should be modified to not require a
MGMT_PORTentry when aMGMT_INTERFACEentry exists. The presence ofeth0in theMGMT_INTERFACEtable should be sufficient. - Fix the
configcommand: Alternatively, when thesudo config interface ip add eth0...command is executed, it should automatically create the corresponding defaultMGMT_PORTblock (e.g., with"alias": "eth0") to ensure the configuration remains valid.