Skip to content

config interface breakout fails validation if a static IP is set on the management interface (eth0) without a corresponding MGMT_PORT block. #3980

@univac490

Description

@univac490

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:

  1. Start with a clean, stable switch (management on DHCP).
  2. Assign a static IP to the management port:
    sudo config interface ip add eth0 10.18.0.36/23 10.18.0.1
  3. Save the configuration:
    sudo config save -y
  4. 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:

  1. Fix the Validator: The config validator should be modified to not require a MGMT_PORT entry when a MGMT_INTERFACE entry exists. The presence of eth0 in the MGMT_INTERFACE table should be sufficient.
  2. Fix the config command: Alternatively, when the sudo config interface ip add eth0... command is executed, it should automatically create the corresponding default MGMT_PORT block (e.g., with "alias": "eth0") to ensure the configuration remains valid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions