
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2017 02:42 AM - edited 03-01-2019 04:03 AM
Hi Team, I'm looking at guidelines or any documentation to have NSO running into a Docker, especially how to manage CDB with respect to the underneath host filesystem.
Thanks,
Marco.
Solved! Go to Solution.
- Labels:
-
Other NSO Topics
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2018 11:46 AM
I've started to look into how to run NSO in Docker/K8s and there are a few things to consider.
Run NSO in the foreground to get logs to stdout
Mount either the entire project as a persistent volume or just the ncs-cdb and state directories.
You could argue that the logs directory should be persistent, OTOH if you capture logs from stdout already you may no need that.
If you use k8s, it's good practice to specify limits and requests as well as specifying a readinessProbe and a livenessProbe.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2018 12:57 PM
I don't think there is any official NSO documentation regarding Docker.
-Dan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2018 11:46 AM
I've started to look into how to run NSO in Docker/K8s and there are a few things to consider.
Run NSO in the foreground to get logs to stdout
Mount either the entire project as a persistent volume or just the ncs-cdb and state directories.
You could argue that the logs directory should be persistent, OTOH if you capture logs from stdout already you may no need that.
If you use k8s, it's good practice to specify limits and requests as well as specifying a readinessProbe and a livenessProbe.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2018 05:55 AM
I've been running NSO in docker for some time now but have recently (in version 4.5.3) run into an issue where including cisco-ios package causes package loading to hang indefinitely. show packages package oper-status shows the java vm uninitialized. Have you run into this issue?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2018 08:12 AM
No, we haven’t, we are not using cisco-ios package, we are developing a generic ned based on corba.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2018 05:40 AM
My first attempt was - for small packages this works, however for cisco-ios the fetch package command closes with a timeout.
echo "request software packages fetch package-from-file /tmp/vendor45/$file" | ncs_cli -u admin --noaaa
echo "request software packages install allow-version-mismatch replace-existing package $file" | ncs_cli -u admin --noaaa
So I use the dockerfile to get every package loaded except cisco-ios and do the above commands interactively - which works.
Then if I do request packages reload or /etc/init.d/ncs stop /etc/init.d/ncs restart-with-package reload I get to the following.
Bad configuration: /etc/ncs/ncs.conf:0: "/var/ncs/nso-4.4.x/state/packages-in-use.cur: Failed to rename to /var/ncs/nso-4.4.x/state/packages-in-use.old: cross-domain link"
Bad configuration: /etc/ncs/ncs.conf:0: "/var/ncs/nso-4.4.x/state/packages-in-use.cur: Failed to rename to /var/ncs/nso-4.4.x/state/packages-in-use.old: cross-domain link"
Daemon died status=21
I'm new to Docker but this feels something I haven't understood done right.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2018 09:43 AM
If I'd used a persistent volume I might have not run into this issue. However I wanted to avoid persisting things as that makes more things to distribute.
It's nothing to do with the IOS ned - it just looked that way.
Summary.
- Package reloads fail, NCS packages - during a `request packages reload` or `/etc/init.d/ncs start-with-package-reload` NCS will move directories under `$NCS_RUN_DIR/state` and Docker throws cross-domain sym-link errors. Workaround is to manipulate packages without letting NCS do the reloads.
- `/etc/init.d/ncs stop`
- `tar xvfz /tmp/ncs-4.5.5.1-stockholm-0.0.7.tar.gz -C $NCS_RUN_DIR/state/packages-in-use.cur/1/`
- `/etc/init.d/ncs start`
- NCS commands piped in bash - if we do `echo 'request software ' | ncs_cli -u admin` with a big package get `*** CLOSE TIMEOUT ***` from ncs_cli. It's any command that takes a long time. This is what led me to install everything except cisco-ios, and this is why I was blaming the IOS package.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2018 09:27 AM
We have been running NCS inside Docker for the last two years, externally mounting volume for directories under /var/opt/ncs except the packages dir.
The hang CLI issue is related to a bug in 4.5. The work around is to add a sleep after the echo command:
bash -c "(echo -e 'your cli command here'; sleep 2) | /opt/ncs/current/bin/ncs_cli -u admin ..."

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2018 11:36 PM
Moving files directly into packages-in-use is not recommended. But you will have to have either an external mount with the files or make sure they are copied into the container in some other way.
Copying the packages into a local packages directory has worked well for me.
