01-31-2020 11:37 AM
Hi guys and gals,
I'm a first time NSO and user and am following the README files in the `examples.ncs/getting-started/` folders.
I've started a very basic lab and, as per the instructions, started NSO but I'm not showing any devices as being managed:
user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs-netsim create-network /home/user/nso-5.3/packages/neds/cisco-ios-cli-3.8 3 c DEVICE c0 CREATED DEVICE c1 CREATED DEVICE c2 CREATED user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs-setup --netsim-dir ./netsim --dest . Using netsim dir ./netsim user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs_cli -u admin admin connected from ********* using ssh on user-virtual-machine admin@ncs> show packages packages package cisco-ios-cli-3.0 package-version 3.0.0.4 description "NED package for Cisco IOS" ncs-min-version [ 3.0.2 ] directory ./state/packages-in-use/1/cisco-ios-cli-3.0 component upgrade-ned-id upgrade java-class-name com.tailf.packages.ned.ios.UpgradeNedId component cisco-ios ned cli ned-id cisco-ios-cli-3.0 ned cli java-class-name com.tailf.packages.ned.ios.IOSNedCli ned device vendor Cisco NAME VALUE --------------------- show-tag interface build-info date "2019-11-29 11:17:04" build-info file cisco-ios-cli-3.0-source-3.0.0.4.tar.gz build-info arch .darwin.x86_64 build-info java "compiled Java class data, version 50.0 (Java 1.6)" build-info package name cisco-ios-cli-3.0 build-info package version 3.0.0.4 build-info package ref 3.0.0.4 build-info package sha1 This_Is_An_Example_NED build-info ncs version 5.3_HEAD build-info ncs sha1 This_NED_should_not_be_used oper-status java-uninitialized [ok][2020-01-31 19:26:56] admin@ncs> show configuration devices device No entries found. [ok][2020-01-31 19:27:03] admin@ncs>
Now the whole This_NED_should_not_be_used line is a bit of a red flag to me. Based on what I've read on other forums, the NED isn't supported for this version? Is that right?
If that is the problem... the logical next question is how I get my hands on the ones that enable me to run through the tutorials and learn the system.
If it isn't the problem, does anyone know that the problem could be?
Thanks in advance and apologies if I'm asking this in the wrong forum. I'm new to this tech but keen to get my teeth stuck in.
Cheers,
Steve
Solved! Go to Solution.
02-02-2020 11:22 AM
So, there are a few things that are a little bit finicky in this example - the main one being that it is not obvious when ncs-setup will automatically pickup the netsim information, the example seems to work okay for me when I run through it. Unfortunately, it can be a little bit tricky recovering in this situation. Fear not, @Jason Belk is working on making better tutorials to get into NSO so this'll be better soon I hope.
Hopefully, if you start over with an empty directory and no ncs or netsim running it'll be smoother. One of the good things about NSO is that you can just create a new directory and start over (just stop netsim and ncs first).
Regardless of that, I think it is more instructive to not use ncs_load (it is a great tool, but it is not ideal for learning). The error message you get is a little opaque but it complains about there not being an authgroup, an authgroup is an "authorization group" it tells NSO how to connect to a device.
As for your data question, the initial data for a netsim device is just sample data that is put in there, if you look at netsim/c/c0/cdb/ios.xml that is the xml file that is automatically loaded when a netsim is started.
The file devices.xml is onboarding information, telling nso what types of devices they are, what their addresses are and which authgroups to use for them. In this case, all very primitive information, but do look through the file it is fairly understandable.
When running the experiment at the ncs-setup stage it should generate the file ncs-cdb/netsim_devices_init.xml that is equivalent to that devices.xml and which should contain relevant information.
Hopefully this helps!
02-02-2020 12:23 AM
Hi,
The NEDs shipped with NSO are intended to be used along with the example shipped with NSO.
They are perfectly good for that, and the examples are built around them.
Having said that, they are not intended to be used towards real devices.
For the issue you're facing...
Creating the netsim devices, only creates the process that NSO can later connects to. You'd then need to tell NSO how to connect to the netsim devices.
You can do it manually, but netsim also provides you a shortcut for that.
You can find an example in the NSO user guide under section "Using Netsim".
In short, navigate to the directory where you ran the netsim commands, and while NSO and the netsim devices are up, do the following:
ncs-netsim ncs-xml-init > devices.xml ncs_load -l -m devices.xml
The first command generates an XML configurations that can be used in order to onboard the netsim devices.
The second one loads those configs to NSO.
Once you did that, you should be able to see the devices in NSO.
If this is not working, trying following the example on the user guide (you should have all documentation under the NSO installation directory).
02-02-2020 05:30 AM - edited 02-02-2020 06:40 AM
Hi there,
Thanks for the response. I quickly did what you suggested and I get the below error message:
user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs-netsim create-network /home/user/nso-5.3/packages/neds/cisco-ios-cli-3.8 3 c DEVICE c0 CREATED DEVICE c1 CREATED DEVICE c2 CREATED user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs-netsim start DEVICE c0 OK STARTED DEVICE c1 OK STARTED DEVICE c2 OK STARTED user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs-setup --netsim-dir ./netsim --dest . Using netsim dir ./netsim user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs-netsim ncs-xml-init > devices.xml user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ls devices.xml ncs-cdb ncs-java-vm.log netsim README README.netsim state logs ncs.conf ncs-python-vm.log packages README.ncs scripts user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs_load -l -m devices.xml ncs_load: 638: maapi_apply_trans_flags(sock, tid, 0, aflags) failed: bad keyref (14): illegal reference /ncs:devices/device{c0}/authgroup
user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs_cli -u admin admin connected from ************* using ssh on user-virtual-machine admin@ncs> show configuration devices device No entries found. [ok][2020-02-02 13:13:50] admin@ncs>
I will read through the using netsim today and report back but if the error is something obvious that I can quickly fix then let me know. Thanks again :)
-Steve
02-02-2020 07:13 AM - edited 02-02-2020 07:29 AM
OK so I've read the using netsim section at the end of the user guide but unfortunately I'm still stuck.
I'm following the getting started guide to the letter and having to do this level of troubleshooting for a beginner tough.
So this devices.xml is what exactly? An xml formatted 'show run' of the configured devices?
If I log into these devices I can get the following:
user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs-netsim cli-i c0 admin connected from *********** using ssh on user-virtual-machine c0> enable c0# show running-config | include neighbor neighbor 1.2.3.4 remote-as 1 neighbor 1.2.3.4 ebgp-multihop 3 neighbor 2.3.4.5 remote-as 1 neighbor 2.3.4.5 activate neighbor 2.3.4.5 capability orf prefix-list both neighbor 2.3.4.5 weight 300 c0#
Where did these neighbor IPs come from? How is the topology connected? Or is this randomly generated config?
The xml file can't be a formatted output of 'show run' since the neighbor IPs are not in the xml.
user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ cat devices.xml | grep 1.2.3.4 user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$
So I'm struggling to understand the concept here... I create a simulated network (using `ncs-netsim create-network $NCS_DIR/packages/neds/cisco-ios-cli-3.0 3 c`). The config for these devices is, auto-generated? And the xml isn't the config but something else?
I then try to start ncs, but it can't read the config because the auth group is invalid? My understanding was that YAML based models dictate the format of the client devices... but I'm not sure where to find these YAML files?
If I delete the <authgroup>default</authgroup> section I get the following message:
user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ ncs_load -l -m devices.xml user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$ 41): /ncs:devices/device{c0}/device-type/cli : A CLI device must have a authgroup. user@user-virtual-machine:~/nso-5.3/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios$
Can anyone help with this?
02-02-2020 11:22 AM
So, there are a few things that are a little bit finicky in this example - the main one being that it is not obvious when ncs-setup will automatically pickup the netsim information, the example seems to work okay for me when I run through it. Unfortunately, it can be a little bit tricky recovering in this situation. Fear not, @Jason Belk is working on making better tutorials to get into NSO so this'll be better soon I hope.
Hopefully, if you start over with an empty directory and no ncs or netsim running it'll be smoother. One of the good things about NSO is that you can just create a new directory and start over (just stop netsim and ncs first).
Regardless of that, I think it is more instructive to not use ncs_load (it is a great tool, but it is not ideal for learning). The error message you get is a little opaque but it complains about there not being an authgroup, an authgroup is an "authorization group" it tells NSO how to connect to a device.
As for your data question, the initial data for a netsim device is just sample data that is put in there, if you look at netsim/c/c0/cdb/ios.xml that is the xml file that is automatically loaded when a netsim is started.
The file devices.xml is onboarding information, telling nso what types of devices they are, what their addresses are and which authgroups to use for them. In this case, all very primitive information, but do look through the file it is fairly understandable.
When running the experiment at the ncs-setup stage it should generate the file ncs-cdb/netsim_devices_init.xml that is equivalent to that devices.xml and which should contain relevant information.
Hopefully this helps!
02-03-2020 06:16 AM
Hey,
Thanks for the response. :) I set ncs and net-sim in a new folder and it appears to have worked! Not sure what the issue was with previous folder though. The exact commands I entered are shown below for anyone interested:
user@user-virtual-machine:~/ncs-run$ user@user-virtual-machine:~/ncs-run$ cd .. user@user-virtual-machine:~$ mkdir ncs-run2 user@user-virtual-machine:~$ cd ncs-run2 user@user-virtual-machine:~/ncs-run2$ ncs-netsim create-network $NCS_DIR/packages/neds/cisco-ios-cli-3.0 3 c DEVICE c0 CREATED DEVICE c1 CREATED DEVICE c2 CREATED user@user-virtual-machine:~/ncs-run2$ ncs-setup --netsim-dir ./netsim --dest . Using netsim dir ./netsim user@user-virtual-machine:~/ncs-run2$ ls -a . .. logs ncs-cdb ncs.conf netsim packages README.ncs README.netsim scripts state user@user-virtual-machine:~/ncs-run2$ ls ncs-cdb netsim_devices_init.xml user@user-virtual-machine:~/ncs-run2$ ncs user@user-virtual-machine:~/ncs-run2$ ncs_cli -u admin admin connected from ********* using ssh on user-virtual-machine admin@ncs> show configuration devices device device c0 { address 127.0.0.1; port 10022; ssh { host-key ssh-rsa { key-data "AAAAB3NzaC1yc2EAAAADAQABAAA...npXEnmXecontp"; } } authgroup default; device-type { cli { ned-id cisco-ios-cli-3.0; } } state { <snip> admin@ncs>
I'll keep working through the example and see how I far I get. Interestingly though, I just tried to use `request devices connect` and got connection refused. This was because I hadn't started the netsim devices. I did so and it all seems to be working now but maybe me starting ncs before the running `ncs-netsim start` had something to do with it? I'll have a play and see what I can find out.
Thanks again @vleijon and @yfherzog for the help. Much appreciated.
02-03-2020 09:54 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide