cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

284
Views
5
Helpful
3
Replies
aidariys5
Beginner

Pyats testbed connections

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).

View solution in original post

3 REPLIES 3
balaji.bandi
VIP Guru

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
Beginner

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).

Create
Recognize Your Peers
Content for Community-Ad