Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[multi-asic][202305]: 'config reload -l <>' option loads incorrect config #18431

Closed
anamehra opened this issue Mar 22, 2024 · 5 comments · Fixed by #18452
Closed

[multi-asic][202305]: 'config reload -l <>' option loads incorrect config #18431

anamehra opened this issue Mar 22, 2024 · 5 comments · Fixed by #18452
Assignees
Labels
MSFT Triaged this issue has been triaged

Comments

@anamehra
Copy link
Contributor

anamehra commented Mar 22, 2024

Description

On multi-asic system, I see that when we run config reload with -l, it creates additional ports with alias as interface names.

root@sfd-vt2-lc0:/home/cisco# show int st -d all -n asic0
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC


 Eth0/0/0/0                  N/A     400G   9100    N/A           N/A           routed     N/A       up     N/A         off
 Eth0/0/0/1                  N/A     400G   9100    N/A           N/A           routed     N/A       up     N/A         off
 Eth0/0/0/2                  N/A     400G   9100    N/A           N/A           routed     N/A       up     N/A         off
 Eth0/0/0/3                  N/A     400G   9100    N/A           N/A           routed     N/A       up     N/A         off
 Eth0/0/0/4                  N/A     400G   9100    N/A           N/A           routed     N/A       up     N/A         off
 Eth0/0/0/5                  N/A     400G   9100    N/A           N/A           routed     N/A       up     N/A         off
 Eth0/0/0/6                  N/A     400G   9100    N/A           N/A           routed     N/A       up     N/A         off

This affects the sonic-mgmt recovery and other test cases which use config reload with running_golden_config option.

Root Cause:
sonic-cfggen misses handling for namespace at couple of locations. Due to which when port config is fetched, it returns data from global config and not the namespace.

The function calls at https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-config-engine/sonic-cfggen#L361C1-L364C84

get_path_to_port_config_file
get_port_config

needs to be fixed to handle namespace

it should be

        if args.port_config is None:
            args.port_config = device_info.get_path_to_port_config_file(hwsku, **asic_id**)
        load_namespace_config(asic_name)
        (ports, _, _) = get_port_config(hwsku, platform, args.port_config, hwsku_config_file=args.hwsku_config, asic_name=asic_name)

Steps to reproduce the issue:

  1. Run 'config reload -l'

Describe the results you received:

Additional ports were created with 'alias' as interface names.

Describe the results you expected:

Duplicate port entries with alias names should not be created

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

@anamehra
Copy link
Contributor Author

Hi @abdosi , @vperumal , @rajendrat for your viz

@prgeor
Copy link
Contributor

prgeor commented Mar 27, 2024

@qiluo-msft would you check why the host has populated port data from other namespace? @mlok-nokia can you create a separate git issue for chassis community and point to this?

@mlok-nokia
Copy link
Contributor

mlok-nokia commented Mar 27, 2024

This issue has been reported by in the chassis community -- #18286

@wen587
Copy link
Contributor

wen587 commented Mar 29, 2024

Hi @judyjoseph , the issue was introduced in your PR sonic-net/sonic-utilities#877
I will assign it to you for triage.

@anamehra
Copy link
Contributor Author

anamehra commented Apr 3, 2024

I have a PR to fix this, #18452
please help with review.

@rlhui rlhui assigned anamehra and unassigned judyjoseph, qiluo-msft and wen587 Apr 3, 2024
qiluo-msft pushed a commit that referenced this issue May 23, 2024
…18452)

Fixes: #18431

#### Why I did it
sonic-cfggen misses handling for namespace at couple of locations. Due to this, when port config is fetched, it returns data from global config and not the namespace.

The function calls for
get_path_to_port_config_file
get_port_config

needs to be fixed to handle namespace for multi-asic.

#### How I did it
1.Pass asic_id as argument when calling get_path_to_port_config_file()
For single asic, asic_id is None and the function returns the correct port_config.ini file path.
For multi-asic, using asic_id provides the correct file path for the asic.

2. Pass asic_name as argument when calling get_port_config()

#### How to verify it
sonic-cfggen -H --print -n -k
This command should return the correct port config for the namespace.
henrymao-zz pushed a commit to canonical/sonic-buildimage that referenced this issue Jun 23, 2024
…#18452)

Fixes: sonic-net/sonic-buildimage#18431

#### Why I did it
sonic-cfggen misses handling for namespace at couple of locations. Due to this, when port config is fetched, it returns data from global config and not the namespace.

The function calls for
get_path_to_port_config_file
get_port_config

needs to be fixed to handle namespace for multi-asic.

#### How I did it
1.Pass asic_id as argument when calling get_path_to_port_config_file()
For single asic, asic_id is None and the function returns the correct port_config.ini file path.
For multi-asic, using asic_id provides the correct file path for the asic.

2. Pass asic_name as argument when calling get_port_config()

#### How to verify it
sonic-cfggen -H --print -n -k
This command should return the correct port config for the namespace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MSFT Triaged this issue has been triaged
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants