Use this when applying candidate config with commit.
commit · NETCONF
commit is the NETCONF operation that applies the candidate datastore to running. Confirmed commit applies it with an automatic rollback unless confirmed within a timeout.
1. commit applies candidate to running.
2. Confirmed commit rolls back if not confirmed (protects against lockout).
3. Confirm after verification.
4. cancel-commit to abort.
5. Log commits.
candidate → commit confirmed → verify → confirm
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as capability mismatch, namespace drift, wrong datastore, lock contention, partial edit semantics and assuming <ok/> shows final device behavior, choosing the cases most relevant to candidate-to-running commit semantics, confirmed-commit where supported, error handling and read-back from running after completion.
Step 2 Common mistakes Narrow the fault
- Not using confirmed commit for risky changes.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- commit copies candidate to running.
- Confirmed commit auto-reverts unless confirmed.
- Confirm within the timeout.
- <commit> after candidate edits — apply
- <commit confirmed timeout> then confirming commit — safety
- <cancel-commit> — abort
ReferenceWhy it matters1 section · depth on demand
In depth
<commit> copies the candidate datastore to running, activating all staged changes at once. With <confirmed/>, the commit is temporary: unless a second commit confirms it within the timeout, the device rolls back automatically. That protects against changes that cut off management access.
m.commit(confirmed=True, timeout="300") # active, auto-rollback in 5 min
if post_checks_ok(dev):
m.commit() # make permanent
else:
m.cancel_commit() # roll back now (if supported)
If the commit fails validation, nothing changes and the error explains which element is invalid. Discard the candidate (<discard-changes>) after a failed attempt so stale changes do not leak into the next commit.
ReferenceImportant terms & boundaries1 section · depth on demand
Mechanics
Follow the chain of components client model → SSH/TLS transport → NETCONF RPC → datastore validation/lock → commit/apply → datastore read-back and record which layer currently owns truth.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in NETCONF > commit. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc6241 · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
Capture at minimum device, session, message-id, datastore, module/revision, target path, rpc-error/error-tag/error-path, commit result and read-back values. For candidate-to-running commit semantics, confirmed-commit where supported, error handling and read-back from running after completion, prefer typed fields and stable IDs over human presentation text.