cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
198
Views
3
Helpful
0
Comments
Pannag Desai
Cisco Employee
Cisco Employee

Why Docker Volumes with Containerized NSO

  • Reliable way of storing data from containerized NSO.
  • Paths can easily be shared by other containers.
  • Faster performance due to localised I/O on Docker VM.

Working your way up to setup Containerized NSO

  1. Setup Docker volumes for NSO runtime:docker volume create run, optionally you can create volume for logging or you can choose to make it bind mounted on your host machine.
  2. Load Containerized NSO images:
    docker load -i nso-<version>.container-image-<prod/build>.linux.<arm64/x86_64>.tar.gz*
  3. Create Containers from the loaded images, with packages directory bind mounted on your host machine. This will be accessed by build container as well, where it can be used to build, compile packages in same path as available on production container:
    • docker run -itd --name nso-prod -v <run-volume-name>:/nso [-v <logging-volume>:/log] -v <path to packages/packages>:/nso/run/packages <cisco-nso-prod-image>:<tag>
    • docker run -itd --name nso-build -v <path to packages/packages>:/nso/run/packages <cisco-nso-build-image>:<tag> 

* Note that you can also use Dockerfile to add more tools/packages to your images and build atop the Cisco images if there are specific requirements. This image can then be used to load and run NSO containers for your actual use.

Self-Evaluation Project With Migration Assistance

We have hosted a simple introductory project on NSO Developer's GitHub to help you gain insights on how to migrate your environment from say standalone NSO to Containerized NSO using Docker compose as described below.

Basic Architecture

architecture.png

System comprises of single instance deployment with two Docker volumes each for run and logging along with bind mounts for package directory

In this example, our NSO setup contains four important Docker appliances:

  • nso-prod : A production Container with running NSO instance. It has bind mount with packages directory on host.

  • nso-dev : It is of type Development, hence is only used to develop service packages and build them. It has bind mount to same packages directory that nso-prod shares.

  • run: It is a Docker volume that contains NSO running directory which is usually found under /nso/ in a typical production containerized NSO image file structure.

  • logging: A dedicated Docker volume shared by both nso-prod and nso-dev that maps to /log inside Container. Since this is also a probable I/O intensive operation, it has been used with volume.

Running the demonstration

Ensure that you are running Docker engine and associated service.

Clone the repo and enter into the repo folder on your system.

In the directory images, store the NSO Docker images of both production and development types available from Cisco software download center of your desired NSO version. Please note that production and development images should be of same NSO version.

Run make build [VER=<NSO version> (6.4.3 is default)] [ARCH=<your CPU architecture> (arm64 is default)], you will see following output generated and this takes a while to process:

% make build
docker volume create run
run
docker volume create logging
logging
rm ./nso/run/cdb/compact.lock
rm: ./nso/run/cdb/compact.lock: No such file or directory
make: [build] Error 1 (ignored)
docker container create --name dummy -v run:/nso hello-world
d2d9274ff6b4931cffe251474402be5526b8d04023451d4fe3ab50d4430c9e65
docker cp ./nso dummy:/
Successfully copied 4.45MB to dummy:/

..... truncated for brevity

The build target starts with loading Docker images, creates volumes dummy container to copy files from host.

After it's done, run make start_compose

% make start_compose
VER="6.4.3" docker-compose up BUILD PROD -d
[+] Running 2/2
 ✔ Container nso-build  Started      0.2s 
 ✔ Container nso-prod   Started      0.2s 
 ........

This will attempt to start both containers with necessary storage requirements and automatically building packages at startup of nso-dev.

Environment setup is completed successfully, you can verify by logging into the nso-prod and check if NSO instance is running with all the migrated data.

Use cli-c to connect to nso-prod C-style NSO terminal directly from host:

make cli-c

Use cli-j to connect to nso-prod J-style NSO terminal directly from host:

make cli-j

To stop and clean the compose service:

make stop_compose

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: