cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1294
Views
5
Helpful
3
Replies

Pyats testbed connections

aidariys5
Level 1
Level 1

Hi,

What is the purpose of having multiple connections described in testbed file? Is it possible to choose one among others for connection?

For example:

devices:
  R1:
    os: ios
    type: ios
    connections:
      a:
        protocol: ssh
        ip: 192.168.1.1
        port: 22
      b:
        protocol: telnet
        ip: 192.168.1.1
        port: 23

If I specify one of this connection (a or b) in testbed, then pyats can connect to device. If both connections are present as in example above, then connection is not working. I saw similar examples with several connections in documentation but didn't find any explanation.

Thank you.

1 Accepted Solution

Accepted Solutions

@aidariys5 multiple connection instances start to make sense when you want to perform many show commands at the same time through asynchronous means (eg, multiprocessing, threading, etc).

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

View solution in original post

3 Replies 3

balaji.bandi
Hall of Fame
Hall of Fame

if you are using only SSH, then remove telnet from config.

 

https://pubhub.devnetcloud.com/media/pyats-getting-started/docs/quickstart/manageconnections.html?highlight=telnet

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

aidariys5
Level 1
Level 1

Thanks for reply, but I was asking about use cases of having multiple connections for one device. I found that it is needed if you describe HA pair or stack, for example.

Another usage that you can choose connection in python:

testbed = loader.load('testbed.yaml')

r1 = testbed.devices['R1']

r1.connect(alias='aaa', via='a')

r1.connect(alias='bbb', via='b')

r1.aaa.execute('show clock')

@aidariys5 multiple connection instances start to make sense when you want to perform many show commands at the same time through asynchronous means (eg, multiprocessing, threading, etc).

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: