Skip to content

NETCONF Confirm Commit ​

netconf.commit confirms the confirmed commit an earlier change step left pending, so the change stays. Put it after the checks (or the approval) that follow a change step (such as netconf.edit_config) whose Commit is "Confirm in a later step".

Using It ​

Change Step chooses that change step. Its output names each device's pending commit by a persist id; for each target device this step opens a new NETCONF session and sends <commit> with that persist id (RFC 6241, :confirmed-commit:1.1). Target the same devices as the change step.

A confirming commit commits whatever the candidate holds, so the step first locks the candidate and confirms only when it matches running (the pending change). The two are compared in a canonical form: layout, attribute order and prefix spelling on elements do not count, while a leaf's value does: its text exactly, spaces included, text in mixed content, and the namespaces a value may refer to (the default namespace for a bare name, and the binding of each prefix it uses, as in an identityref or an instance identifier). Without the schema a value's type is unknown, so i:foo and j:foo count as different even when i and j name one namespace: the step refuses rather than confirm a change it cannot rule out. Edits another session staged since the change step stop it.

Some devices (IOS XE) keep the candidate locked for the session that made a confirmed commit until the commit is settled, so no other session can lock it. The change step records that session's id (commit_session_id). When the lock refusal names the same session (in its error-info or its message, such as "locked by session 54"), the step compares candidate and running without a lock of its own and confirms, and says so in notes; the device's lock keeps other sessions from editing the candidate meanwhile. A lock held by any other session still stops the step, and the error names both sessions. When the device does not answer the confirmation in time, the step fails and says the commit may already be confirmed. When the device refuses the persist id and a save was asked, the error also says to save running to startup in case an earlier attempt confirmed it.

Save to startup saves running to startup after confirming: copy-config when the device has a startup datastore, else Cisco's save-config RPC. A change step with Save to startup on (save_requested in its output) is saved here even when this step's setting is off. The save runs before the candidate lock is released, so no other session's unconfirmed commit can reach startup with it.

Each device is matched to its result by the device_id the change step recorded; a result recorded for another device (or a name several target devices share without ids) fails that device before any session opens. A device whose confirmed commit got no reply (commit_uncertain) is settled too. Port, timeouts, Allow legacy SSH and Max Parallel Devices (default 10) work as in netconf.get.

The confirmation must arrive before the change step's Confirm Timeout runs out; after that the device has already restored the previous configuration.

Output ​

The summary reads netconf commit: N/M devices.

  • steps.NODE_ID.output.devices: each device's result by name: ok, error, persist_id, skipped, confirmed, saved, save_requested and notes.
  • steps.NODE_ID.output.truncated: always empty for this step.

When It Fails ​

The step fails when Change Step is not set or has no output in this run. A device the change step left unchanged (or committed at once) has nothing pending and is skipped, with skipped true. A device fails when the change step has no result for it or failed on it, when several target devices share its name without ids that tell their results apart, when another session (other than the one that made the pending commit) holds the candidate, when another session has staged other changes in it, when it lacks :confirmed-commit:1.1, when it cannot be reached, when saving fails after the confirmation (confirmed stays true, with save_error), and when it refuses the persist id: the commit was confirmed or cancelled already, or rolled back when its timeout ran out.