cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
941
Views
15
Helpful
9
Replies

Moving from Local to NID (NSO in Docker) base installation

jeyriku
Level 1
Level 1

Hi Team !

This topic aims to evolve along the time as well as along the issues and success i meet during this journey which covers how to move from a Local installation of NSO to a NID (NSO in Docker) installation.

I was able to create a docker instance of NSO using the great article :

https://developer.cisco.com/codeexchange/github/repo/NSO-developer/nso-docker

 

Still, i met some issues to access the nso webui but @u.avsec helped to fix it in this thread :

https://community.cisco.com/t5/nso-developer-hub-discussions/nso-docker/m-p/4603240#M7004

 

The idea here is to gather also the required steps to successfully achieve a Docker installation of NSO which includes all the packages & NEDS of a previous "baremetal" local installation.

 

Thanks a lot in advance for your incoming inputs !

 

Have a great day !

 

Jerems

 

2 Accepted Solutions

Accepted Solutions

Once NSO is shut down, copy over CDB dir and /packages dir. If you have anything fancy in ncs.conf coput that over too. That should be mostly it.

To "migrate" the CDB just paste the CDB files into the target container /cdb dir (make sure nothing is there beforehand).

View solution in original post

Hi @u.avsec ,

 

As you advised me here is what i performed :

 

docker run -itd --name nsojey -v /data/nso:/nso -v /data/nso-logs:/log -v /home/jeyriku/ncs_5.5.3/ncs-run/packages:/nso/run/packages/ -v /home/jeyriku/ncs_5.5.3/ncs-run/nso-jeyriku-instance/ncs-cdb:/nso/run/cdb -p 82:80 -p 4443:443 -p 8082:8080 -p 0.0.0.0:222:22 -e SSH_PORT=2024 -e HTTP_ENABLE=true -e HTTPS_ENABLE=true -e PAM=true -e ADMIN_PASSWORD=cisco cisco-nso-base:5.5.3

I have binded both folders :

 

/home/jeyriku/ncs_5.5.3/ncs-run/packages >>>> /nso/run/packages/

/home/jeyriku/ncs_5.5.3/ncs-run/nso-jeyriku-instance/ncs-cdb >>>> /nso/run/cdb

 

And it works ! i was able to recover the content of the CDB as well as all devices !

 

Thank you so much for your help !

 

Jerems

View solution in original post

9 Replies 9

jeyriku
Level 1
Level 1

Here are the components i rely on :

Ubuntu Workstation Intel i3 + 32Go RAM.

Local instance of NSO composed of different packages and Neds.

Docker instance of NSO :

 

Docker PS:

docker_ps_20220503_0947.png

 

Docker Images:

docker_images_20220503_0949.png

Looking at the previous screenshot, you can see that not only nso is "Dockered".

My final goal is to make some virtual devices instantiated in ContainerLab to be inventoried into NSO.

 

Jerems !

The installation process of the Docker Instance is pretty straight forward although i met some few hitches.

 

However, i'm now facing an authentication issue when passing this Docker Run command from my CLI :

 

docker run -itd --name nsojey -v /data/nso:/nso -v /data/nso-logs:/log -p 82:80 -p 4443:443 -p 8082:8080 -p 0.0.0.0:222:22 -e SSH_PORT=2024 -e HTTP_ENABLE=true -e ADMIN_PASSWORD=cisco cisco-nso-base:5.5

Authentication Failed :

 

Nso_Authentication_Failed.png

I relied on this part of the article :

 

 

Admin_user.png

Thanks in advance for your help !

 

Jerems

Found it by myself !

 

As i was trying to connect using the admin account i finally realized that the Docker Base install is somehow similar to a system install.

 

docker run -itd --name nsojey -v /data/nso:/nso -v /data/nso-logs:/log -p 82:80 -p 4443:443 -p 8082:8080 -p 0.0.0.0:222:22 -e SSH_PORT=2024 -e HTTP_ENABLE=true -e HTTPS_ENABLE=true -e PAM=true -e ADMIN_PASSWORD=cisco cisco-nso-base:5.5.3

Actually, because of having used the PAM option, it means that NSO will rely on container's system account to accomplish Authentication processes. Meaning that if i want to authenticate to NSO using the only account that exists ont he container at the moment which is root, i have to set password to the root account and game is over !

I relied on the article below to find the solution :

 

PAM.png

Then :

Root_connect_attempt.png

And :

Root_connect_succeeded.png

 

Jerems

Next step, recover all datas including packages and NEd from my previous baremetal local instance of NSO.

If some of you have some drivers or inputs for that purpose, i will be very happy to hear from you !

 

Jerems

Once NSO is shut down, copy over CDB dir and /packages dir. If you have anything fancy in ncs.conf coput that over too. That should be mostly it.

To "migrate" the CDB just paste the CDB files into the target container /cdb dir (make sure nothing is there beforehand).

Hi @u.avsec,

 

Thanks again for your kind inputs !

I will give it a try this afternoon !

 

Cheers,

 

Jerems

Hi @u.avsec ,

 

As you advised me here is what i performed :

 

docker run -itd --name nsojey -v /data/nso:/nso -v /data/nso-logs:/log -v /home/jeyriku/ncs_5.5.3/ncs-run/packages:/nso/run/packages/ -v /home/jeyriku/ncs_5.5.3/ncs-run/nso-jeyriku-instance/ncs-cdb:/nso/run/cdb -p 82:80 -p 4443:443 -p 8082:8080 -p 0.0.0.0:222:22 -e SSH_PORT=2024 -e HTTP_ENABLE=true -e HTTPS_ENABLE=true -e PAM=true -e ADMIN_PASSWORD=cisco cisco-nso-base:5.5.3

I have binded both folders :

 

/home/jeyriku/ncs_5.5.3/ncs-run/packages >>>> /nso/run/packages/

/home/jeyriku/ncs_5.5.3/ncs-run/nso-jeyriku-instance/ncs-cdb >>>> /nso/run/cdb

 

And it works ! i was able to recover the content of the CDB as well as all devices !

 

Thank you so much for your help !

 

Jerems

Hi Team,

 

It looks like i am missing some dependancies to let pyang works correctly from docker. The pyang directory is missing in here :

Missing_pyang_directory.png

Whereas i have it in my previous "baremetal installation" :

Present_pyang_directory.png

I guess i have to edit the Dockerfile...

Feel free to comment if you have an idea.

 

Thanks in advance,

Jerems

I've tried to comment a line which is supposed to be deleted but it doesn't fix my issue :

 

Comment_line.png

Thanks in advance for your help !