Lifecycle Operations
Manipulate and manage existing services and devices.
Devices and services are the most important entities in NSO. Once created, they may be manipulated in several different ways. The three main categories of operations that affect the state of services and devices are:
Commit Parameters: Commit parameters modify the transaction semantics. In the CLI they are exposed as commit flags.
Device Actions: Explicit actions that modify the devices.
Service Actions: Explicit actions that modify the services.
The purpose of this section is more of a quick reference guide, an enumeration of available commands. The context in which these commands should be used is found in other parts of the documentation.
Commit Parameters
NSO uses the shared YANG module tailf-ncs-commit-params.yang to define commit parameters, dry-run parameters, and commit results for northbound interfaces and SDK APIs. The groupings and sx:structure definitions in this module are reused by NSO modules such as tailf-netconf-ncs.yang, tailf-restconf-ncs.yang, tailf-yang-patch-ncs.yang, tailf-ncs-rollback.yang, tailf-ncs-services.yang, and tailf-ncs-devices.yang.
In the CLI, these parameters are exposed as commit flags:
commit label nightly-batch no-networkingThe same shared model is used by the main northbound interfaces:
JSON-RPC passes a structured
paramsobject that matchestailf-ncs-commit-params:commit-params.RESTCONF passes the same structure as base64-encoded JSON in the
paramsquery parameter or theX-Cisco-NSO-Commit-Paramsheader. The header form is an alternative to theparamsquery parameter when the client prefers not to place the often long, URL-encoded base64 commit-parameter payload in the request URI, for example when other query parameters are also used.NETCONF augments
commit,edit-config,copy-config, andprepare-transactionwith the same parameters.MAAPI and the language SDKs expose helpers for the built-in parameters and generic tagged-value or XML access for augmented parameters.
Some of these parameters may be configured to apply globally for all commits under /devices/global-settings, or per device profile under /devices/profiles.
The shared commit parameters are:
label,comment: Add user-defined metadata to the transaction. The data is visible in rollback files, compliance reports, notifications, and events. If supported, it is also propagated to participating devices.dry-run: Validate and return the resulting changes without updating CDB or devices. Theoutformatleaf selectsxml,cli,native, orcli-c. Thereverseleaf can be used withnativeorcli-coutput to show the commands needed to return to the current running state. Thewith-service-meta-dataleaf includes FASTMAP service metadata in the diff.confirm-network-state: Check device state as part of the commit and process out-of-band changes according to policy. There-evaluate-policiesleaf also reprocesses out-of-band policies for services touched by the commit. There-deploy-allleaf expands the operation to also re-deploy all services affected by discovered out-of-band data; without it, the impact stays scoped to the original transaction.no-networking: Update CDB but do not send configuration southbound. The affected devices become out of sync until the change is pushed later, for example withsync-to.no-out-of-sync-check: Continue even if NSO detects that a device is out of sync.no-overwrite: Perform a fine-grained check that the data NSO is about to modify has not changed on the device compared to NSO's view.no-revision-drop: Fail instead of silently dropping configuration that is not supported by an older device model revision.no-deploy: Write service data without invoking the service create callback.reconcile: Reconcile service ownership for existing configuration. Thekeep-non-service-config,discard-non-service-config,attach-non-service-config, anddetach-non-service-configleafs control how non-service-owned data is handled. Theincludeandexcludeleaf-lists limit reconciliation to selected service configuration paths.use-lsa,no-lsa: Control whether LSA nodes are handled as LSA nodes or as ordinary devices.commit-queue: Commit through the commit queue instead of pushing configuration transactionally in the same operation. Theasync,sync, andbypassleafs select the queue behavior. Thesynccontainer accepts eithertimeoutorinfinity. Thelock,block-others,atomic, anderror-optionleafs control the resulting queue item. See Commit Queue for details and error-recovery behavior.
Some combinations of parameters are not allowed. For example, dry-run cannot be combined with no-overwrite, no-out-of-sync-check, or commit-queue, and use-lsa cannot be combined with no-lsa.
The CLI also has local commit modifiers such as check and and-quit. These affect CLI behavior but are not part of tailf-ncs-commit-params.yang.
Augmenting Commit Parameters
Developers can augment the sx:structure commit-params structure in tailf-ncs-commit-params.yang with their own parameters. Once augmented, the new parameters become available wherever the shared commit-parameter model is used, including propagation to lower LSA nodes.
Accessing From User Code
Augmented commit parameters are accessible through MAAPI together with the built-in ones:
Python: Use
trans.get_params()ortrans.get_trans_params(). Built-in parameters have helper methods onCommitParams, while augmented parameters can be read throughCommitParams.rootorCommitParams.get_tagvalues().Java: Use
maapi.getTransParams(th). Built-in parameters have helper methods onCommitParams, while augmented parameters can be inspected throughCommitParams.getConfXMLParam().Lower-level MAAPI APIs expose the same data as tagged values or XML parameter arrays.
The examples.ncs/sdk-api/maapi-commit-parameters example shows how to augment the shared commit-parameter model, how to access built-in commit parameters from Python and Java user code, and how to access augmented parameters from Python and Java user code. The Java package also illustrates the lower-level CommitParams.getConfXMLParam() access pattern for augmented parameters. A northbound example covering CLI, RESTCONF, NETCONF, and JSON-RPC is available in examples.ncs/northbound-interfaces/commit-parameters.
All commands in NSO can also have pipe commands. A useful pipe command for commit is details:
This will give feedback on the steps performed in the commit.
When working with templates, there is a pipe command debug which can be used to troubleshoot templates. To enable debugging on all templates use:
When configuring using many templates the debug output can be overwhelming. For this reason, there is an option to only get debug information for one template, in this example, a template named l3vpn:
Device Actions
Actions for devices can be performed globally on the /devices path and for individual devices on /devices/device/name. Many actions are also available on device groups as well as device ranges.
Service Actions
Service actions are performed on the service instance.
Bulk Service Actions
Service actions are performed on the multiple service instances filtered by services type (service callpoint).
Dry-run Drift Detection
Dry-run drift detection compares the changeset from a dry-run with the changeset at commit time to determine whether anything has changed in between. This helps prevent users from accidentally committing unintended changes. When a dry-run is performed, a checksum of the changeset is saved. During commit, a new checksum is calculated from the current changeset and compared with the saved checksum. Both checksums are calculated after the validation phase and before the prepare phase. If no dry-run has been performed in the transaction, no comparison is made. This feature applies to the CLI, JSON-RPC, and Web UI.
This behavior is configured through the dry-run-drift-detection container in tailf-ncs-aaa.yang, which has two leaves: enabled and mode. The mode leaf can be set to warn or strict. In warn mode, the user receives a validation warning if the changeset differs between dry-run and commit, and can choose whether to continue. This is handled the same way as other validation warnings. In strict mode, an error is returned instead, the transaction is aborted, and a new dry-run is required before the commit can proceed. In tailf-ncs-aaa.yang, enabled defaults to false and mode defaults to warn. However, enabled is set to true in ncs_defaults.xml.in, so the feature is enabled by default for new NSO deployments. The setting can be configured globally by setting the dry-run-drift-detection leaves in tailf-ncs-aaa.yang, for example in the CLI:
It can also be set per user, for example:
In the CLI, it is also possible to set this per session in operational mode:
This does not require a commit and will only last for this CLI session, meaning the changes are not persistent. This works in the same way as the existing commit-prompt setting.
Examples
Consider this small service model:
Example A - create a changeset mismatch scenario with two transactions
Transaction A sets up the topology connections and then creates a service that depends on this topology, and then performs a dry-run:
Another transaction, transaction B, then changes endpoint-2 to point to ex2 instead of ex1 before transaction A commits:
Transaction A then tries to commit its changes:
When committing transaction A, validation runs again and the service re-evaluates against the updated topology, so the resulting transaction changeset is no longer the same as the one that was saved at dry-run. Because the changeset of transaction A was changed by the changes committed by transaction B, the dry-run-drift-detection validation warning is returned and the user can choose to continue or abort. If the user aborts, a new dry-run has to be performed to commit:
The new dry-run output demonstrates that the original commit would have updated ex0 and ex1, but after the commit made by transaction B, transaction A would have actually updated ex0 and ex2, which would have been unintentional if the user was not aware of the changes made in transaction B.
Example B
This example demonstrates a scenario that does not cause a mismatch. Two transactions edit topology only, so no service is consuming topology in the open transaction. The transaction changeset of transaction A is not changed by the changes made in transaction B.
Transaction A:
Transaction B:
Transaction A:
No warning appears. If a new dry-run had been made in transaction A after the commit of transaction B, it would have displayed the following output:
The difference between the two dry-run outputs show that instead of changing endpoint-2 from ex2 to ex1, it was changed from ex0 to ex1 because of the change by transaction B. However, this does not affect the changeset of transaction A or the final result of the commit, which is that endpoint 2 now points to ex1. So even though the dry-run output differs, the intent of the commit is the same.
Example C
This example demonstrates a mismatch occurring when a change has been made in the same transaction. This also demonstrates "strict" mode
In this scenario, transaction A first updated endpoint-1 to point to ex1 and performed a dry-run. Then transaction A updates endpoint-1 again to point to ex2 instead and tries to commit. The commit is aborted because this change in the same transaction has caused the transaction changeset to be updated, and dry-run-drift-detection is now in strict mode.
Interaction with commit-prompt
Commit-prompt is a CLI behavior where each ordinary commit first runs an automatic dry-run and then prompts the user on whether or not to continue before the commit actually proceeds. This reduces the risk of committing unintended changes that dry-run drift detection is meant to catch. It is still possible to use commit-prompt with dry-run-drift-detection though. When used with dry-run-drift-detection, the changeset will be saved during the automatic dry-run, just as with any other dry-run. Then, if another transaction makes changes that affect the first transaction's changeset while the user is still at the prompt, a warning/error will be returned if the user confirms the commit with "yes", since confirming with "yes" runs validation again. So dry-run drift detection applies in the usual way if the changeset at commit time (after confirming the commit) differs from the one that was checksummed at the automatic dry-run.
Known limitations
In some nano-service situations, NSO does not compare the dry-run and commit changeset checksums. This is during deletion of a nano-service as well as when a nano-service is created with converge-on-re-deploy. Instead, it emits a dedicated validation warning that explains why the comparison was skipped. The reasoning behind this warning is that the transaction might contain several other changes as well, and the user might want to have the comparison done for these changes. So when the warning appears, the user can choose to either continue with the commit with no comparison, or do a new commit that excludes the changes that cannot be compared, and later do those in a separate commit. The message is shown as a normal validation warning.
Nano-service delete
If the transaction deletes one or more nano-services, NSO skips the dry-run versus commit changeset comparison for that commit. This is the warning that will be returned during commit in the CLI:
If several service points are involved, their names appear separated by commas.
The changeset comparison is not possible in this case because the delete paths are different for a dry-run and a commit. When a nano-service is removed, NSO cannot run the full, multi-step teardown that a real delete performs. Internally, dry-run therefore follows a shortened delete path — essentially unwinding planned nano changes in a way that produces a useful preview without executing a complete delete. A real commit, however, uses the full nano delete path, which includes zombie handling etc. Because of this, the changesets will often differ between a dry-run and commit even without other changes being made, and therefore performing a comparison adds no value.
Nano-services using "converge-on-re-deploy"
For a nano-service declared with converge-on-re-deploy, NSO does not fully converge the service inside the same transaction where the service instance is created. Instead, in that creation commit NSO records the service intent, establishes the plan as required for this mode, and schedules a reactive re-deploy so the heavy convergence runs after that commit. During a dry-run however, NSO simulates what updates the nano-service would apply if it converged in that pass, so it executes the convergence path so that the dry-run can display a preview. Because of this, the changesets that are created during dry-run and commit will be different even if no other changes have been made in the transaction, so performing a comparison of the changesets has no purpose.
If the transaction involves nano-service work under a service point that has converge-on-re-deploy set, NSO skips the dry-run versus commit changeset checksum comparison for that commit and emits the warning below.
If several service points are involved, their names appear separated by commas.
Last updated
Was this helpful?

