Skip to content

Add option to copy minigraph to DUT#2888

Closed
SuvarnaMeenakshi wants to merge 7 commits intosonic-net:masterfrom
SuvarnaMeenakshi:copy_mg
Closed

Add option to copy minigraph to DUT#2888
SuvarnaMeenakshi wants to merge 7 commits intosonic-net:masterfrom
SuvarnaMeenakshi:copy_mg

Conversation

@SuvarnaMeenakshi
Copy link
Contributor

@SuvarnaMeenakshi SuvarnaMeenakshi commented Jan 29, 2021

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

  • For multi-asic VS platform, topology service has to be started before loading minigraph after boot up. This is required because some services(swss/syncd/teamd) are dependent on topology service.
  • Add a new option to copy a generated minigraph in ansible/minigraph directory to DUT and load minigraph.
    This option will skip generating the minigraph from the templates and load a generated minigraph. This is done so that we can load an existing multi-asic minigraph while multi-asic minigraph generation is not in place.

How did you do it?

  • Add a new option to copy generated minigraph with the name minigraph/DUT_NAME.TOPO.xml to DUT instead of creating minigraph from templates.
  • To copy the exiting minigraph (minigraph/DUT_NAME.TOPO.xml) to DUT:
    ./testbed-cli.sh -t vtestbed.csv -m veos_vtb copy-mg vms-kvm-t0 lab password.txt
    To copy existing minigraph( minigraph/DUT_NAME.TOPO.xml ) to DUT and load minigraph:
    ./testbed-cli.sh -t vtestbed.csv -m veos_vtb copy-mg vms-kvm-t0 lab password.txt -e deploy=true -e save=true
    To generate a new minigraph locally and load the generated minigraph to DUT:
    ./testbed-cli.sh -t vtestbed.csv -m veos_vtb geb-mg vms-kvm-t0 lab password.txt -e copy=true

How did you verify/test it?

  • Single asic VS - No Change.
  • Multi-asic VS - use a 4-asic vs image and bring up multi-asic VS testbed.
    ./testbed-cli.sh -t vtestbed.csv -m veos_vtb -k ceos add-topo vms-kvm-multi-asic-t1-lag password.txt
  • Copy minigraph and verify start of topology service and loading minigraph using:
    ./testbed-cli.sh -t vtestbed.csv -m veos_vtb copy-mg vms-kvm-multi-asic-t1-lag lab password.txt
  • Verify that all internal and external interfaces are up and all internal and external BGP sessions are up.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

loading minigraph. Topolgy service should be started only
for multi-asic vs.
Add support to copy a generated minigraph and load it on
the device.

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
before loading minigraph. This will be required for multi-asic
vs hwsku.

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
echo " $0 [options] (connect-vms | disconnect-vms) <topo-name> <vault-password-file>"
echo " $0 [options] config-vm <topo-name> <vm-name> <vault-password-file>"
echo " $0 [options] (gen-mg | deploy-mg | test-mg) <topo-name> <inventory> <vault-password-file>"
echo " $0 [options] (gen-mg | deploy-mg | test-mg | copy-mg) <topo-name> <inventory> <vault-password-file>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the difference between copy-mg and deploy-mg?

Copy link
Contributor Author

@SuvarnaMeenakshi SuvarnaMeenakshi Feb 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deploy_mg will create minigraph from templates and load the minigraph.
copy_mg will copy an existing minigraph, placed in ansible/minigraph/<dut_name>.topology.xml, and execute load_minigraph with the copied minigraph on DUT.
For multi-asic platform, minigraph creation from templates is not completed yet, so to load minigraph configuration for multi-asic vs, added a new option to help load a created minigraph, for example, we could load an existing minigraph from here:
https://github.com/Azure/sonic-mgmt/blob/4986dbd816b4bb6f539ddacb32cd99fc03678c5f/ansible/minigraph/vlab-07.t1-8-lag.xml

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
@sanmalho-git
Copy link
Contributor

sanmalho-git commented Feb 3, 2021

For a T2 VOQ chassis, we have a need to just copy the generated minigraph but not deploy them (due to missing functionality that is still under development). So, we need to call 'gen-mg' with deploy=false flag. However, the port_alias calls in 'config_sonic_basedon_testbed.yml' are dependent on the 'deploy' flag, and thus with deploy=false, we run 'port_alias' delegated to localhost and fail when trying to gen-mg on h/w.

