cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
2163
Views
5
Helpful
9
Replies

NSO not able to find netsim created devices

jaswant6068
Level 1
Level 1

I have devices created using netsim ios0 and ios1 successfully and was able to start them.

However when I tried to sync from these devices, it seems like ncs is not able to find the devices. 

 

gag@Jas:~/ncs-run$ ncs-netsim start
DEVICE ios0 OK STARTED
DEVICE ios1 OK STARTED
gag@Jas:~/ncs-run$ ncs
gag@Jas:~/ncs-run$ ncs_cli -u admin -C

admin connected from 127.0.0.1 using console on Jaswant-Singh
admin@ncs# show devices
ID NAME REVISION NAMESPACE
-------------------------------------------------------------------------
lsa-netconf
netconf
snmp
cisco-ios-cli-3.0 tailf-ned-cisco-ios 2014-02-12 urn:ios
tailf-ned-cisco-ios-stats - urn:ios-stats

 

admin@ncs# devices sync-from
admin@ncs# devices device ios0 check-sync
--------------------------^
syntax error: element does not exist
admin@ncs#

 

Getting error when I tried to check sync status for the devices.

9 Replies 9

vleijon
Cisco Employee
Cisco Employee
You have to explicitly add the devices to nso. There are a few ways of doing this, if you create your netsims before running ncs-setup you can use the --netsim-dir option to ncs-setup, or you can use ncs-netsim ncs-xml-init > init.xml and then load merge init.xml in ncs_cli (which is what I usually do).

nisheeth
Level 1
Level 1

Hi

I had created the 4 devices using the netsim 

ncs-netsim create-network ./packages/neds/cisco-nx-cli-3.0 3 device --dir ./netsim

ncs-netsim add-to-network ./packages/neds/cisco-ios-cli-3.0 1 device --dir ./netsim

Cannot view any devices from the webui and read your note and followed the steps below

I exported the netsim using the command ncs-netsim ncs-xml-init > netsim.xml

Then tried to load the same file using ncs_load with -m option and that failed at the ned id

ubuntu@nsovm:~/ncs-6.1$ ncs_load -lm netsim.xml
ncs_load: 645: maapi_load_config(sock, tid, flags, abspath(argv[0])) failed: external error (19): Error on line 26: invalid value for: ned-id in /ncs:devices/ncs:device[ncs:name='device0']/ncs:device-type/ncs:cli/ncs:ned-id: "id:cisco-nx-cli-3.0" is not a valid value.

ubuntu@nsovm:~/ncs-6.1$

 

The issue is NSO does not have these NEDs loaded.

You need to take the NEDs from packages/neds and copy them into the packages directory where you started your NSO. Then do a package reload to ensure the NEDs are running in your NSO instance.

I see though, you are using the NEDs that are delivered with the NSO installation. Beware these are actually not the official NEDs but are shrunk down versions that are delivered to run with the examples that are shipped with NSO.

Also I see you I see this
ncs-netsim create-network ./packages/neds/cisco-nx-cli-3.0 3

which means your current directory is the same directory as where you installed NSO. It is generally bad proactice to make changes inside the NSO installation, I would go to a separate directory and do ncs-setup there and put the netsin directory there as well.

Hi

I have followed the steps, this is what I used

I am using netsim to create the devices

The path for neds are ./packages/neds/cisco-ios-cli-3.0 1 so the netsim has build them correctly and the netsim shows that.

The issue is I don't see neds either in ncs_cli or webui . I see the default packages and not the cisco neds due to that due to that I don't see the devices in webui as what is shown by netsim

Using ncs_cli -C -u admin I cannot update the configuration like





ubuntu@nsovm:~/ncs-6.1$ ncs-netsim create-network ./packages/neds/cisco-ios-cli-3.0 1 device --dir ./netsim

ubuntu@nsovm:~/ncs-6.1$ ncs-netsim add-to-network ./packages/neds/cisco-ios-cli-3.0 1 device --dir ./netsim

ubuntu@nsovm:~/ncs-6.1$ ncs-netsim list

ncs-netsim list for /home/ubuntu/ncs-6.1/netsim



name=device0 netconf=12022 snmp=11022 ipc=5010 cli=10022 dir=/home/ubuntu/ncs-6.1/netsim/device/device0

name=device1 netconf=12023 snmp=11023 ipc=5011 cli=10023 dir=/home/ubuntu/ncs-6.1/netsim/device/device1

name=device2 netconf=12024 snmp=11024 ipc=5012 cli=10024 dir=/home/ubuntu/ncs-6.1/netsim/device/device2

name=device3 netconf=12025 snmp=11025 ipc=5013 cli=10025 dir=/home/ubuntu/ncs-6.1/netsim/device/device3

ubuntu@nsovm:~/ncs-6.1$ ncs-netsim packages

/home/ubuntu/ncs-6.1/packages/neds/cisco-nx-cli-3.0

/home/ubuntu/ncs-6.1/packages/neds/cisco-ios-cli-3.0

ubuntu@nsovm:~/ncs-6.1$

admin@ncs# show devices ned-ids

ID NAME REVISION NAMESPACE

----------------------------------------

lsa-netconf

netconf

snmp

I cannot update ios because it shows only three types of ned as mentioned above and because it doesn't have ned-id ios



admin@ncs#

admin@ncs# config

devices device device0

address 127.0.0.1 port 10025

device-type cli ned-id cisco-ios protocol ssh

authgroup default

state admin-state unlocked

commit

ssh fetch-host-keys

sync-from

end



do Thanks

Nisheeth

huayyang
Cisco Employee
Cisco Employee

Please check the document how to add a NED package https://developer.cisco.com/docs/nso-guides-6.1/#!administration/packages

nisheeth
Level 1
Level 1

Hi

I followed all the steps as mentioned and what i realize that the nso reads the packages from ~/$NCS_DIR/etc/ncs/nso.conf 

As per the ncs.conf it reads the packages described in ~/$NCS_DIR/etc/ncs/ and it has the directory snmp, ssh and ssl

The snmp has fxs files whcih cdb understand. 

So i want to know how ic an create the same information for ios, nx and iosxr

 

I have compiled the packages too and  the neds-id are not getting it is not getting updated in the ~/$NSC_DR/ncs and ncs.conf therefore it doesnt show up in ncs_cli

admin@ncs# show devices ned-ids
ID NAME REVISION NAMESPACE
----------------------------------------
lsa-netconf
netconf
snmp

admin@ncs#

need to know what are the additional steps to be done

huayyang
Cisco Employee
Cisco Employee

NCS_DIR is the installation directory, you can create a "packages" directory in $NCS_DIR/etc/ncs and put your NEDs there, but you probably want to put your NEDs in the packages directory under "run directory"($NCS_RUN_DIR/packages, which is /var/opt/ncs/packages by default), so you don't need to copy the packages between different NSO installations.

Jesus Illescas
Cisco Employee
Cisco Employee

If you are starting with NSO and netsim, take a look at this Interactive Learning Lab that uses NSO in local install mode, where using netsim and ncs-setup we created an environment to experiment with NSO. You can play directly with the container to see what the environment variables are set to.

https://developer.cisco.com/learning/labs/learn-nso-with-netsim/introduction/