The compare command in the MD-CLI compares configurations and displays the difference in one output. The command can only be executed from within the configuration context.
[ex:/configure]
A:admin@node-2# compare ?
compare [[from] <string>] [[to] <string>] [[cli-path] <path>]
[[from] <string>]
<string> - (baseline|candidate|rollback <number>|running|startup|booted|
url <string>)
Default - baseline
Source configuration from which to compare
[[to] <string>]
<string> - (baseline|candidate|rollback <number>|running|startup|booted|
url <string>)
Default - candidate
Configuration to compare against source configuration
[cli-path] <path>
<path> - <absolute or relative from pwc>
Absolute path or relative path from pwc
full-context - Show the full context on each line
lines - Number of lines of context to display before and after
summary - Suppress specific differences and display a summary
Choice: output-format
flat :- Show the context from the pwc on each line
netconf-rpc :- Compare changes in NETCONF RPC format
The following characters are used at the beginning of the output lines, to indicate the status of the element in the configuration:
- (minus)
indicates the element is only in the first (from) configuration, displayed first
+ (plus)
indicates the element is only in the second (to) configuration, displayed second
(space)
indicates the element is unchanged
~ (tilde)
new value of the element that changed (only used in the summary option)
{...}
indicates deleted elements compressed to its highest container (only used in the summary option)
*[ex:/configure]
A:admin@node-2# compare
log {
+ accounting-policy 5 {
+ description "For SIO statistics"
+ collection-interval 69
+ include-system-info true
+ record service-ingress-octets
+ }
+ accounting-policy 8 {
+ }
}
Executing compare to running, without specifying the from option is equivalent to compare from running to running, which shows no differences.
*[ex:/configure]
A:admin@node-2# compare to running
*[ex:/configure]
A:admin@node-2# compare to candidate
log {
+ accounting-policy 5 {
+ description "For SIO statistics"
+ collection-interval 69
+ include-system-info true
+ record service-ingress-octets
+ }
+ accounting-policy 8 {
+ }
}
*[ex:/configure]
A:admin@node-2# compare from running to candidate
log {
+ accounting-policy 5 {
+ description "For SIO statistics"
+ collection-interval 69
+ include-system-info true
+ record service-ingress-octets
+ }
+ accounting-policy 8 {
+ }
}
*[ex:/configure]
A:admin@node-2# compare flat
+ log { accounting-policy 5 }
+ log accounting-policy 5 description "For SIO statistics"
+ log accounting-policy 5 collection-interval 69
+ log accounting-policy 5 include-system-info true
+ log accounting-policy 5 record service-ingress-octets
+ log { accounting-policy 8 }
*[ex:/configure]
A:admin@node-2# compare full-context
+ /configure log { accounting-policy 5 }
+ /configure log accounting-policy 5 description "For SIO statistics"
+ /configure log accounting-policy 5 collection-interval 69
+ /configure log accounting-policy 5 include-system-info true
+ /configure log accounting-policy 5 record service-ingress-octets
+ /configure log { accounting-policy 8 }
*[ex:/configure]
A:admin@node-2#
The following example shows the difference between the compare and compare summary commands. The compare command shows the deletion and addition of configuration changes, each on its own line, and the compare summary command shows the configuration change summarized on one line with a ~ character.
*(ex)[/]
A:admin@node-2# compare
router "Base" {
interface "system" {
ipv4 {
primary {
- address 10.1.1.1
+ address 10.243.5.96
}
}
}
}
*(ex)[/]
A:admin@node-2# compare summary
router "Base" {
interface "system" {
ipv4 {
primary {
~ address 10.243.5.96
}
}
}
}
*[ex:/configure policy-options policy-statement "example-policy-statement"]
A:admin@node-2# compare summary
~ insert named-entry "two" after "one"
~ insert named-entry "three" after "two"
+ named-entry "two" {
+ description "Example addition"
+ action {
+ action-type accept
+ }
+ }
The following example shows the use of the summary netconf-rpc keywords with the compare command to generate an RPC that is used in a network automation environment to achieve the required configuration changes.
*[ex:/configure policy-options policy-statement "example-policy-statement"]
A:admin@node-2# compare netconf-rpc summary
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:yang="urn:ietf:params:xml:ns:yang:1">
<edit-config>
<target><candidate/></target>
<config>
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
<policy-options>
<policy-statement>
<name>example-policy-statement</name>
<named-entry operation="merge" yang:insert="after" yang:key="[entry-name='one']">
<entry-name>two</entry-name>
</named-entry>
<named-entry operation="merge" yang:insert="after" yang:key="[entry-name='two']">
<entry-name>three</entry-name>
</named-entry>
<named-entry>
<entry-name>two</entry-name>
<description>Example addition</description>
<action>
<action-type>accept</action-type>
</action>
</named-entry>
</policy-statement>
</policy-options>
</configure>
</config>
</edit-config>
</rpc>
The use of the summary netconf-rpc options with the compare command provides an edit-config NETCONF RPC back to the YANG modeled root of the tree. With third-party YANG models, such as OpenConfig, the output is displayed when the compare summary netconf-rpc command is executed from within the /configure openconfig branch (or sub-branches) or from the absolute root (/). That is, third-party models are not shown when the command is executed with the /configure path.
*[ex:/configure]
A:admin@node-2# compare summary
system {
~ name "newtest"
}
+ openconfig {
+ lldp {
+ config {
+ hello-timer 99
+ }
+ }
+ }
*[ex:/configure]
A:admin@node-2# compare summary netconf-rpc
<rpc message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:yang="urn:ietf:params:xml:ns:yang:1">
<edit-config>
<target><candidate/></target>
<config>
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
<system>
<name>newtest</name>
</system>
</configure>
</config>
</edit-config>
</rpc>
*[ex:/configure]
A:admin@node-2# compare summary netconf-rpc /configure
<rpc message-id="4" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:yang="urn:ietf:params:xml:ns:yang:1">
<edit-config>
<target><candidate/></target>
<config>
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
<system>
<name>newtest</name>
</system>
</configure>
</config>
</edit-config>
</rpc>
*[ex:/configure]
A:admin@node-2# compare summary netconf-rpc /
<rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:yang="urn:ietf:params:xml:ns:yang:1">
<edit-config>
<target><candidate/></target>
<config>
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
<system>
<name>newtest</name>
</system>
</configure>
<lldp xmlns="http://openconfig.net/yang/lldp">
<config>
<hello-timer>99</hello-timer>
</config>
</lldp>
</config>
</edit-config>
</rpc>
*[ex:/configure openconfig]
A:admin@node-2# compare summary netconf-rpc
<rpc message-id="6" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:yang="urn:ietf:params:xml:ns:yang:1">
<edit-config>
<target><candidate/></target>
<config>
<lldp xmlns="http://openconfig.net/yang/lldp">
<config>
<hello-timer>99</hello-timer>
</config>
</lldp>
</config>
</edit-config>
</rpc>
In the following example, the compare command shows the timers that have been modified. After the commit command has been issued to add these to the running configuration, the lsa-generate container is deleted.
*[ex:/configure router "Base" ospf 0 timers]
A:admin@node-2# compare
+ lsa-generate {
+ max-lsa-wait 500000
+ lsa-initial-wait 100000
+ lsa-second-wait 200000
+ }
+ spf-wait {
+ spf-max-wait 120000
+ spf-initial-wait 50000
+ spf-second-wait 60000
+ }
The compare command, using the candidate configuration as the reference, displays the same configuration statements with a preceding minus (-) character. These statements are used in a subsequent copy and paste function to delete some of the configuration. The minus (-) character at the beginning of the configuration statement takes the place of the delete keyword.
*[ex:/configure router "Base" ospf 0 timers]
A:admin@node-2# compare from candidate to running full-context
- /configure router "Base" ospf 0 timers lsa-generate max-lsa-wait 500000
- /configure router "Base" ospf 0 timers lsa-generate lsa-initial-wait 100000
- /configure router "Base" ospf 0 timers lsa-generate lsa-second-wait 200000
- /configure router "Base" ospf 0 timers spf-wait spf-max-wait 120000
- /configure router "Base" ospf 0 timers spf-wait spf-initial-wait 50000
- /configure router "Base" ospf 0 timers spf-wait spf-second-wait 60000
*[ex:/configure router "Base" ospf 0 timers]
A:admin@node-2# validate
*[ex:/configure router "Base" ospf 0 timers]
A:admin@node-2# commit
In the next step, the lsa-generate commands are deleted, using a copy and paste of the first three configuration statements:
[ex:/configure]
A:admin@node-2# - /configure router "Base" ospf 0 timers lsa-generate max-lsa-wait 500000
*[ex:/configure]
A:admin@node-2# - /configure router "Base" ospf 0 timers lsa-generate lsa-initial-wait 100000
*[ex:/configure]
A:admin@node-2# - /configure router "Base" ospf 0 timers lsa-generate lsa-second-wait 200000
The compare summary command shows that the deleted lsa-generate parameters are compressed to its highest container, shown with an ellipsis in braces ({}).
*[ex:/configure]
A:admin@node-2# compare summary
router "Base" {
ospf 0 {
timers {
- lsa-generate { ... }
}
}
}
If the timers container is deleted, which holds both the lsa-generate and spf-wait containers, the compare summary command now shows the timers container as the highest deleted container.
*[ex:/configure router "Base" ospf 0]
A:admin@node-2# delete timers
*[ex:configure router "Base" ospf 0]
A:admin@node-2# compare
- timers {
- lsa-generate {
- max-lsa-wait 500000
- lsa-initial-wait 100000
- lsa-second-wait 200000
- }
- spf-wait {
- spf-max-wait 120000
- spf-initial-wait 50000
- spf-second-wait 60000
- }
- }
*[ex:/configure router "Base" ospf 0]
A:admin@node-2# compare summary
- timers { ... }
*[ex:/configure router "Base" ospf 0]
A:admin@node-2#
The discard command in configuration mode cancels changes made to the candidate configuration without impacting the running configuration or applications. The command is available only when the MD-CLI session is in a read/write configuration mode (private, exclusive, or global configuration mode).
An error message is displayed when the discard operation is attempted from read-only configuration mode.
*(ro)[/configure]
A:admin@node-2# compare
log {
+ accounting-policy 5 {
+ description "For SIO statistics"
+ collection-interval 69
+ include-system-info true
+ record service-ingress-octets
+ }
+ accounting-policy 8 {
+ }
}
*(ro)[/configure]
A:admin@node-2# discard
MINOR: CLI #2069: Operation not allowed - currently in read-only mode
Uncommitted changes from a global configuration session are kept in the candidate configuration when leaving configuration mode. Uncommitted changes from an exclusive or private configuration session are discarded when leaving configuration mode and a confirmation message is displayed:
*(ex)[/]
A:admin@node-2# quit-config
INFO: CLI #2063: Uncommitted changes are present in the candidate configuration.
Exiting exclusive configuration mode will discard those changes.
Discard uncommitted changes? [y,n] y
WARNING: CLI #2062: Exiting exclusive configuration mode - uncommitted changes are discarded
INFO: CLI #2064: Exiting exclusive configuration mode
The discard command accepts a path parameter on the input line to discard candidate changes starting from the specified path. If a path is not specified, the command discards candidate changes from the present working context.
*[ex:/configure system]
A:admin@node-2# discard ?
discard [[cli-path] <path>]
[cli-path] <path>
<path> - <absolute or relative from pwc>
Absolute path or relative path from pwc
In the following example, from the configure system context, the configure router ‟Base” bgp candidate changes can be discarded by specifying the absolute path.
*[ex:/configure system]
A:admin@node-2# compare /configure
log {
+ log-id 55 {
+ }
}
+ router "Base" {
+ bgp {
+ group "group-1" {
+ admin-state enable
+ connect-retry 999
+ }
+ }
+ }
system {
- name "node-2"
+ name "test-name"
}
*[ex:/configure system]
A:admin@node-2# discard /configure router "Base" bgp
*[ex:/configure system]
A:admin@node-2# compare /configure
log {
+ log-id 55 {
+ }
}
system {
- name "node-2"
+ name "test-name"
}
From the configure system context, issuing the discard command without a path parameter removes candidate changes starting from the configure system context (the present working context).
*[ex:/configure system]
A:admin@node-2# compare /configure
log {
+ log-id 55 {
+ }
}
system {
- name "node-2"
+ name "test-name"
}
*[ex:/configure system]
A:admin@node-2# discard
*[ex:/configure system]
A:admin@node-2# compare /configure
log {
+ log-id 55 {
+ }
}
Changes made by a session that obtained an explicit lock can be discarded by disconnecting the remote session. Uncommitted changes from an exclusive configuration mode session are discarded when the session disconnects. See Viewing the status of the local datastores for information about disconnecting a session.
The validate command verifies the logic, constraints, and completeness of the candidate configuration without activating any changes. A successful validation returns no errors. If the validation fails, detailed failure reasons are provided. The validate command can be executed from any working directory and in any configuration mode.
*(ro)[/]
A:admin@node-2# compare
log {
+ accounting-policy 7 {
+ description "seven"
+ collection-interval 77
+ }
}
*(ro)[/]
A:admin@node-2# validate
*(ro)[/]
*(ex)[/]
A:admin@node-2# compare
+ eth-cfm {
+ domain "mdn" {
+ association "man" {
+ ccm-interval 10ms
+ }
+ }
+ }
*(ex)[/]
A:admin@node-2# validate
MINOR: MGMT_CORE #236: configure eth-cfm domain "mdn" level - Missing mandatory fields
MINOR: ETH_CFM #12: configure eth-cfm domain "mdn" format - Inconsistent Value error - One of dns, mac, name or format must be provided
*(ex)[/]
A:admin@node-2#
The commit command also runs validation on the configuration. Therefore, it is not necessary to execute the validate command as a separate step when committing the candidate configuration.
As described in Multiple simultaneous candidate configurations, a candidate configuration uses two datastores:
a baseline datastore that contains a snapshot copy of the running configuration at a specific time
a candidate datastore that contains changes relative to its associated baseline datastore
For a private candidate configuration, access by MD-CLI sessions in private configuration mode, a snapshot of the running configuration is copied in the private baseline datastore:
when a private candidate configuration is instantiated, when a user enters the private configuration mode
when a manual update is performed
after a commit, when no merge conflicts are detected during the automatic update and the updated candidate configuration is valid
For the global candidate configuration, accessed by MD-CLI sessions in global and exclusive configuration mode, a tracking mechanism exists.
The baseline datastore tracks the running datastore, that is, changes in the running datastore are automatically copied in the baseline datastore:
after a router reboot
after a successful commit
after a discard with an up-to-date global baseline
Tracking stops and a snapshot of the running datastore is copied in the global baseline datastore when the global candidate is touched (for example, a configuration element is added, deleted, or modified). A new snapshot of the running datastore is copied in the global baseline datastore when a manual update is performed.
With two simultaneous active configuration sessions that access different candidate configurations, a commit from one configuration session changes the running configuration and causes the candidate configuration of the other session to be out of date and must be updated.
To update a candidate configuration, the following tasks are performed:
A new snapshot of the running configuration is copied in the baseline datastore.
The candidate configuration changes are merged in the new baseline:
The changes in the candidate datastore are applied to the new baseline datastore.
Merge conflicts are detected and resolved. A merge conflict occurs when a configuration element is added, deleted, or modified in the candidate configuration and the same configuration element was also added, deleted, or modified in the running configuration after the baseline snapshot was taken.
The resulting changes are stored in the candidate datastore as new changes relative to the updated baseline.
An update can be performed manually with the update command. The update must be executed at the configuration root (/configure). Merge conflicts are reported and resolved according to the conflict resolution rules. The update command does not provide output when no conflicts are detected.
+ /configure router "Base" interface "int-1" ipv4 primary address 10.2.3.4
## address - exists with different value: address 10.1.2.3 - change updated: replace existing value
The first line lists the candidate configuration change that caused the merge conflict, in this case, adding an interface IPv4 address.
The second line describes the merge conflict and starts with a double hash (##) followed by the description:
A merge conflict is detected for the configuration element address.
The address already exists in the running configuration, but has a different value.
The candidate configuration change as shown on the first line is updated; instead of adding an interface address, the interface address is replaced.
An update is automatically started when the candidate configuration is committed. The commit is canceled when merge conflicts are detected to give the administrator the opportunity to resolve the conflicts before committing again. The update, in this case, is not executed, the candidate configuration is unchanged, and the baseline datastore is not updated.
The update check command performs a dry-run update of the candidate configuration. Merge conflicts are reported the same way as for the update command, but the update is not executed. The update check command must be executed at the configuration root (/configure) or it can be executed in any configure branch descendant as update check /configure.
The private candidate configuration of user-1 is out of date. The running configuration has interface backbone-1 configured. The private baseline datastore does not have the interface configured. The interface backbone-1 configured by user-1 has a different address in its candidate configuration.
!*[pr:/configure router "Base"]
A:user-1@node-2# info running
interface "backbone-1" {
ipv4 {
primary {
address 192.168.2.2
prefix-length 24
}
}
}
!*[pr:/configure router "Base"]
A:user-1@node-2# info baseline
!*[pr:/configure router "Base"]
A:user-1@node-2# info
interface "backbone-1" {
ipv4 {
primary {
address 192.168.1.1
prefix-length 24
}
}
}
The following is a list of changes entered in the private candidate configuration of user-1.
!*[pr:/configure router "Base"]
A:user-1@node-2# compare baseline candidate full-context summary
+ /configure router "Base" interface "backbone-1" { }
+ /configure router "Base" interface "backbone-1" { ipv4 primary }
+ /configure router "Base" interface "backbone-1" ipv4 primary address 192.168.1.1
+ /configure router "Base" interface "backbone-1" ipv4 primary prefix-length 24
A commit command starts an automatic update. Because merge conflicts are detected, the commit is canceled:
!*[pr:/configure router "Base"]
A:user-1@node-2# commit
MINOR: MGMT_CORE #2703: Commit canceled - conflicts detected, use update
A dry-run update detects the merge conflicts without executing the update. Each configuration element that is changed in both the candidate configuration and the running configuration after the last baseline snapshot was taken results in a conflict and is reported.
!*[pr:/configure]
A:user-1@node-2# update check
+ /configure router "Base" { interface "backbone-1" }
## interface "backbone-1" { } - already exists - change removed
+ /configure router "Base" { interface "backbone-1" ipv4 primary }
## primary { } - already exists - change removed
+ /configure router "Base" interface "backbone-1" ipv4 primary address 192.168.1.1
## address - exists with different value: address 192.168.2.2 - change updated: replace existing value
+ /configure router "Base" interface "backbone-1" ipv4 primary prefix-length 24
## prefix-length - exists with same value - change removed
After verifying that the merge conflict resolution is acceptable, the update can be executed. The reporting is the same as for a dry-run update.
!*[pr:/configure]
A:user-1@node-2# update
+ /configure router "Base" { interface "backbone-1" }
## interface "backbone-1" { } - already exists - change removed
+ /configure router "Base" { interface "backbone-1" ipv4 primary }
## primary { } - already exists - change removed
+ /configure router "Base" interface "backbone-1" ipv4 primary address 192.168.1.1
## address - exists with different value: address 192.168.2.2 - change updated: replace existing value
+ /configure router "Base" interface "backbone-1" ipv4 primary prefix-length 24
## prefix-length - exists with same value - change removed
The candidate configuration is now updated: the baseline datastore equals the running datastore and the candidate datastore contains the updated list of changes as described in the update report.
*[pr:/configure router "Base"]
A:user-1@node-2# compare baseline candidate
interface "backbone-1" {
ipv4 {
primary {
- address 192.168.2.2
+ address 192.168.1.1
}
}
}
*[pr:/configure router "Base"]
A:user-1@node-2# info
interface "backbone-1" {
ipv4 {
primary {
address 192.168.1.1
prefix-length 24
}
}
}
*[pr:/configure router "Base"]
A:user-1@node-2# info baseline
interface "backbone-1" {
ipv4 {
primary {
address 192.168.2.2
prefix-length 24
}
}
}
*[pr:/configure router "Base"]
A:user-1@node-2# info running
interface "backbone-1" {
ipv4 {
primary {
address 192.168.2.2
prefix-length 24
}
}
}
The private candidate configuration of user-1 is out-of-date. The running configuration has interface backbone-1 configured. The private baseline datastore does not have the interface configured. The interface backbone-2 is configured by user-1.
!*[pr:/configure router "Base"]
A:user-1@node-2# info running
interface "backbone-1" {
ipv4 {
primary {
address 192.168.1.1
prefix-length 24
}
}
}
!*[pr:/configure router "Base"]
A:user-1@node-2# info baseline
!*[pr:/configure router "Base"]
A:user-1@node-2# info
interface "backbone-2" {
ipv4 {
primary {
address 192.168.2.2
prefix-length 24
}
}
}
The following shows the list of changes entered in the private candidate configuration of user-1.
!*[pr:/configure]
A:user-1@node-2# compare baseline candidate full-context summary
+ /configure router "Base" { }
+ /configure router "Base" { interface "backbone-2" }
+ /configure router "Base" { interface "backbone-2" ipv4 primary }
+ /configure router "Base" interface "backbone-2" ipv4 primary address 192.168.2.2
+ /configure router "Base" interface "backbone-2" ipv4 primary prefix-length 24
A dry-run update detects merge conflicts without executing the update. There are no conflicts detected in this case.
!*[pr:/configure]
A:user-1@node-2# update check
!*[pr:/configure]
A:user-1@node-2#
A commit operation starts an automatic update. Without merge conflicts, the commit succeeds.
!*[pr:/configure]
A:user-1@node-2# commit
[pr:/configure]
A:user-1@node-2#
After a commit operation, the candidate configuration is updated; the baseline datastore equals the running datastore and the candidate datastore is empty.
[pr:/configure]
A:user-1@node-2# compare baseline candidate
[pr:/configure]
A:user-1@node-2# compare baseline running
[pr:/configure router "Base"]
A:user-1@node-2# info
interface "backbone-1" {
ipv4 {
primary {
address 192.168.1.1
prefix-length 24
}
}
}
interface "backbone-2" {
ipv4 {
primary {
address 192.168.2.2
prefix-length 24
}
}
}
The commit command can be executed from any hierarchy level within any configuration branch.
[ex:/configure]
A:admin@node-2# commit ?
commit
comment - Comment associated with the commit
confirmed + Require explicit confirmation for changes to apply
[ex:/configure]
A:admin@node-2# commit confirmed ?
confirmed
[timeout] <number>
<number> - <1..65535> - minutes
Default - 10
Commit expiration timeout interval
persist-id - Persistent confirmed commit ID
Choice: confirmed-choice
accept :- Confirm an ongoing confirmed commit
cancel :- Cancel an ongoing confirmed commit issued and roll back
[timeout] :- Commit expiration timeout interval
When a commit operation is initiated while the baseline is out-of-date, the router first attempts to update the candidate configuration. If a merge conflict is detected, the commit operation is canceled to allow the administrator to resolve the merge conflicts manually.
!*[pr:/configure]
A:admin@node-2# commit
MINOR: MGMT_CORE #2703: Commit canceled - conflicts detected, use update
!*[pr:/configure]
A:admin@node-2#
The update is executed and the commit operation proceeds when no merge conflict is detected. See Updating the candidate configuration for information about the update process.
Validation is subsequently performed on the candidate configuration.
With a successful validation, the changes are copied to the running configuration, which becomes the current, operational router configuration. The candidate configuration is reset to its initial state; an empty candidate datastore and an up-to-date baseline.
If the commit operation fails, an automatic rollback occurs, which returns the running state to the state before the commit was applied. An automatic rollback does not use a rollback checkpoint file, so is not dependent on persistency to be enabled. Instead, a list of changes is kept in memory until the automatic rollback is completed. The uncommitted changes remain in the candidate configuration.
For information about the commit history, see the 7450 ESS, 7750 SR, 7950 XRS, and VSR System Management Guide, "Commit History" section.
[pr:/configure system time]
A:admin@node-2# info
prefer-local-time true
[pr:/configure system time]
A:admin@node-2# prefer-local-time false
*[pr:/configure system time]
A:admin@node-2# commit comment "Revert to use UTC time."
[pr:/configure system time]
A:admin@node-2# info
prefer-local-time false
Executing the commit command with no options performs the operation immediately. the confirmed option can be used to activate configuration changes without making them persistent, to give the user time to verify that the configuration is working as intended. By default, the commit confirmed command executes the commit operation with an automatic rollback of 10 minutes. Within this time, an explicit confirmation (commit confirmed accept) must be issued for the changes to become persistent. Other configuration commands issued during this time interval are blocked.
While the commit confirmed timer is running, the remaining time before an automatic rollback is shown before each prompt of all active MD-CLI sessions.
*[ex:/configure log accounting-policy 5]
A:admin@node-2# commit confirmed
INFO: CLI #2090: Commit confirmed - automatic rollback in 9 minutes 59 seconds
[ex:/configure log accounting-policy 5]
A:admin@node-2#
INFO: CLI #2090: Commit confirmed - automatic rollback in 9 minutes 47 seconds
[ex:/configure log accounting-policy 5]
A:admin@node-2# pwc
Present Working Context:
configure
log
accounting-policy 5
INFO: CLI #2090: Commit confirmed - automatic rollback in 9 minutes 45 seconds
[ex:/configure log accounting-policy 5]
A:admin@node-2# back
INFO: CLI #2090: Commit confirmed - automatic rollback in 9 minutes 41 seconds
[ex:/configure log]
A:admin@node-2# accounting-policy 9
MINOR: MGMT_CORE #2604: Commit confirmed in progress - changes to the candidate configuration are not allowed
INFO: CLI #2090: Commit confirmed - automatic rollback in 9 minutes 38 seconds
[ex:/configure log]
A:admin@node-2#
INFO: CLI #2090: Commit confirmed - automatic rollback in 8 minutes 44 seconds
[ex:/configure log]
A:admin@node-2#
If the initial commit fails, the commit confirmed operation is canceled and no timer is started.
*[ex:/configure log accounting-policy 5]
A:admin@node-2# collection-interval 3
*[ex:/configure log accounting-policy 5]
A:admin@node-2# commit confirmed
MINOR: LOG #12: configure log accounting-policy 5 collection-interval - Inconsistent Value error - Minimum value is 5 minutes for this record type.
*[ex:/configure log accounting-policy 5]
A:admin@node-2#
The timeout option for the commit confirmed operation can override the default value of 10 minutes. While a commit confirmed timer is running, a subsequent commit confirmed or commit confirmed operation with a timeout option restarts the timer.
*[ex:/configure log accounting-policy 5]
A:admin@node-2# commit confirmed
INFO: CLI #2090: Commit confirmed - automatic rollback in 10 minutes
[ex:/configure log accounting-policy 5]
A:admin@node-2# commit confirmed 33
INFO: CLI #2090: Commit confirmed - automatic rollback in 33 minutes
[ex:/configure log accounting-policy 5]
A:admin@node-2#
After the commit confirmed operation is underway, the timer starts. A commit confirmed cancel command terminates an ongoing confirmed commit and immediately performs an automatic rollback to the previous state before the initial commit confirmed command was issued.
If the commit confirmed accept command is not issued within the specified timeout period after a successful commit, all changes are automatically discarded from the running configuration. If the configuration session from which the commit confirmed was initiated is still active, the candidate configuration maintains all uncommitted configuration changes.
The commit confirmed and commit confirmed accept or commit confirmed cancel commands must be executed from the same MD-CLI configuration session. Commit commands executed from another configuration session while the commit confirmed timer is running generate an error.
Leaving the configuration mode or logging out from the MD-CLI session cancels the ongoing commit confirmed and starts an automatic rollback. The user must acknowledge the request to exit configuration mode or logout.
*(ex)[/]
A:admin@node-2# commit confirmed
INFO: CLI #2090: Commit confirmed - automatic rollback in 10 minutes
(ex)[/]
A:admin@test-node# exit all
INFO: CLI #2090: Commit confirmed - automatic rollback in 9 minutes 55 seconds
(ex)[/]
A:admin@test-node# quit-config
INFO: CLI #2095: Commit confirmed in progress - exiting configuration mode will cancel the commit confirmed and start configuration rollback
Cancel commit confirmed and rollback immediately? [y,n] n
INFO: CLI #2076: Exit global configuration mode canceled
INFO: CLI #2090: Commit confirmed - automatic rollback in 9 minutes 48 seconds
(ex)[/]
A:admin@test-node# logout
INFO: CLI #2095: Commit confirmed in progress - logout will cancel the commit confirmed and start configuration rollback
Cancel commit confirmed and rollback immediately? [y,n] y
WARNING: CLI #2077: Exiting global configuration mode - commit confirmed canceled
INFO: CLI #2057: Uncommitted changes are kept in the candidate configuration
A persistence identifier can be specified with the initial commit confirmed command. A commit confirmed accept or cancel command can then be executed from the same or a different MD-CLI configuration or NETCONF session, from where the commit confirmed persist-id command was initiated. The persistence identifier must then be included with the subsequent commit confirmed commands. The persistence identifier is a user-defined string of up to 255 characters or an empty string (‟”).
*[ex:/configure]
A:admin@node-2# commit confirmed persist-id my-commit
INFO: CLI #2090: Commit confirmed - automatic rollback in 10 minutes
[ex:/configure]
A:admin@node-2# commit confirmed cancel
MINOR: MGMT_CORE #2603: Commit confirmed - persist-id expected
INFO: CLI #2090: Commit confirmed - automatic rollback in 9 minutes 53 seconds
[ex:/configure]
A:admin@node-2# commit confirmed accept
MINOR: MGMT_CORE #2603: Commit confirmed - persist-id expected
INFO: CLI #2090: Commit confirmed - automatic rollback in 9 minutes 45 seconds
[ex:/configure]
A:admin@node-2# commit confirmed cancel persist-id my-commit
*[ex:/configure]
A:admin@node-2#