To address this issue, can we use the new 'copy' flag instead of the 'deploy' flag

  - name: find interface name mapping and individual interface speed if defined from dut
    port_alias: hwsku="{{ hwsku }}"
    when: copy is defined and copy|bool == true

  - name: find interface name mapping and individual interface speed if defined with local data
    port_alias: hwsku="{{ hwsku }}"
    delegate_to: localhost
    when: copy is not defined or copy|bool == false

Also, move the 'copy' task in config_sonic_basedon_testbed.yml outside the block when 'deploy=true'

Then for our T2 chassis scenario, we could use:

./testbed-cli.sh -t testbed.csv -m veos gen-mg chassis1-t2 lab password.txt -e copy=true -e deploy=false

device.

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
@SuvarnaMeenakshi SuvarnaMeenakshi requested a review from a team as a code owner February 16, 2021 22:24
@SuvarnaMeenakshi
Copy link
Contributor Author

For a T2 VOQ chassis, we have a need to just copy the generated minigraph but not deploy them (due to missing functionality that is still under development). So, we need to call 'gen-mg' with deploy=false flag. However, the port_alias calls in 'config_sonic_basedon_testbed.yml' are dependent on the 'deploy' flag, and thus with deploy=false, we run 'port_alias' delegated to localhost and fail when trying to gen-mg on h/w.

To address this issue, can we use the new 'copy' flag instead of the 'deploy' flag

  • name: find interface name mapping and individual interface speed if defined from dut
    port_alias: hwsku="{{ hwsku }}"
    when: copy is defined and copy|bool == true

  • name: find interface name mapping and individual interface speed if defined with local data
    port_alias: hwsku="{{ hwsku }}"
    delegate_to: localhost
    when: copy is not defined or copy|bool == false
    Also, move the 'copy' task in config_sonic_basedon_testbed.yml outside the block when 'deploy=true'

Then for our T2 chassis scenario, we could use:

./testbed-cli.sh -t testbed.csv -m veos gen-mg chassis1-t2 lab password.txt -e copy=true -e deploy=false

Updated copy functionality to just copy and not load unless deploy option is provided. Updated PR description to explain the options.

Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
@SuvarnaMeenakshi SuvarnaMeenakshi changed the title [multi-asic][vs]: Add option to copy and load minigraph to DUT and start topology service Add option to copy minigraph to DUT Feb 23, 2021
@SuvarnaMeenakshi
Copy link
Contributor Author

closing this PR as we do not require copy option for multi-asic vs testbed.
#3024 and #3025 are merged in to generate minigraph for multi-asic DUTs.

kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…atically (sonic-net#15835)

src/sonic-utilities

* bc7c7929 - (HEAD -> 202205, origin/202205) Add FEC correctable and uncorrectable port stats (sonic-net#2027) (10 hours ago) [Prince George]
* 58db48ad - [show][muxcable] update `show mux tunnel-route` to check soc_ipv6 as well (10 hours ago) [Jing Zhang]
* 24fc1db8 - [dualtor][route_check] filter out `soc_ipv6`  (sonic-net#2899) (10 hours ago) [Jing Zhang]
* d89d4832 - [route_check][dualtor] Ignore vlan neighbor route miss (sonic-net#2888) (10 hours ago) [Longxiang Lyu]
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…lly (sonic-net#17094)

src/sonic-swss

* 01bf3b19 - (HEAD -> 202205, origin/202205) [muxorch] Fixing updateRoute logic (sonic-net#2950) (5 hours ago) [Nikola Dancejic]
* 1e264e01 - Handle Mac address 'none' (sonic-net#2593) (9 hours ago) [Prince Sunny]
* dc0e29b4 - [202205][teamd]: Clean teamd process if LAG creation fails (sonic-net#2888) (sonic-net#2932) (4 days ago) [Lawrence Lee]
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…lly (sonic-net#16642)

#### Why I did it
src/sonic-swss
```
* 0584d35b - (HEAD -> 202305, origin/202305) Revert "Support type7 encoded CAK key for macsec in config_db (sonic-net#2892)" (3 minutes ago) [stormliang]
* 7097cf2b - Revert "[teamd]: Clean teamd process if LAG creation fails (sonic-net#2888)" (3 days ago) [stormliang]
* a0eb0d07 - Support type7 encoded CAK key for macsec in config_db (sonic-net#2892) (4 days ago) [judyjoseph]
* c7e5f10e - [teamd]: Clean teamd process if LAG creation fails (sonic-net#2888) (4 days ago) [Lawrence Lee]
* f30b6107 - [CodeQL]: Use dependencies with relevant versions in azp template. (sonic-net#2845) (4 days ago) [Nazarii Hnydyn]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants