cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2309
Views
5
Helpful
6
Replies

Clean install - Failed to connect to server

pmorvay
Cisco Employee
Cisco Employee

Hi I am getting familiar with NSO, starting with the "getting started guide". But I have issue to connected to simulated device.

I have clean install of NSO 4.7, I have same issue on MacOS and Ubuntu 18.04.:

I think I am missing some initial step. On MacOS initially it shown issue with java, which I resolved by installing older version of java 6.

 

cisco@ubuntu:~$ source /home/cisco/nso-4.7/ncsrc
cisco@ubuntu:~$ cd /home/cisco/nso-4.7/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios
cisco@ubuntu:~/nso-4.7/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs-netsim create-network /home/cisco/nso-4.7/packages/neds/cisco-ios 3 c
DEVICE c0 CREATED
DEVICE c1 CREATED
DEVICE c2 CREATED
cisco@ubuntu:~/nso-4.7/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs-netsim list
ncs-netsim list for /home/cisco/nso-4.7/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios/netsim

name=c0 netconf=12022 snmp=11022 ipc=5010 cli=10022 dir=/home/cisco/nso-4.7/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios/netsim/c/c0
name=c1 netconf=12023 snmp=11023 ipc=5011 cli=10023 dir=/home/cisco/nso-4.7/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios/netsim/c/c1
name=c2 netconf=12024 snmp=11024 ipc=5012 cli=10024 dir=/home/cisco/nso-4.7/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios/netsim/c/c2
cisco@ubuntu:~/nso-4.7/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs-netsim cli-i c1
Failed to connect to server
cisco@ubuntu:~/nso-4.7/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs-netsim cli-c c1
Failed to connect to server

 

It seems, the simulated device does not start at all:

ncs-netsim is-alive
DEVICE c0 FAIL
DEVICE c1 FAIL
DEVICE c2 FAIL

 

Any advise?

 

This is how I installed the NSO:

133 cd nso-4.7.linux.x86_64/
134 ls
135 sh nso-4.7.linux.x86_64.signed.bin
136 ls
137 sh nso-4.7.linux.x86_64.installer.bin $HOME/nso-4.7

 

1 Accepted Solution

Accepted Solutions

lmanor
Cisco Employee
Cisco Employee

Hello,

 

From the output it doesn't look like you have started the netsim devices.

 

$ ncs-netsim start

 

Here is the sequence I generally use:

 

===============  netsim setup ==============
 
$ ncs-netsim --help
 
$ ncs-netsim create-network ./packages/cisco-iosxr 2 asr
DEVICE asr0 CREATED
DEVICE asr1 CREATED
$ ncs-netsim add-to-network ./packages/juniper-junos 2 mx
DEVICE mx0 CREATED
DEVICE mx1 CREATED
 
$ ncs-netsim start
DEVICE asr0 OK STARTED
DEVICE asr1 OK STARTED
DEVICE mx0 OK STARTED
DEVICE mx1 OK STARTED
 
# Save nets device unbarring config xml to ncs-cdb directory
$ ncs-setup --netsim-dir ./netsim --dest .
 
$ ls ncs-cdb
netsim_devices_init.xml
 
$ ncs-netsim cli-i asr0
 
-Larry

View solution in original post

6 Replies 6

lmanor
Cisco Employee
Cisco Employee

Hello,

 

From the output it doesn't look like you have started the netsim devices.

 

$ ncs-netsim start

 

Here is the sequence I generally use:

 

===============  netsim setup ==============
 
$ ncs-netsim --help
 
$ ncs-netsim create-network ./packages/cisco-iosxr 2 asr
DEVICE asr0 CREATED
DEVICE asr1 CREATED
$ ncs-netsim add-to-network ./packages/juniper-junos 2 mx
DEVICE mx0 CREATED
DEVICE mx1 CREATED
 
$ ncs-netsim start
DEVICE asr0 OK STARTED
DEVICE asr1 OK STARTED
DEVICE mx0 OK STARTED
DEVICE mx1 OK STARTED
 
# Save nets device unbarring config xml to ncs-cdb directory
$ ncs-setup --netsim-dir ./netsim --dest .
 
$ ls ncs-cdb
netsim_devices_init.xml
 
$ ncs-netsim cli-i asr0
 
-Larry

lmanor
Cisco Employee
Cisco Employee
Should read:
# Save netsim device onboarding config xml to ncs-cdb directory

Thank you very much for you help, I indeed skipped the step to start simulated devices.

I will re-read the starting guide. Your help is much appreciated.

irfanshabbir
Level 1
Level 1

Hi I'm using NSO-6.0 ,i used the command ncs --stop and in this response ncs has been stoped.
And once i again it run  NSO with source,cd and ncs they show following output with Failed to connect to server error.

nso@nsolab2:~$
nso@nsolab2:~$
nso@nsolab2:~$ source /home/nso/ncs-run/ncsrc
nso@nsolab2:~$
nso@nsolab2:~$ cd /home/nso/nso-6.0
nso@nsolab2:~/nso-6.0$
nso@nsolab2:~/nso-6.0$
nso@nsolab2:~/nso-6.0$ ncs
Bad configuration: /home/nso/nso-6.0/ncs.conf:0: Cannot open ./logs/ncserr.log.1 for writing, defined for /ncs-config/logs/error-log/filename
Daemon died status=21
nso@nsolab2:~/nso-6.0$
nso@nsolab2:~/nso-6.0$
nso@nsolab2:~/nso-6.0$ ncs_cli -C -u admin
Failed to connect to server
nso@nsolab2:~/nso-6.0$
nso@nsolab2:~/nso-6.0$
nso@nsolab2:~/nso-6.0$
nso@nsolab2:~/nso-6.0$

Please help me.


jvikman
Cisco Employee
Cisco Employee

Hi,

Is the ./logs directory created?

BR,

Johan

jvikman
Cisco Employee
Cisco Employee

NCS never started so the ncs_cli failed to connect to server. NCS didn't start because of this:

Bad configuration: /home/nso/nso-6.0/ncs.conf:0: Cannot open ./logs/ncserr.log.1 for writing, defined for /ncs-config/logs/error-log/filename
Daemon died status=21

 

That's why I'm asking if the logs directory exists.