cisco IOS XE 17.16.x — NETCONF Operations on Candidate

Locking the candidate datastore does not affect the Cisco IOS config lock or the running configuration lock and vice versa. Note Commit A RPC, copies the candidate configuration to the device’s running configuration. A commit operation must be performed after you have updated the candidate configuration to push the configuration to the device. If either the running or the candidate datastore is locked by another NETCONF session, the RPC will fail with an RPC error reply. The should be and should have the session ID of the NETCONF session holding the lock.

You can also lock the running configuration by using the global lock by entering the conf t lock mode, but, the commit operation will fail with an RPC error reply, with error-tag value and the session-id will be “0”. Edit-config The candidate configuration can be used as a target for the edit-config operation to modify a configuration. You can change the candidate configuration without affecting the running configuration on the device. Discard To remove the changes made to the candidate configuration, perform a discard operation to revert the candidate configuration to running configuration.

If contents of the candidate datastore are modified by NETCONF session A, and session B tries to lock the candidate datastore, the lock fails. NETCONF session B must perform a operation to remove any outstanding configuration changes on the candidate datastore from other NETCONF sessions before locking a candidate. Unlock After working on candidate configuration, such as, lock, edit-config, or commit operations, you can unlock the datastore, by specifying candidate as target in the unlock RPC. The candidate datastore is now available for all operations in other sessions.

If a failure occurs with outstanding changes to the candidate datastore, it can be challenging to recover the configuration, and may create problems for other sessions. To avoid any issues, outstanding changes must be discarded when the lock is released—either implicitly on “NETCONF session failure” or explicitly by using the unlock operation. Get-config, Copy-config, Validate The candidate datastore can be used as a source or target for any of the get-config, copy-config or validate config operations. If you do not want to commit the changes in the candidate datastore to the device; but only to validate the configuration, you ca nuse the RPC followed by a discard operation.

Modifying the Candidate Datastore The following diagram explains the recommended best practice when modifying the device configuration through candidate datastore: Model-Driven Programmability NETCONF Operations on Candidate Programmability Configuration Guide, Cisco IOS XE 17.16.x 177