04-09-2018 07:08 AM
I did "NETCONF/YANG on Nexus" labs and noticed that changes do not get saved to startup-config. NETCONF capabilities of NXOS sandbox do not include ":startup", so <copy-config> operation can not copy running-config to startup-config. What is the other way to save configuration via NETCONF operation?
reported capabilities:
urn:ietf:params:netconf:capability:writable-running:1.0
urn:ietf:params:netconf:capability:rollback-on-error:1.0
urn:ietf:params:netconf:capability:confirmed-commit:1.1
urn:ietf:params:netconf:capability:validate:1.1
urn:ietf:params:netconf:base:1.0
urn:ietf:params:netconf:base:1.1
urn:ietf:params:netconf:capability:candidate:1.0
03-04-2021 02:49 AM
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<save-config xmlns="http://cisco.com/yang/cisco-ia"/>
</rpc>
10-31-2023 07:57 AM
I'd like to snapshot the running config for use as a checkpoint:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<copy-config>
<source>
<running/>
</source>
<target>
<url>file://20231031_Run.txt</url>
</target>
</copy-config>
</rpc>]]>]]>
However, the <url> isn't understood:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <copy-config> <source> <running/> </source> <target> <url>file://20231031_Run.txt</url> <?xml version="1.0" encoding="UTF-8"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101"><rpc-error> <error-type>protocol</error-type> <error-tag>invalid-value</error-tag> <error-severity>error</error-severity> <error-message xml:lang="en">Unsupported capability :url</error-message><error-info><bad-element>url</bad-element> </error-info> </rpc-error> </rpc-reply>]]>]]> </target> </copy-config> </rpc>]]>]]>
Is there another way to save the running config into a text file?
10-31-2023 09:23 AM - edited 10-31-2023 09:38 AM
Hi
<copy-config> is for coping (replacing) configurations between NETCONF datastores, so you can't use this RPC to copy a configuration to the filesystem of your box.
If you want to create a checkpoint and save it to a file - try the "checkpoint" RPC from the Cisco-NX-OS-device model (https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/nx/10.4-1/Cisco-NX-OS-device.yang)
I don't have access to a NX-box at the moment, but it should look something like this:
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<checkpoint xmlns="http://cisco.com/ns/yang/cisco-nx-os-device">
<action>create</action>
<file>bootflash:</file>
</checkpoint>
</rpc>
HTH
Marcel
10-31-2023 09:31 AM
Or do you use another network operating system (XR, XE)?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide