07-31-2024 07:20 AM
Hello Cisco Community,
I’m currently working on a project to manage network fabrics and devices using Cisco NSO. I have created a single service package for Network Fabric as a Service (NFaaS) that includes service points for managing fabrics and devices within those fabrics. However, I’m facing an issue where the device-servicepoint is not being triggered when I try to configure a device within a fabric.
Details:
GitHub Repository:
The entire code is available on GitHub: nso-nfaas
Environment:
•NSO Version: 6.2
•Python Version: 3.10.12
•Yang Version: 1.1
YANG Models:
nfaas.yang (Root Model)
module nfaas {
namespace "http://example.com/nfaas";
prefix nfaas;
yang-version 1.1;
import ietf-inet-types {
prefix inet;
}
import tailf-common {
prefix tailf;
}
import tailf-ncs {
prefix ncs;
}
description
"Network Fabric as a Service (NFaaS) module";
revision 2024-07-29 {
description
"Extended to include the Fabric service";
}
grouping fabric-group {
list fabric {
key "name";
description "List of fabrics";
leaf name {
type string;
description "Unique name of the fabric";
}
uses ncs:service-data;
ncs:servicepoint fabric-servicepoint;
// Additional fabric-specific parameters can be added here
}
}
augment "/ncs:services" {
uses fabric-group;
}
}
nfaas-device.yang
module nfaas-device {
namespace "http://example.com/nfaas-device";
prefix nfaas-dev;
yang-version 1.1;
import ietf-inet-types {
prefix inet;
}
import tailf-ncs {
prefix ncs;
}
import nfaas {
prefix nfaas;
}
description
"Device management for NFaaS";
revision 2024-07-29 {
description
"Initial revision for device management.";
}
grouping device-attributes {
leaf address {
type inet:ipv4-address;
description "Management IP address of the device";
}
leaf ned-id {
type string;
description "NED ID of the device";
}
}
augment "/ncs:services/nfaas:fabric" {
list device {
key "name";
description "List of devices in the fabric";
leaf name {
type string;
description "Name of the device";
}
uses device-attributes;
uses ncs:service-data;
ncs:servicepoint device-servicepoint;
}
}
}
Python Code:
nfaas.py
# -*- mode: python; python-indent: 4 -*-
import ncs
from ncs.application import Service
class ServiceCallbacks(Service):
@service.create
def cb_create(self, tctx, root, service, proplist):
self.log.info(f"Creating fabric: {service.name}")
# Implement logic to configure the fabric
class NFaaS(ncs.application.Application):
def setup(self):
self.log.info('NFaaS RUNNING')
self.register_service('fabric-servicepoint', ServiceCallbacks)
def teardown(self):
self.log.info('NFaaS FINISHED')
nfaas_device.py
# -*- mode: python; python-indent: 4 -*-
import ncs
from ncs.application import Service
class DeviceServiceCallbacks(Service):
@service.create
def cb_create(self, tctx, root, service, proplist):
self.log.info(f"Creating device: {service.name}")
if service.name not in root.ncs__devices.device:
vars = ncs.template.Variables()
vars.add('name', service.name)
vars.add('address', service.address)
vars.add('authgroup', 'cisco')
vars.add('ned-namespace', 'http://tail-f.com/ns/ned-id/' + service.ned_id.split(':')[0])
vars.add('ned-id', service.ned_id)
template = ncs.template.Template(service)
template.apply('device-template', vars)
else:
self.log.info(f"Device {service.name} already exists in NSO")
class NFaaSDevice(ncs.application.Application):
def setup(self):
self.log.info('NFaaS Device Service RUNNING')
self.register_service('device-servicepoint', DeviceServiceCallbacks)
def teardown(self):
self.log.info('NFaaS Device Service FINISHED')
Template (device-template.xml)
<config-template xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>{name}</name>
<address>{address}</address>
<authgroup>{authgroup}</authgroup>
<device-type>
<netconf>
<ned-id xmlns:NED="{ned-namespace}">{ned-id}</ned-id>
</netconf>
</device-type>
<state>
<admin-state>unlocked</admin-state>
</state>
</device>
</devices>
</config-template>
Package Meta Data (package-meta-data.xml)
<ncs-package xmlns="http://tail-f.com/ns/ncs-packages">
<name>nfaas</name>
<package-version>1.0</package-version>
<description>Generated Python package</description>
<ncs-min-version>6.2</ncs-min-version>
<component>
<name>nfaas</name>
<application>
<python-class-name>nfaas.nfaas.NFaaS</python-class-name>
</application>
</component>
<component>
<name>nfaas-device</name>
<application>
<python-class-name>nfaas.nfaas_device.NFaaSDevice</python-class-name>
</application>
</component>
</ncs-package>
Issue:
When configuring a device under a fabric, the device-servicepoint callback is not triggered. Here are the steps I follow and the logs:
Commands:
admin@ncs# show packages package nfaas component application
JAVA
CLASS START
NAME NAME PYTHON CLASS NAME PHASE
-------------------------------------------------------------
nfaas-device - nfaas.nfaas_device.NFaaSDevice phase2
nfaas - nfaas.nfaas.NFaaS phase2
admin@ncs# show packages package nfaas templates
templates [ device-template ]
admin@ncs#
admin@ncs# config
Entering configuration mode terminal
admin@ncs(config)# services fabric FAB00.EWR00 device DLF03.FAB00.EWR00 ned-id NX-OS-nc-10.3 address 192.168.2.106
admin@ncs(config-device-DLF03.FAB00.EWR00)# top
admin@ncs(config)# commit dry-run outformat xml | debug template device-template
result-xml {
local-node {
data <services xmlns="http://tail-f.com/ns/ncs">
<fabric xmlns="http://example.com/nfaas">
<name>FAB00.EWR00</name>
<device xmlns="http://example.com/nfaas-device">
<name>DLF03.FAB00.EWR00</name>
<address>192.168.2.106</address>
<ned-id>NX-OS-nc-10.3</ned-id>
</device>
</fabric>
</services>
}
}
admin@ncs(config)# commit dry-run outformat xml | details very-verbose
dry run transaction for running datastore usid=42 tid=54109 trace-id=66a7143a-0995-44d8-93d8-d6ff82d14d0e
entering validate phase
2024-07-31T14:16:25.527 creating rollback checkpoint... ok (0.000 s)
2024-07-31T14:16:25.528 run pre-transform validation... ok (0.001 s)
2024-07-31T14:16:25.530 run transforms and transaction hooks...
2024-07-31T14:16:25.534 service /services/nfaas:fabric[name='FAB00.EWR00']: modifying service...
2024-07-31T14:16:25.535 service /services/nfaas:fabric[name='FAB00.EWR00']: pre-modification... ok (0.000 s)
2024-07-31T14:16:25.535 service /services/nfaas:fabric[name='FAB00.EWR00']: applying reverse diff-set...
2024-07-31T14:16:25.535 service-manager: evaluate delayed when expressions... ok (0.000 s)
2024-07-31T14:16:25.535 service /services/nfaas:fabric[name='FAB00.EWR00']: applying reverse diff-set: ok (0.000 s)
2024-07-31T14:16:25.537 service /services/nfaas:fabric[name='FAB00.EWR00']: create... ok (0.007 s)
2024-07-31T14:16:25.545 service /services/nfaas:fabric[name='FAB00.EWR00']: saving reverse diff-set and applying changes... ok (0.002 s)
2024-07-31T14:16:25.547 service /services/nfaas:fabric[name='FAB00.EWR00']: post-modification... ok (0.000 s)
2024-07-31T14:16:25.547 service /services/nfaas:fabric[name='FAB00.EWR00']: modifying service: ok (0.013 s)
2024-07-31T14:16:25.548 run transforms and transaction hooks: ok (0.018 s)
2024-07-31T14:16:25.549 mark inactive... ok (0.001 s)
2024-07-31T14:16:25.550 pre validate... ok (0.000 s)
2024-07-31T14:16:25.551 run validation over the changeset... ok (0.000 s)
2024-07-31T14:16:25.552 run dependency-triggered validation... ok (0.001 s)
2024-07-31T14:16:25.554 check configuration policies... ok (0.000 s)
2024-07-31T14:16:25.555 applying service meta-data... ok (0.000 s)
leaving validate phase (0.029 s)
entering write-start phase
2024-07-31T14:16:25.556 device-manager: write-start
leaving write-start phase (0.007 s)
dry run transaction for running datastore usid=42 tid=54109 trace-id=66a7143a-0995-44d8-93d8-d6ff82d14d0e (0.036 s)
result-xml {
local-node {
data <services xmlns="http://tail-f.com/ns/ncs">
<fabric xmlns="http://example.com/nfaas">
<name>FAB00.EWR00</name>
<device xmlns="http://example.com/nfaas-device">
<name>DLF03.FAB00.EWR00</name>
<address>192.168.2.106</address>
<ned-id>NX-OS-nc-10.3</ned-id>
</device>
</fabric>
</services>
}
}
admin@ncs(config)#
Logs:
<INFO> 31-Jul-2024::03:29:27.576 cisco-nso ncs[8191][<0.6963.0>]: ncs progress usid=43 tid=53319 datastore=running context=cli trace-id=340b923d-24ed-42c8-9935-2c88b8054bfe dry run transaction
...
<INFO> 31-Jul-2024::03:29:27.636 cisco-nso ncs[8191][<0.7159.0>]: ncs progress usid=43 tid=53319 datastore=running context=cli trace-id=340b923d-24ed-42c8-9935-2c88b8054bfe subsystem=service-manager service=/services/nfaas:fabric[name='FAB00.EWR00'] modifying service: ok (0.041 s)
<INFO> 31-Jul-2024::03:29:27.636 cisco-nso ncs[8191][<0.6963.0>]: ncs progress usid=43 tid=53319 datastore=running context=cli trace-id=340b923d-24ed-42c8-9935-2c88b8054bfe run transforms and transaction hooks: ok (0.049 s)
...
<INFO> 31-Jul-2024::03:29:27.668 cisco-nso ncs[8191][<0.6963.0>]: ncs progress usid=43 tid=53319 datastore=running context=cli trace-id=340b923d-24ed-42c8-9935-2c88b8054bfe leaving write-start phase: ok (0.016 s)
<INFO> 31-Jul-2024::03:29:27.668 cisco-nso ncs[8191][<0.6963.0>]: ncs progress usid=43 tid=53319 datastore=running context=cli trace-id=340b923d-24ed-42c8-9935-2c88b8054bfe dry run transaction: ok (0.091 s)
Question:
What could be causing the device-servicepoint callback to not trigger when configuring a device under a fabric? Any insights or suggestions would be greatly appreciated.
Solved! Go to Solution.
08-10-2024 10:05 AM
Here is a great example of stacked services: NSO Stack Service Example. It shows exactly what I have been trying to accomplish.
07-31-2024 09:13 AM - edited 07-31-2024 09:23 AM
Since you have two components in the same package each running a service point, try using multiprocessing instead of threading. In https://github.com/ndmitri/nso-nfaas/blob/main/package-meta-data.xml#L6 add:
<python-package>
<callpoint-model>multiprocessing</callpoint-model>
</python-package>
Documentation (can be improved to clarify): https://developer.cisco.com/docs/nso/guides/the-nso-python-vm/#ncs.development.pythonvm.cthread
07-31-2024 03:13 PM
@cohult, I've made the change, but it has not resolved the issue. Please see details below.
admin@ncs# show packages package nfaas
packages package nfaas
package-version 1.0
description "Generated Python package"
ncs-min-version [ 6.2 ]
python-package callpoint-model multiprocessing
directory ./state/packages-in-use/1/nfaas
templates [ device-template ]
template-loading-mode strict
component nfaas-device
application python-class-name nfaas.nfaas_device.NFaaSDevice
application start-phase phase2
component nfaas
application python-class-name nfaas.nfaas.NFaaS
application start-phase phase2
oper-status up
admin@ncs#
admin@ncs# config
Entering configuration mode terminal
admin@ncs(config)# services fabric FAB00.EWR00 device DLF03.FAB00.EWR00 ned-id NX-OS-nc-10.3 address 192.168.2.106
admin@ncs(config-device-DLF03.FAB00.EWR00)# top
admin@ncs(config)#
admin@ncs(config)#
admin@ncs(config)# commit dry-run outformat xml | details very-verbose
dry run transaction for running datastore usid=42 tid=55042 trace-id=33566714-2827-43bd-92cf-87000d4c9558
entering validate phase
2024-07-31T22:05:39.898 creating rollback checkpoint... ok (0.000 s)
2024-07-31T22:05:39.906 run pre-transform validation... ok (0.042 s)
2024-07-31T22:05:39.949 run transforms and transaction hooks...
2024-07-31T22:05:39.989 service /services/nfaas:fabric[name='FAB00.EWR00']: modifying service...
2024-07-31T22:05:39.995 service /services/nfaas:fabric[name='FAB00.EWR00']: pre-modification... ok (0.000 s)
2024-07-31T22:05:39.995 service /services/nfaas:fabric[name='FAB00.EWR00']: applying reverse diff-set...
2024-07-31T22:05:40.022 service-manager: evaluate delayed when expressions... ok (0.000 s)
2024-07-31T22:05:40.022 service /services/nfaas:fabric[name='FAB00.EWR00']: applying reverse diff-set: ok (0.027 s)
2024-07-31T22:05:40.023 service /services/nfaas:fabric[name='FAB00.EWR00']: create... ok (0.021 s)
2024-07-31T22:05:40.045 service /services/nfaas:fabric[name='FAB00.EWR00']: saving reverse diff-set and applying changes... ok (0.036 s)
2024-07-31T22:05:40.082 service /services/nfaas:fabric[name='FAB00.EWR00']: post-modification... ok (0.000 s)
2024-07-31T22:05:40.082 service /services/nfaas:fabric[name='FAB00.EWR00']: modifying service: ok (0.093 s)
2024-07-31T22:05:40.083 run transforms and transaction hooks: ok (0.133 s)
2024-07-31T22:05:40.083 mark inactive... ok (0.000 s)
2024-07-31T22:05:40.083 pre validate... ok (0.000 s)
2024-07-31T22:05:40.084 run validation over the changeset... ok (0.001 s)
2024-07-31T22:05:40.086 run dependency-triggered validation... ok (0.001 s)
2024-07-31T22:05:40.087 check configuration policies... ok (0.000 s)
2024-07-31T22:05:40.087 applying service meta-data... ok (0.002 s)
leaving validate phase (0.192 s)
entering write-start phase
2024-07-31T22:05:40.091 device-manager: write-start
leaving write-start phase (0.030 s)
dry run transaction for running datastore usid=42 tid=55042 trace-id=33566714-2827-43bd-92cf-87000d4c9558 (0.223 s)
result-xml {
local-node {
data <services xmlns="http://tail-f.com/ns/ncs">
<fabric xmlns="http://example.com/nfaas">
<name>FAB00.EWR00</name>
<device xmlns="http://example.com/nfaas-device">
<name>DLF03.FAB00.EWR00</name>
<address>192.168.2.106</address>
<ned-id>NX-OS-nc-10.3</ned-id>
</device>
</fabric>
</services>
}
}
admin@ncs(config)#
Python-VM Logs
<DEBUG> 31-Jul-2024::22:05:40.26 nfaas ncs-dp-45524-nfaas:nfaas:0: - TransactionCallback.cb_init(_ncs.TransCtxRef : fd=-1 : vfd=-1 : th=55042)
<DEBUG> 31-Jul-2024::22:05:40.29 nfaas ncs-dp-45524-nfaas:nfaas:0: - _WsockCb.create_item() = <ncs.dp._Wsock object at 0x7f7b8d9c1300>
<DEBUG> 31-Jul-2024::22:05:40.31 nfaas ncs-dp-45524-nfaas:nfaas:0-1: - ThreadPool._WorkerThread started <_WorkerThread(ncs-dp-45524-nfaas:nfaas:0-1, started 140167834744384)>
<DEBUG> 31-Jul-2024::22:05:40.32 nfaas ncs-dp-45524-nfaas:nfaas:0-1-th-55042: - _WorkerThread running <_WorkerThread(ncs-dp-45524-nfaas:nfaas:0-1-th-55042, started 140167834744384)>, item ncs-dp-45524-nfaas:nfaas:0-1
<DEBUG> 31-Jul-2024::22:05:40.33 nfaas ncs-dp-45524-nfaas:nfaas:0-1-th-55042: - _MaapiCb create connection to 127.0.0.1:4569 / None
<INFO> 31-Jul-2024::22:05:40.43 nfaas ncs-dp-45524-nfaas:nfaas:0-1-th-55042: - Creating fabric: FAB00.EWR00
<DEBUG> 31-Jul-2024::22:05:40.43 nfaas ncs-dp-45524-nfaas:nfaas:0-1-th-55042: - Pool(Maapi) idle: 0 busy: 0
<DEBUG> 31-Jul-2024::22:05:40.119 nfaas ncs-dp-45524-nfaas:nfaas:0-1-th-55042: - TransactionCallback.cb_finish(_ncs.TransCtxRef : fd=17 : vfd=-1 : th=55042)
<DEBUG> 31-Jul-2024::22:05:40.120 nfaas ncs-dp-45524-nfaas:nfaas:0-1-th-55042: - _WorkerThread finished <_WorkerThread(ncs-dp-45524-nfaas:nfaas:0-1-th-55042, started 140167834744384)>, item ncs-dp-45524-nfaas:nfaas:0-1
<DEBUG> 31-Jul-2024::22:05:40.120 nfaas ncs-dp-45524-nfaas:nfaas:0-1-th-55042: - Pool(ncs-dp-45524-nfaas:nfaas:0) idle: 0 busy: 0
<DEBUG> 31-Jul-2024::22:06:36.412 nfaas ncs-dp-45524-nfaas:nfaas:0 maintenance: - ThreadPool._WorkerThread.stop (queue_size=0) <_WorkerThread(ncs-dp-45524-nfaas:nfaas:0-1-th-55042, started 140167834744384)>
<DEBUG> 31-Jul-2024::22:06:36.413 nfaas ncs-dp-45524-nfaas:nfaas:0-1: - ThreadPool._WorkerThread finished <_WorkerThread(ncs-dp-45524-nfaas:nfaas:0-1, started 140167834744384)>
<DEBUG> 31-Jul-2024::22:06:36.413 nfaas ncs-dp-45524-nfaas:nfaas:0 join: - ThreadPool joining thread <_WorkerThread(ncs-dp-45524-nfaas:nfaas:0-1, stopped 140167834744384)>
<DEBUG> 31-Jul-2024::22:06:36.414 nfaas ncs-dp-45524-nfaas:nfaas:0 join: - ThreadPool joined thread <_WorkerThread(ncs-dp-45524-nfaas:nfaas:0-1, stopped 140167834744384)>
<DEBUG> 31-Jul-2024::22:06:36.414 nfaas ncs-dp-45524-nfaas:nfaas:0 join: - ThreadPool deleting thread <_WorkerThread(ncs-dp-45524-nfaas:nfaas:0-1, stopped 140167834744384)> item <ncs.dp._Wsock object at 0x7f7b8d9c1300>
<DEBUG> 31-Jul-2024::22:06:36.414 nfaas ncs-dp-45524-nfaas:nfaas:0 join: - _WsockCb.delete_item(<ncs.dp._Wsock object at 0x7f7b8d9c1300>)
<DEBUG> 31-Jul-2024::22:06:36.415 nfaas ncs-dp-45524-nfaas:nfaas:0 join: - ThreadPool deleted thread <_WorkerThread(ncs-dp-45524-nfaas:nfaas:0-1, stopped 140167834744384)> item <ncs.dp._Wsock object at 0x7f7b8d9c1300>
NCS Logs:
<INFO> 31-Jul-2024::22:10:20.905 cisco-nso ncs[45450]: audit user: admin/42 CLI 'commit dry-run outformat xml | details very-verbose'
<INFO> 31-Jul-2024::22:10:20.910 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df dry run transaction
<INFO> 31-Jul-2024::22:10:20.911 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df entering validate phase
<INFO> 31-Jul-2024::22:10:20.911 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df creating rollback checkpoint
<INFO> 31-Jul-2024::22:10:20.912 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df creating rollback checkpoint: ok (0.000 s)
<INFO> 31-Jul-2024::22:10:20.916 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df run pre-transform validation
<INFO> 31-Jul-2024::22:10:20.919 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df run pre-transform validation: ok (0.003 s)
<INFO> 31-Jul-2024::22:10:20.920 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df run transforms and transaction hooks
<INFO> 31-Jul-2024::22:10:20.924 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager service=/services/nfaas:fabric[name='FAB00.EWR00'] modifying service
<INFO> 31-Jul-2024::22:10:20.926 cisco-nso ncs[45450][<0.1052.0>]: ncs initializing service metadata took 0ms
<DEBUG> 31-Jul-2024::22:10:20.927 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager service=/services/nfaas:fabric[name='FAB00.EWR00'] pre-modification
<DEBUG> 31-Jul-2024::22:10:20.928 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager service=/services/nfaas:fabric[name='FAB00.EWR00'] pre-modification: ok (0.000 s)
<DEBUG> 31-Jul-2024::22:10:20.929 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager service=/services/nfaas:fabric[name='FAB00.EWR00'] applying reverse diff-set
<INFO> 31-Jul-2024::22:10:20.929 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager evaluate delayed when expressions
<INFO> 31-Jul-2024::22:10:20.930 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager evaluate delayed when expressions: ok (0.000 s)
<DEBUG> 31-Jul-2024::22:10:20.932 cisco-nso ncs[45450][<0.144.0>]: devel-c new_trans request daemon id: 6 thandle: 55042
<DEBUG> 31-Jul-2024::22:10:20.933 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager service=/services/nfaas:fabric[name='FAB00.EWR00'] applying reverse diff-set: ok (0.003 s)
<DEBUG> 31-Jul-2024::22:10:20.936 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager service=/services/nfaas:fabric[name='FAB00.EWR00'] create
<DEBUG> 31-Jul-2024::22:10:20.938 cisco-nso ncs[45450][<0.144.0>]: devel-c New pending socket Mod: gen_tcp LibVsn: 134348800
<DEBUG> 31-Jul-2024::22:10:20.940 cisco-nso ncs[45450][<0.144.0>]: devel-c New worker connected (daemon id: 6 worker id: 17)
<DEBUG> 31-Jul-2024::22:10:20.944 cisco-nso ncs[45450][<0.144.0>]: devel-c new_trans succeeded daemon id: 6 session id: 55042 worker id: 17
<DEBUG> 31-Jul-2024::22:10:20.945 cisco-nso ncs[45450][<0.144.0>]: devel-c service_create request for callpoint 'fabric-servicepoint' path /ncs:services/nfaas:fabric{FAB00.EWR00}
<DEBUG> 31-Jul-2024::22:10:20.958 cisco-nso ncs[45450][<0.1052.0>]: devel-c service_create succeeded for callpoint 'fabric-servicepoint' path /ncs:services/nfaas:fabric{FAB00.EWR00}
<DEBUG> 31-Jul-2024::22:10:20.960 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager service=/services/nfaas:fabric[name='FAB00.EWR00'] create: ok (0.028 s)
<DEBUG> 31-Jul-2024::22:10:20.960 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager service=/services/nfaas:fabric[name='FAB00.EWR00'] saving reverse diff-set and applying changes
<DEBUG> 31-Jul-2024::22:10:20.966 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager service=/services/nfaas:fabric[name='FAB00.EWR00'] saving reverse diff-set and applying changes: ok (0.006 s)
<DEBUG> 31-Jul-2024::22:10:20.967 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager service=/services/nfaas:fabric[name='FAB00.EWR00'] post-modification
<DEBUG> 31-Jul-2024::22:10:20.967 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager service=/services/nfaas:fabric[name='FAB00.EWR00'] post-modification: ok (0.000 s)
<INFO> 31-Jul-2024::22:10:20.967 cisco-nso ncs[45450][<0.1052.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=service-manager service=/services/nfaas:fabric[name='FAB00.EWR00'] modifying service: ok (0.042 s)
<INFO> 31-Jul-2024::22:10:20.969 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df run transforms and transaction hooks: ok (0.048 s)
<INFO> 31-Jul-2024::22:10:20.969 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df mark inactive
<INFO> 31-Jul-2024::22:10:20.970 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df mark inactive: ok (0.001 s)
<INFO> 31-Jul-2024::22:10:20.972 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df pre validate
<INFO> 31-Jul-2024::22:10:20.972 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df pre validate: ok (0.000 s)
<INFO> 31-Jul-2024::22:10:20.973 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df run validation over the changeset
<INFO> 31-Jul-2024::22:10:20.975 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df run validation over the changeset: ok (0.002 s)
<INFO> 31-Jul-2024::22:10:20.976 cisco-nso ncs[45450][<0.1068.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df run dependency-triggered validation
<INFO> 31-Jul-2024::22:10:20.978 cisco-nso ncs[45450][<0.1068.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df run dependency-triggered validation: ok (0.002 s)
<INFO> 31-Jul-2024::22:10:20.978 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df check configuration policies
<INFO> 31-Jul-2024::22:10:20.978 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df check configuration policies: ok (0.000 s)
<INFO> 31-Jul-2024::22:10:20.980 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df applying service meta-data
<INFO> 31-Jul-2024::22:10:20.982 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df applying service meta-data: ok (0.002 s)
<INFO> 31-Jul-2024::22:10:20.983 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df leaving validate phase: ok (0.073 s)
<INFO> 31-Jul-2024::22:10:20.984 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df entering write-start phase
<INFO> 31-Jul-2024::22:10:20.985 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df subsystem=device-manager write-start
<DEBUG> 31-Jul-2024::22:10:20.993 cisco-nso ncs[45450][<0.144.0>]: devel-c close_trans request daemon id: 6 session id: 55042
<DEBUG> 31-Jul-2024::22:10:20.996 cisco-nso ncs[45450][<0.144.0>]: devel-c close_trans succeeded daemon id: 6 session id: 55042
<INFO> 31-Jul-2024::22:10:20.997 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df leaving write-start phase: ok (0.014 s)
<INFO> 31-Jul-2024::22:10:20.998 cisco-nso ncs[45450][<0.722.0>]: ncs progress usid=42 tid=55042 datastore=running context=cli trace-id=e70f0989-f005-41c0-843b-fc896834f4df dry run transaction: ok (0.087 s)
<INFO> 31-Jul-2024::22:10:21.002 cisco-nso ncs[45450]: audit user: admin/42 CLI done
Any ideas?
Thank you.
08-01-2024 12:23 AM - edited 08-01-2024 05:39 AM
@ndmitri , sorry for the confusion. The issue seems to be the nested service points. Only the top service point, fabric-servicepoint, will be called, while the nested one, device-servicepoint, will not. You need to merge your service points into a single one.
The nested service architecture is unsupported as the NSO service manager assumes only one service point in a tree.
08-01-2024 06:51 AM
Thank you for your insight regarding the issue with nested service points in my NSO package. Based on your feedback, I understand that the NSO service manager only supports a single service point in a tree and that the current nested service architecture is unsupported.
To address this, I plan to restructure my project by creating separate NSO packages for each service point. This will involve:
1. Creating Separate Packages: I will create one package for fabric management and another for device management. This separation will allow each package to have its own service point.
2. Modifying the YANG Models: Each package will have a distinct YANG model, with device management being an augmentation of the fabric service from the other package.
3. Updating the Python Code: I will ensure that the service callbacks are appropriately organized within their respective packages.
4. Re-registering and Deploying the Packages: I will build, register, and deploy each package separately to comply with NSO’s single service point expectation.
I believe this approach will align my project with NSO’s architectural constraints and resolve the issue with the service point not being triggered. Thank you again for your guidance. I’ll proceed with these changes and keep you updated on the results.
08-01-2024 01:13 PM - edited 08-01-2024 01:16 PM
Hi @cohult,
I have updated my project according to your suggestion, but I’m still experiencing the same issue. You can view my updated code here: https://github.com/ndmitri/nso-nfaas.
I'm trying to implement the NSO stacked services design. What else could be causing this problem?
Thank you.
08-02-2024 01:27 AM
The same issue applies whether you use YANG augmentation or separate packages. The NSO service manager assumes only one service point in a YANG schema tree. When a YANG list or presence container is tagged with a service point extension, NSO will disregard any additional service points in that node's YANG subhierarchy.
08-10-2024 10:05 AM
Here is a great example of stacked services: NSO Stack Service Example. It shows exactly what I have been trying to accomplish.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide