README v1.6.26 2024-11-21
Table of contents
1. General
This document describes the viptela-vmanage NED.
Additional README files bundled with this NED package
Common NED Features
Verified target systems
1.1 Extract the NED package
It is assumed the NED package ncs-<NSO version>-viptela-vmanage-<NED version>.signed.bin
has already
been downloaded from software.cisco.com.
In this instruction the following example settings will be used:
NSO version: 6.0
NED version: 1.0.1
NED package downloaded to: /tmp/ned-package-store
Extract the NED package and verify its signature:
In case the signature can not be verified (for instance if no internet connection), do as below instead:
The result of the extraction shall be a tar.gz file with the same name as the .bin file:
1.2 Install the NED package
There are two alternative ways to install this NED package. Which one to use depends on how NSO itself is setup.
In the instructions below the following example settings will be used:
NSO version: 6.0
NED version: 1.0.1
NED download directory: /tmp/ned-package-store
NSO run time directory: ~/nso-lab-rundir
A prerequisite is to set the environment variable NSO_RUNDIR to point at the NSO run time directory:
1.2.1 Local install
This section describes how to install a NED package on a locally installed NSO (see "NSO Local Install" in the NSO Installation guide).
It is assumed the NED package has been been unpacked to a tar.gz file as described in 1.1.
Untar the tar.gz file. This creates a new sub-directory named:
viptela-vmanage-<NED major digit>.<NED minor digit>
:Install the NED into NSO, using the ncs-setup tool:
Open a NSO CLI session and load the new NED package like below:
Alternatively the tar.gz file can be installed directly into NSO. Then skip steps 1 and 2 and do like below instead:
1.2.2 System install
This section describes how to install a NED package on a system installed NSO (see "NSO System Install" in the NSO Installation Guide).
It is assumed the NED package has been been unpacked to a tar.gz file as described in 1.1.
Do a NSO backup before installing the new NED package:
Start a NSO CLI session and fetch the NED package:
Install the NED package (add the argument replace-existing if a previous version has been loaded):
Load the NED package
1.3 Configure the NED in NSO
This section describes the steps for configuring a device instance using the newly installed NED package.
Start a NSO CLI session:
Enter configuration mode:
Configure a new authentication group (my-group) to be used for this device:
Configure a new device instance (example: dev-1):
Finally commit the configuration
Verify configuration, using a sync-from.
If the sync-from was not successful, check the NED configuration again.
2. Optional debug and trace setup
It is often desirable to see details from when and how the NED interacts with the device(Example: troubleshooting)
This can be achieved by configuring NSO to generate a trace file for the NED. A trace file contains information about all interactions with the device. Messages sent and received as well as debug printouts, depending on the log level configured.
NSO creates one separate trace file for each device instance with tracing enabled. Stored in the following location:
$NSO_RUNDIR/logs/ned-viptela-vmanage-gen-1.0-<device name>.trace
Do as follows to enable tracing in one specific device instance in NSO:
Start a NSO CLI session:
Enter configuration mode:
Enable trace raw:
Alternatively, tracing can be enabled globally affecting all configured device instances:
Configure the log level for printouts to the trace file:
Alternatively the log level can be set globally affecting all configured device instances using this NED package.
The log level 'info' is used by default and the 'debug' level is the most verbose.
IMPORTANT: Tracing shall be used with caution. This feature does increase the number of IPC messages sent between the NED and NSO. In some cases this can affect the performance in NSO. Hence, tracing should normally be disabled in production systems.
An alternative method for generating printouts from the NED is to enable the Java logging mechanism. This makes the NED print log messages to common NSO Java log file.
$NSO_RUNDIR/logs/ncs-java-vm.log
Do as follows to enable Java logging in the NED
Start a NSO CLI session:
Enter configuration mode:
Enable Java logging with level all from the NED package:
Configure the NED to log to the Java logger
Alternatively Java logging can be enabled globally affecting all configured device instances using this NED package.
IMPORTANT: Java logging does not use any IPC messages sent to NSO. Consequently, NSO performance is not affected. However, all log printouts from all log enabled devices are saved in one single file. This means that the usability is limited. Typically single device use cases etc.
3. Dependencies
This NED has the following host environment dependencies:
Java 1.8 (NSO version < 6.2)
Java 17 (NSO version >= 6.2)
Gnu Sed
Dependencies for NED recompile:
Apache Ant
Bash
Gnu Sort
Gnu awk
Grep
Python3 (with packages: re, sys, getopt, subprocess, argparse, os, glob)
4. Sample device configuration
devices authgroups group demo-authgroup default-map remote-name admin default-map remote-password "admin123" ! devices device demo-vmanage address 10.10.10.10 port 443 authgroup demo-authgroup device-type generic ned-id viptela-vmanage-gen-1.7 state admin-state unlocked trace raw connect-timeout 90 read-timeout 90 write-timeout 90 ned-settings use-transaction-id false ned-settings viptela-vmanage connection ssl accept-any ned-settings viptela-vmanage connection api-base-url /dataservice ! java-vm java-logging logger com.tailf.packages.ned.vmanage level level-all !
5. Built in live-status actions
6. Built in live-status show
NONE
7. Limitations
NONE
8. How to report NED issues and feature requests
Issues like bugs and errors shall always be reported to the Cisco NSO NED team through the Cisco Support channel:
The following information is required for the Cisco NSO NED team to be able to investigate an issue:
Do as follows to gather the necessary information needed for your device, here named 'dev-1':
Enable full debug logging in the NED
Configure the NSO to generate a raw trace file from the NED
If the NED already had trace enabled, clear it in order to submit only relevant information
Do as follows for NSO 6.4 or newer:
Do as follows for older NSO versions:
Run a compare-config to populate the trace with initial device config
Reproduce the found issue using ncs_cli or your NSO service. Write down each necessary step in a reproduction report.
Gather the reproduction report and a copy of the raw trace file containing data recorded when the issue happened.
Contact the Cisco support and request to open a case. Provide the gathered files together with access details for a device that can be used by the Cisco NSO NED when investigating the issue.
Requests for new features and extensions of the NED are handled by the Cisco NSO NED team when applicable. Such requests shall also go through the Cisco support channel.
The following information is required for feature requests and extensions:
A detailed use case description, with details like:
Data of interest
The kind of operations to be used on the data. Like: 'read', 'create', 'update', 'delete' and the order of the operation
Device APIs involved in the operations (For example: REST URLs and payloads)
Device documentation describing the operations involved
Run sync-from # devices device dev-1 sync-from (if relevant)
Attach the raw trace to the ticket (if relevant)
Access to a device that can be used by the Cisco NSO NED team for testing and verification of the new feature. This usually means that both read and write permissions are required. Pseudo access via tools like Webex, Zoom etc is not acceptable. However, it is ok with access through VPNs, jump servers etc.
9. Additional NED features
This section describes in more detail some of the NED features/specific implementation/behavior details. Summary:
9.1 Administration - LicenseManagement
9.2 Administration - Settings - Statistics Settings
9.3 Feature templates/device templates/vars
9.4 Policies structure and organization (localized policy, centralized policy, security policy)
9.5 Localized policies: vedgeRoute and ACL lists sequence IDs
9.1 Administration - LicenseManagement
added in v1.6.14
This feature covers the 'vManage -> Administration -> License Management' configuration menu, which can be used to assign subscription licences to vManage devices/edges.
configuration
The NED will be configured with the CSSM account information through the following ned-settings:
The 'authentication' section can be skipped if the authentication is done through the vManage UI before the NED is configured; the accountName and virtualAccountName are mandatory though.
model entities
license tags: read-only list of the available licenses
license devices: read-only list of the available licenses
license templates: customizable entries that allow to associate a list of devices to a particular license tag; can be created or updated but cannot be deleted
behavior
when the feature is enabled, at sync-from, the NED will check if the vManage is authenticated with the CSSM service:
if the vManage is already authenticated with the CSSM service (via the GUI, or from a previous sync-from attempt), the NED will just fetch the current data from the vManage (license tags, license templates, devices status)
if it isn't, it will attempt to authenticate and sync the vManage device with the CSSM service using the provided username/password
two live-status actions can be used to re-authenticate or re-sync; the actions have no params, they use the ned-settings configuration:
# devices device vmanage live-status exec licensing_authenticate
# devices device vmanage live-status exec licensing_sync
limitations
a device uuid can only be present in a single license template at a time; in a use-case where a device has to be moved from a template to another, the move has to be done in two separate transactions (first removed from a template, then added to the next)
the licensing information is updated at a slow rate on the CSSM; the NED will not call the licenses sync (between the vManage and the CSSM service) at each NED sync-from for performance reasons
the vManage UI allows for multiple virtual accounts to be configured; the NED currently only supports one virtual account per configuration
9.2 Administration - Settings - Statistics Settings
added in v1.6.14
This feature covers the vManage -> Administration -> Settings -> Statistics setting
configuration in the vManage UI.
The corresponding configuration model can be found at this path:
A sync-from is required to populate the entries list, after which the settings can be changed:
the
devicelist
is available only when thestatus
value is 'custom'.when all the available devices are added in the
devicelist
, the vManage GUI will change thestatus
to 'disabled' (instead of custom + full devicelist). The NED cannot handle this behavior (even if it did - there would be compare-config diffs)each entry has a
displayName
leaf; these leaves are in the model to allow building the vManage request payloads, but they should be trated as read-only (should not be changed or deleted)
9.3 Feature templates/device templates/vars
Device templates
The feature templates are not active by themselves; they are being used through a device template (vManage -> Configuration -> Template -> Device
) which references multiple feature templates to obtain the full configuration.
The device templates are also active only when they are 'attached' to a vManage device (edge or controller), which is done by creating/updating/removing 'attached' list entries (in the YANG) below each template:
In this example, we have the template 'test-vsmart-template' attached to a device with uuid 'abcd-1234', together with a set of variable name/value pairs. The same template can be attached to multiple devices (create more 'attached ' entries) using a different set of variable values.
Attach/detach behavior
Creating a new 'attached' entry under a template triggers an attach request between the template and that device using the provided variables. The service must provide all the necessary variables, which are dependent on the device template and feature template contents.
Changing any of the vars, the device template contents, or any of the referenced feature templates would trigger an automatic 'reattach' for all the attached devices (which are unsing the modified templates/vars).
Deleting an 'attached' entry would detach the template from the device (leaving it in CLI mode). To replace a device's template, the service needs to delete the old 'attached' entry and create a new one, for the same device uuid, in the same transaction; the NED will detect the pairs CREATE/DELETE pairs and it will reattach the device directly (without going through the CLI mode).
The attach variables
When attaching a device template to a device the vManage requires values for all the variables from all of the feature templates referenced by the device template. The variables are path/value pairs, where the path is the vManage's x-path to the variable component; it is not using the custom variable names nor the NED x-path.
The NED cannot assist with managing the list of vars or their values - the service has to handle this and provide all the necessary entries and values, based on the feature template contents.
The NED does manage the list of vars and their values between the old CDB values, the new (commit) values, and the current (runtime) vManage values - by doing a merge of the list of vars, and of their values.
Note1: We can use a separate API to find the mapping between the custom names and their x-paths, but only after the device template is created.
Note2: In the list of vars there are some special entries which have the 'csv-' prefix. These are managed by the NED (filtered at sync from, added during updates), and should not be added in the CDB.
Vars list example:
For the attached device 'abcd-1234' we have 5 vars; for the first var, '//system/host-name' is the x-path to the host-name component, with the value 'test-vsmart'. This is part of the 'system-vsmart' feature template, and the component looks like this:
Notice how the variable name is 'custom-host-name-variable', but it doesn't appear anywhere in the variable; that's because the var path '//system/host-name' is actually the 'x-path' in the vManage feature template tree which is pointing to the host-name component.
The first 3 vars belong to the 'system-vsmart' type of feature template, the 4th belongs to one of the 'vpn-vsmart-interface' feature templates, while the last belongs to the 'ntp' type template. Notice that for this last var we do see the custom variable name 'ntp_server_host_opt_var' in the x-path because this one it's pointing inside a tree entry.
Optional vars
Tree components have an 'optional' tick-box in the vManage UI which makes the entry optional in the resulting configuration.
Let's look at a 'tree' component with 3 entries: first one is a constant value, second is a regular variable while the last is an optional variable (notice the 'vipOptional true' inside the last entry).
When attaching a device template which uses this feature template, we would have two var entries just for this tree component, one for each 'variable' component:
With the vars configured like this, the configuration we should expect for this server tree component will have two entries:
The 'server_host_opt_var' is not present in the output due to the combination of 'vipOptional true' and the 'TEMPLATE_IGNORE' value. Notice that we still had to add the entry in the list of vars, but with the TEMPLATE_IGNORE special value.
We can activate the variable by assigning it a concrete value:
This results in the output:
Currently optional variables are only available for the 'tree' components.
Tips for using the feature templates
when building NSO templates for feature templates, first create/configure the feature template on the vManage UI then do a sync-from, and use the resulting data for the template; do not create feature templates from NSO directly. On some templates the vManage does slight processing or creates list entries - which isn't caught in the YANG model; creating the template from the NSO directly will miss these changes.
the list of vars is directly dependent on the used feature templates; a suggestion is to keep the list of vars associated to each feature template, and concatenate all the entries when building a device template
similarly with the first point, the list of vars can be obtained from the NED after a sync-from (after the device template has been attached)
as long as a device template is not changed (nor any variable components are added/removed to any of its feature templates), then its vars list will remain the same for any attached device
9.4 Policies structure and organization (localized policy, centralized policy, security policy)
Policies are composed of different sub-elements, which are coming in two categories:
definitions (/system/template/policy/definition/), ex: Firewall, DNSSecurity, VedgeRoute, ACLv4, etc
lists (/system/template/policy/list/), ex: DataPrefix, Zone, VPN, Mirror, etc
A policy will usually reference several definition elements (and sometimes 'lists' elements), and some definitions are referencing lists elements. Both definitions and lists can be reused in several policies, but care must be taken when deleting them (they can't be deleted if they're still in use by some other element).
Here is the current policy/definition/list coverage in the NED:
Notes:
the localized policies list can have both 'CLI' and 'feature' formats (in the same list)
centralized policies are currently only supported as 'CLI'
localized policies/definitions might reference DataPrefix/DataPrefixFQDN list entries which are modeled in 'system/template/security/lists/' (they were modeled initially as part of the security policies sub-lists)
9.5 Localized policies: vedgeRoute and ACL lists sequence IDs
The vedgeroute and the ACLs (ACL v4, ACL v6, Device Access V4, Device Access V6) share a similar structure in the vManage UI, here one entry has a list of routes, and each route has a sub-list of rules (or sequences). Both the rules and the sequences re ordered by the user.
Examining the vManage APIs, we notice that we actually have a single list (of sequences) and the route is just an attribute to each equence, ex:
Notice how 'route A' has 3 sequences, and 'route B' has 2 sequences; also notice that the sequence numbering goes across the outes. This indicates that the API is focused on the sequences, and the route names are just a way to group the sequences in meaningful way in the UI.
In the NED, these APIs are difficult to model because there is no obvious YANG key value to be used for the sequence entries:
using the route name is not enough, we still need a key for the sequence entries
using the sequence id + route name as key (in a single list) makes it difficult to insert or move around entries
using match and actions contents (which would be the 'logical' unique identifiers for each sequence entry) is impossible or overwhelmingly complex
The compromise solution was to model it using two nested lists, one for the routes (named 'groups' to avoid confusion) based on the route names, and one for the sequences which use an abstract ordinal key (the sequenceId):
The 'groups' correspond to the route entries, and are ordered by user. Below each group we have a list of sequences, which se a 'sequenceId' as key - but unlike the native API, the sequence ids are re-numbered from '1' in each group:
Whenever there are changes to the sequences list (adding, removing or moving sequences) in a group, all the sequences from that group must be renumbered, such that after the commit we don't see config-compare diffs. The reason for having each group numbered from '1' is to isolate the re-numbering to a single group rather than all the sequences across all groups.
Changes within a sequence (ex changing the 'matches' rules, or the 'action') do not require any updates to the sequence Ids.
Last updated
Was this helpful?