<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: pyATS genie cannot connect via ssh in Tools</title>
    <link>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4523847#M974</link>
    <description>&lt;P&gt;I had the same issue and following the steps from SPDCool solved it, thank you!&lt;/P&gt;</description>
    <pubDate>Sun, 26 Dec 2021 14:49:32 GMT</pubDate>
    <dc:creator>Drake</dc:creator>
    <dc:date>2021-12-26T14:49:32Z</dc:date>
    <item>
      <title>pyATS genie cannot connect via ssh</title>
      <link>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4163338#M967</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Just started to play around with pyATS and genie.&lt;/P&gt;&lt;P&gt;But I cannot connect to the switch via ssh.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My testbed.yml file looks like this:&lt;/P&gt;&lt;PRE&gt;devices:
  as-test2:
    connections:
      vty:
        ip: 172.21.31.6
        protocol: ssh
    credentials:
      default:
        password: '%ASK{}'
        username: chris
    os: iosxe
    type: iosxe
    series: cat9k
    platform: cat9k&lt;/PRE&gt;&lt;P&gt;Then I try to parse "show version" and the connect fails:&lt;/P&gt;&lt;PRE&gt;./bin/genie -vvv parse "show version" --testbed-file testbed.yml 
loading yaml file /Users/cb/networking/genie/testbed.yml
Deriving testbed name ...
Enter default password for device as-test2: 
Using a default key as pyATS configuration under [secrets] string.key was not specified.
Using a default key as pyATS configuration under [secrets] string.key was not specified.
Credential credentials not found, trying default ...
Credential credentials not found, trying default ...

2020-10-08 11:04:33,535: %UNICON-INFO: +++ as-test2 logfile /tmp/as-test2-cli-20201008T110433535.log +++

2020-10-08 11:04:33,536: %UNICON-INFO: +++ Unicon plugin iosxe/cat9k +++
Connection closed by 172.21.31.6 port 22


2020-10-08 11:04:42,574: %UNICON-INFO: +++ connection to spawn: ssh -l chris 172.21.31.6, id: 4682891904 +++

2020-10-08 11:04:42,574: %UNICON-INFO: connection to as-test2
  0%|                                                                                                                                                                             | 0/1 [00:00&amp;lt;?, ?it/s]Issue with the parser show version


Traceback (most recent call last):
  File "src/genie/cli/commands/parser.py", line 339, in genie.cli.commands.parser.ParserCommand.parse
  File "src/genie/conf/base/device.py", line 551, in genie.conf.base.device.Device.parse
  File "src/genie/conf/base/device.py", line 582, in genie.conf.base.device.Device._get_parser_output
TypeError: device is not connected, output must be provided.
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00&amp;lt;00:00,  2.30it/s]

&lt;/PRE&gt;&lt;P&gt;ssh access in general is working via terminal, and also username and password are correct.&lt;/P&gt;&lt;P&gt;In syslog it generates messages:&lt;/P&gt;&lt;PRE&gt;%SEC_LOGIN-4-LOGIN_FAILED: Login failed [user: Invalid-Credentials] [Source: 172.23.8.241] [localport: 22] [Reason: Login Authentication Failed]&lt;/PRE&gt;&lt;P&gt;Has someone an idea what could be the reason.&lt;/P&gt;&lt;P&gt;Kind regards, Christian&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 09:27:12 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4163338#M967</guid>
      <dc:creator>boesch</dc:creator>
      <dc:date>2020-10-08T09:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: pyATS genie cannot connect via ssh</title>
      <link>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4163486#M968</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/153452"&gt;@boesch&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you try replacing vty with your cli in your testbed file?&lt;/P&gt;&lt;P&gt;Also, what version of pyATS are you using.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an Intro Repo that may be of help:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/cldeluna/interop2020_pyats_intro" target="_blank"&gt;https://github.com/cldeluna/interop2020_pyats_intro&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 13:03:14 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4163486#M968</guid>
      <dc:creator>Claudia de Luna</dc:creator>
      <dc:date>2020-10-08T13:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: pyATS genie cannot connect via ssh</title>
      <link>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4163527#M969</link>
      <description>&lt;P&gt;Hi Claudia,&lt;/P&gt;&lt;P&gt;I've already tried changing vty to cli with no effect.&lt;/P&gt;&lt;P&gt;I have pyats version 20.9.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 14:03:15 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4163527#M969</guid>
      <dc:creator>boesch</dc:creator>
      <dc:date>2020-10-08T14:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: pyATS genie cannot connect via ssh</title>
      <link>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4163549#M970</link>
      <description>&lt;P&gt;good..thx for the info.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the hostname as-test2 the actual hostname of the device? &amp;nbsp;Those should match exactly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is what I get when the hostname does not match:&lt;/P&gt;&lt;PRE&gt;(interop2020_pyats_intro) claudia@Claudias-iMac interop2020_pyats_intro % pyats parse "show version" --testbed-file test_tb.yml --output TEST
