Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Create a new NSO instance for Local Install.
Applies to Local Install.
One of the included scripts with an NSO installation is the ncs-setup
, which makes it very easy to create instances of NSO from a Local Install. You can look at the --help
or ncs-setup(1) in Manual Pages for more details, but the two options we need to know are:
--dest
defines the directory where you want to set up NSO. if the directory does not exist, it will be created.
--package
defines the NEDs that you want to have installed. You can specify this option multiple times.
NCS is the original name of the NSO product. Therefore, many of the commands and application features are prefaced with ncs
. You can think of NCS as another name for NSO.
To create an NSO instance:
Run the command to set up an NSO instance in the current directory with the IOS, NX-OS, IOS-XR and ASA NEDs. You only need one NED per platform that you want NSO to manage, even if you may have multiple versions in your installer neds
directory.
Use the name of the NED folder in ${NCS_DIR}/packages/neds
for the latest NED version that you have installed for the target platform. Use the tab key to complete the path, after you start typing (alternatively, copy and paste). Verify that the NED versions below match what is currently on the sandbox to avoid a syntax error. See the example below.
Check the nso-instance
directory. Notice that several new files and folders are created.
Following is a description of the important files and folders:
ncs.conf
is the NSO application configuration file, and is used to customize aspects of the NSO instance (for example, to change ports, enable/disable features, and so on.) See ncs.conf(5) in Manual Pages for information.
packages/
is the directory that has symlinks to the NEDs that we referenced in the --package
arguments at the time of setup. See NSO Packages in Development for more information.
logs/
is the directory that contains all the logs from NSO. This directory is useful for troubleshooting.
Start the NSO instance by navigating to the nso-instance
directory and typing the ncs
command. You must be situated in the nso-instance
directory each time you want to start or stop NSO. If you have multiple instances, you need to navigate to each one and use the ncs
command to start or stop each one.
Verify that NSO is running by using the ncs --status | grep status
command.
Add Netsim or lab devices using the command ncs-netsim -h
.
Run and interact with practice examples provided with the NSO installer.
Applies to Local Install.
This section provides an overview of how to run the examples provided with the NSO installer. By working through the examples, the reader should get a good overview of the various aspects of NSO and hands-on experience from interacting with it.
This section references the examples located in $NCS_DIR/examples.ncs
. The examples all have README
files that include instructions related to the example.
Make sure that NSO is installed with a Local Install according to the instructions in Local Install.
Source the ncsrc
file in the NSO installation directory to set up a local environment. For example:
Proceed to the example directory:
Follow the instructions in the README
files that are located in the example directories.
Every example directory is a complete NSO run-time directory. The README file and the detailed instructions later in this guide show how to generate a simulated network and NSO configuration for running the specific examples. Basically, the following steps are done:
Create a simulated network using the ncs-netsim --create-network
command:
This creates 3 Cisco IOS devices called ios0
, ios1
, and ios2
.
Create an NSO run-time environment using the ncs-setup
command:
This command uses the --dest
option to create local directories for logs, database files, and the NSO configuration file to the current directory (note that .
refers to the current directory).
Start NCS netsim:
Start NSO:
It is important to make sure that you stop ncs
and ncs-netsim
when moving between examples using the stop
option of the netsim
and the --stop
option of the ncs
.
Some of the most common mistakes are:
Enable your NSO instance for development purposes.
Applies to Local Install
If you intend to use your NSO instance for development purposes, enable the development mode using the command license smart development enable
.
Remove Local Install.
Applies to Local Install.
To uninstall Local Install, simply delete the Install Directory.
Start and stop the NSO daemon.
Applies to Local Install.
The command ncs -h
shows various options when starting NSO. By default, NSO starts in the background without an associated terminal. It is recommended to add NSO to the /etc/init
scripts of the deployment hosts. For more information, see the in Manual Pages.
Whenever you start (or reload) the NSO daemon, it reads its configuration from ./ncs.conf
or ${NCS_DIR}/etc/ncs/ncs.conf
or from the file specified with the -c
option. Parts of the configuration can also be placed in the ncs.conf.d
directory that must be placed next to the actual ncs.conf
file.
Alter your examples to work with System Install.
Applies to System Install.
Since all the NSO examples and README steps that come with the installer are primarily aimed at Local Install, you need to modify them to run them on a System Install.
To work with the System Install structure, this may require a little or bigger modification depending on the example.
For example, to port the example.ncs/development-guide/nano-services/basic-vrouter
example to the System Install structure:
Make the following changes to the basic-vrouter/ncs.conf
file:
Copy the Local Install $NCS_DIR/var/ncs/cdb/aaa_init.xml
file to the basic-vrouter/
folder.
Other, more complex examples may require more ncs.conf
file changes or require a copy of the Local Install default $NCS_DIR/etc/ncs/ncs.conf
file together with the modification described above, or require the Local Install tool $NCS_DIR/bin/ncs-setup
to be installed, as the ncs-setup
command is usually not useful with a System Install. See for more information.
Explore NSO contents after finishing the installation.
Applies to Local Install.
Before starting NSO, it is recommended to explore the installation contents.
Navigate to the newly created Installation Directory, for example:
The installation directory includes the following contents:
Along with the binaries, NSO installs a full set of documentation available in the doc/
folder in the Installation Directory. There is also an online version of the documentation available from .
Run index.html
in your browser to explore further.
Local Install comes with a rich set of examples to start using NSO.
In order to communicate with the network, NSO uses NEDs as device drivers for different device types. Cisco has NEDs for hundreds of different devices available for customers, and several are included in the installer in the /packages/neds
directory.
In the example below, NEDs for Cisco ASA, IOS, IOS XR, and NX-OS are shown. Also included are NEDs for other vendors including Juniper JunOS, A10, ALU, and Dell.
The example NEDs included in the installer are intended for evaluation, demonstration, and use with the examples.ncs
. These are not the latest versions available and often do not have all the features available in production NEDs.
Like the NSO installer, the NEDs are signed.bin
files that need to be run to validate the download and extract the new code.
To install new NEDs:
Change to the working directory where your downloads are. The filenames indicate which version of NSO the NEDs are pre-compiled for (in this case NSO 6.0), and the version of the NED. An example output is shown below.
Use the sh
command to run signed.bin
to verify the certificate and extract the NED tar.gz and other files. Repeat for all files. An example output is shown below.
You now have three tar (.tar.gz
) files. These are compressed versions of the NEDs. List the files to verify as shown in the example below.
Navigate to the packages/neds
directory for your Local Install, for example:
In the /packages/neds
directory, extract the .tar files into this directory using the tar
command with the path to where the compressed NED is located. An example is shown below.
Here is a sample list of the newer NEDs extracted along with the ones bundled with the installation:
The last thing to note is the files ncsrc
and ncsrc.tsch
. These are shell scripts for bash
and tsch
that set up your PATH and other environment variables for NSO. Depending on your shell, you need to source this file before starting NSO.
Convert your current Local Install setup to a System Install.
Applies to Local Install.
If you already have a Local Install with existing data that you would like to convert into a System Install, the following procedure allows you to do so. However, a reverse migration from System to Local Install is not supported.
It is possible to perform the migration and upgrade simultaneously to a newer NSO version, however, doing so introduces additional complexity. If you run into issues, first migrate, and then perform the upgrade.
The following procedure assumes that NSO is installed as described in the NSO Local Install process, and will perform an initial System Install of the same NSO version. After following these steps, consult the NSO System Install guide for additional steps that are required for a fully functional System Install.
The procedure also assumes you are using the $HOME/ncs-run
folder as the run directory. If this is not the case, modify the following path accordingly.
To migrate to System Install:
Stop the current (local) NSO instance, if it is running.
Take a complete backup of the Runtime Directory for potential disaster recovery.
Change to Super User privileges.
Start the NSO System Install.
If you have multiple versions of NSO installed, verify that the symbolic link in /opt/ncs
points to the correct version.
Copy the CDB files containing data to the central location.
Ensure that the /var/opt/ncs/packages
directory includes all the necessary packages, appropriate for the NSO version. However, copying the packages directly could later on interfere with the operation of the nct
command. It is better to only use symbolic links in that folder. Instead, copy the existing packages to the /opt/ncs/packages
directory, either as directories or as tarball files. Make sure that each package includes the NSO version in its name and is not just a symlink, for example:
Link to these packages in the /var/opt/ncs/packages
directory.
The reason for prepending ncs-VERSION
to the filename is to allow additional NSO commands, such as nct upgrade
and software packages
to work properly. These commands need to identify which NSO version a package was compiled for.
Edit the /etc/ncs/ncs.conf
configuration file and make the necessary changes. If you wish to use the configuration from Local Install, disable the local authentication, unless you fully understand its security implications.
When starting NSO at boot using systemd
, make sure that you set the package reload option from the /etc/ncs/ncs.systemd.conf
environment file to true
. Or, for example, set NCS_RELOAD_PACKAGES=true
before starting NSO if using the ncs
command.
Review and complete the steps in NSO System Install, except running the installer, which you have done already. Once completed, you should have a running NSO instance with data from the Local Install.
Remove the package reload option if it was set.
Update log file paths for Java and Python VM through the NSO CLI.
Verify that everything is working correctly.
At this point, you should have a complete copy of the previous Local Install running as a System Install. Should the migration fail at some point and you want to back out of it, the Local Install was not changed and you can easily go back to using it as before.
In the unlikely event of Local Install becoming corrupted, you can restore it from the backup.
A large number of pre-built supported NEDs are available which can be acquired and downloaded by the customers from . Note that the specific file names and versions that you download may be different from the ones in this guide. Therefore, remember to update the paths accordingly.
For more information on sourcing shell script, see the .
Remove System Install.
Applies to System Install.
NSO can be uninstalled using the ncs-installer(1) option only if NSO is installed with --system-install
option. Either part of the static files or the full installation can be removed using ncs-uninstall
option. Ensure to stop NSO before uninstalling.
Executing the above command removes the Installation Directory /opt/ncs
including symbolic links, Configuration Directory /etc/ncs
, Run Directory /var/opt/ncs
, Log Directory /var/log/ncs
, systemd
service file /etc/systemd/system/ncs.service
, systemd
environment file /etc/ncs/ncs.systemd.conf
, and user profile scripts from /etc/profile.d
.
To make sure that no license entitlements are consumed after you have uninstalled NSO, be sure to perform the deregister
command in the CLI: