skip to content

On a NETCONF device advertising :startup, why does a committed change disappear after a reboot, and how do you make it persist?

level: middleimportance: should knowfreq 16%

answer

  1. boot loads a different datastore
  2. no automatic copy from running
  3. copy-config, source and target
  4. save after testing, not before

basics

~10 s

With :startup, the device boots from a separate startup datastore, and changes to running are not copied there automatically. Persist a change with <copy-config> from running to startup, ideally after testing it.

solid answer

~40 s

`:startup` means running and startup are distinct datastores: the device loads startup at boot, and RFC 6241 Section 8.7 says operations that affect running are not automatically copied to startup. A `<commit>` or an `<edit-config>` on running is therefore lost at the next reboot unless you save it. The save is `<copy-config>` with `<running/>` as the source and `<startup/>` as the target; RFC 8342 notes that in the standard NETCONF editing model startup is changed only that way. Saving after you have tested the change keeps a free recovery path: until then, a reboot brings back the last saved configuration. A device without `:startup` has no save step on the wire and typically persists running itself.

code

xml · 10 lines
xml
<rpc message-id="301" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <copy-config>
    <target>
      <startup/>
    </target>
    <source>
      <running/>
    </source>
  </copy-config>
</rpc>

go deeper

for a junior

Recall that startup is what the device boots from, and that the save is a copy-config from running to startup.

for a middle

Explain why changes to running do not reach startup on a :startup device, which operations accept startup, and why edit-config does not.

for a senior

Show you sequence the save after testing, detect devices whose startup lags running, and know that a device without :startup has no save step.

for a principal

Discuss who owns persistence when several management protocols touch one device, given that RESTCONF saves automatically and NETCONF does not.

## Two copies of the configuration The `:startup` capability (RFC 6241 Section 8.7, identifier `urn:ietf:params:netconf:capability:startup:1.0`) announces that the device keeps **separate running and startup datastores**. Their roles are fixed: - `<startup>` is the configuration the device **loads when it boots**. - `<running>` is the configuration **active now**. - Operations that affect running are **not automatically copied** to startup. RFC 8342 describes the same pair: on devices with non-volatile storage, startup typically persists across reboots, and at boot the device loads the saved startup configuration into running. So a change that reached running by any route, whether a `<commit>` from the candidate or an `<edit-config>` on a writable running datastore, lives only until the next reboot. ## The save operation RFC 6241 names the operation explicitly: to save the startup configuration, use `<copy-config>` to copy the running datastore to the startup datastore. `<copy-config>` replaces an entire target datastore with the contents of the source, so the result is that startup becomes an exact copy of running at that moment. The `:startup` capability adds `<startup/>` as a legal parameter to these operations: | Operation | Parameter | Note | |---|---|---| | `<get-config>` | source | read what the device will boot with | | `<copy-config>` | source and target | the save, or a restore into running | | `<lock>` / `<unlock>` | target | guard startup while saving | | `<validate>` | source | only if `:validate:1.1` is advertised | | `<delete-config>` | target | the RFC notes this resets the device to its factory defaults | `<edit-config>` is not on that list. RFC 8342 Section 4.1 says the same thing in prose: in the standardized NETCONF editing model, startup can only be modified by copying running to it. You do not edit startup line by line; you make running right and copy it. If the source and the target name the same datastore, RFC 6241 requires an `invalid-value` error, which catches a script that builds the RPC from the wrong variable. ## When to save RFC 6241 Appendix E lays out the steps for changing one device: lock, checkpoint running, load and validate, change running, **test the new configuration**, then make the change permanent "if desired", then unlock. The order is deliberate: 1. Apply the change to running. 2. Test it: reachability, routing tables, the specific feature you changed. 3. Only when the tests pass, copy running to startup. Leaving startup alone until step 3 means a change that breaks management access can still be undone by power-cycling the device, because it will boot the last configuration you trusted. Saving immediately throws that recovery path away and makes the broken configuration the one the device returns to. The opposite failure is forgetting step 3. The change works, nobody saves it, and months later a power event brings the device back with the old configuration. The usual guard is a check in the automation that compares running with startup, both readable with `<get-config>`: - **startup equals running**: the device will come back as it is now. - **startup lags running**: an unsaved change exists; either it is still under test or someone forgot to save. - **startup differs in a way no recent change explains**: someone copied a different configuration into startup, and the next reboot will apply it. A lag that persists past the end of a change window is the signal worth alerting on, because it is the state that turns a routine power cycle into a configuration rollback nobody asked for. ## Devices without :startup Not every device separates the two. Without `:startup` there is no startup datastore to name and **no save step on the wire**. RFC 8342 says such a device will typically use non-volatile storage so that running itself persists across reboots, but this is how implementations usually behave, not an operation the protocol defines. The capability list in the server's `<hello>` is what tells the client which model applies. ## Other clients on the same device RESTCONF, the HTTP-based sibling of NETCONF, behaves differently. RFC 8040 Section 1.4 says that if the server supports `:startup`, the RESTCONF server must automatically update the startup configuration after running has been altered by a RESTCONF edit. A device managed through both protocols therefore saves on every RESTCONF write but only on an explicit `<copy-config>` from NETCONF, and a NETCONF change committed but not yet saved can be swept into startup by an unrelated RESTCONF edit. Teams that mix the two should know which one owns the save.

  • Can a NETCONF client send <edit-config> with startup as the target?
    Not in the standard editing model. The `:startup` capability adds startup to `<get-config>`, `<copy-config>`, `<lock>`, `<unlock>`, `<validate>` and `<delete-config>`, but not to `<edit-config>`. RFC 8342 Section 4.1 confirms startup is modified only by copying running to it.
  • What does a missing :startup capability tell a NETCONF client about persistence?
    That there is no distinct startup datastore and no save operation to send. RFC 8342 says such a device will typically use non-volatile storage so that running persists across reboots, but that is implementation behaviour. The client should treat a committed change as already persistent and test it before committing.
  • Why might copying running to startup immediately after a change be the wrong default?
    Because an unsaved change has a built-in undo: rebooting the device restores the saved configuration. If the change cuts off management access, that may be the only way back. RFC 6241 Appendix E puts testing before making the change permanent for this reason.

saying these in an interview costs you the question

  • Committing the candidate also writes the change to startup.
  • You save by sending <edit-config> with startup as the target.
  • Every NETCONF device needs an explicit save step after a change.
  • Saving to startup straight after each change is always the safest choice.
  • At reboot the device writes running back into startup.