Enter default password for device as-test2: 
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00&amp;lt;00:00,  2.64it/s]
+==============================================================================+
| Genie Parse Summary for as-test2                                             |
+==============================================================================+
|  Failed to connect to as-test2                                               |
|  -  Log: TEST/connection_as-test2.txt                                        |
|------------------------------------------------------------------------------|
|  Could not parse 'show version'                                              |
|  -  Exception:      TEST/as-test2_show-version_exception.txt                 |
|  -  Device Console: TEST/as-test2_show-version_console.txt                   |
|------------------------------------------------------------------------------|&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I get when it does:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;(interop2020_pyats_intro) claudia@Claudias-iMac interop2020_pyats_intro % pyats parse "show version" --testbed-file test_tb.yml --output TEST
Enter default password for device celebes-sw05: 
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00&amp;lt;00:00,  1.30it/s]
+==============================================================================+
| Genie Parse Summary for celebes-sw05                                         |
+==============================================================================+
|  Connected to celebes-sw05                                                   |
|  -  Log: TEST/connection_celebes-sw05.txt                                    |
|------------------------------------------------------------------------------|
|  Parsed command 'show version'                                               |
|  -  Parsed structure: TEST/celebes-sw05_show-version_parsed.txt              |
|  -  Device Console:   TEST/celebes-sw05_show-version_console.txt             |
|------------------------------------------------------------------------------|

(interop2020_pyats_intro) claudia@Claudias-iMac interop2020_pyats_intro % &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the testbed file I used the second time (that worked):&lt;/P&gt;&lt;PRE&gt;---
devices:
  celebes-sw05:
    connections:
      vty:
        ip: 10.1.10.216
        protocol: ssh
    credentials:
      default:
        password: '%ASK{}'
        username: cisco
    os: iosxe
    type: iosxe
    series: cat9k
    platform: cat9k&lt;/PRE&gt;&lt;P&gt;So you are on the right track!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 14:42:14 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4163549#M970</guid>
      <dc:creator>Claudia de Luna</dc:creator>
      <dc:date>2020-10-08T14:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: pyATS genie cannot connect via ssh</title>
      <link>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4163575#M971</link>
      <description>&lt;P&gt;Yes the hostname is exactly the same:&lt;/P&gt;&lt;PRE&gt;as-test2#sh run | in hostname
hostname as-test2&lt;/PRE&gt;&lt;P class="p1"&gt;In your unsuccessful example you can at least connect.&lt;/P&gt;&lt;P class="p1"&gt;My problem is that the connection cannot be established:&lt;/P&gt;&lt;PRE&gt;Traceback (most recent call last):
  File "src/genie/cli/commands/parser.py", line 339, in genie.cli.commands.parser.ParserCommand.parse
  File "src/genie/conf/base/device.py", line 551, in genie.conf.base.device.Device.parse
  File "src/genie/conf/base/device.py", line 582, in genie.conf.base.device.Device._get_parser_output
TypeError: device is not connected, output must be provided.&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Oct 2020 15:21:09 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4163575#M971</guid>
      <dc:creator>boesch</dc:creator>
      <dc:date>2020-10-08T15:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: pyATS genie cannot connect via ssh</title>
      <link>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4163588#M972</link>
      <description>&lt;P&gt;Yes..you are right. &amp;nbsp;Are you in a position to spin up a new virtual environment or use the pyATS Docker image and try? &amp;nbsp; It looks like your testbed file is good and if you can ssh from that same system I would try to determine if maybe I had an issue with my environment.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 15:39:29 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4163588#M972</guid>
      <dc:creator>Claudia de Luna</dc:creator>
      <dc:date>2020-10-08T15:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: pyATS genie cannot connect via ssh</title>
      <link>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4462266#M973</link>
      <description>&lt;P&gt;If you have done the DEVNET Associate 1.0 course then follow this:-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. See the steps in LAB-7.0.3---- PART-2, STEP-4&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Do those steps again before pushing the command "genie parse "show ip interface brief" --testbed-file yaml/testbed.yml --devices CSR1kv"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. It shows an error because whenever you start CSR1kv it changes the RSA fingerprint in the backend and when you try to connect with the tesbed.yml credentials it refuses the connection due to RSA mismatch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Follow my point no-1 and delete the existing RSA Fingerprint and update with the new one and again push the command "show ip interface brief" --testbed-file yaml/testbed.yml --devices CSR1kv" it will work for sure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;5. You can see the screenshots for further reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satya Prakash Dhal&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 08:04:14 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4462266#M973</guid>
      <dc:creator>SPDCool</dc:creator>
      <dc:date>2021-09-09T08:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: pyATS genie cannot connect via ssh</title>
      <link>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4523847#M974</link>
      <description>&lt;P&gt;I had the same issue and following the steps from SPDCool solved it, thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 26 Dec 2021 14:49:32 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4523847#M974</guid>
      <dc:creator>Drake</dc:creator>
      <dc:date>2021-12-26T14:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: pyATS genie cannot connect via ssh</title>
      <link>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4834375#M975</link>
      <description>&lt;P&gt;your screenshots definitely helped!! thank you&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 14:03:39 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/pyats-genie-cannot-connect-via-ssh/m-p/4834375#M975</guid>
      <dc:creator>edralyyn</dc:creator>
      <dc:date>2023-05-12T14:03:39Z</dc:date>
    </item>
  </channel>
</rss>

