OcNOS DC : System Management Guide : System Management Configuration : Commit Rollback
Commit Rollback
Overview
The Commit Rollback capability in Common Management Layer Commands (CMLSH) is designed to execute a rollback operation for a set of configurations that were previously committed, with each commit operation identified by a unique commit ID. The Commit ID is numeric value and is generated by the CMLSH Commit, Confirmed Commit and Commit Rollback.
This Commit Rollback application is used for rolling back the commits that are performed after the specified commit ID whether they were executed through either Commit or Confirmed Commit operations.
Here, you find the description for Commit and Confirmed Commit:
Commit operation: Involves committing the candidate configuration to the running configuration.
Confirmed Commit operation: Provides more options to the commit operation with timeout parameter, user could provide timeout for the commit (default is 300 seconds).
During this timeout interval, users can either confirm the commit or cancel it, and if no confirmation or cancellation is provided before the timer expires, commit will be automatically rolled back after timeout.
Commit Rollback Characteristics
The Confirmed-Commit operation temporarily applies the configuration for the duration specified in seconds. If the user does not confirm the configuration within this timeframe, an automatic rollback will be initiated once the timer expires. For committing the configurations with timings, see commit.
Once the configurations are confirmed, users can use the commit rollback operation to revert the configuration, whether it is for a commit operation or a confirmed commit operation.
Benefits
With the integration of CMLSH Commit Rollback with Standard or Confirmed Commit, users can initiate a rollback operation for any specific commit, utilizing the associated commit ID to revert the configurations to their previous state. In this way, reverting to an earlier state, functional configuration is possible in case the new configuration is compromised or if the configuration makes the device unstable.
Prerequisites
Before configuring this operation, enable cml commit-history to ensure the commit records are stored in the commit history list. By default, cml commit-history is enabled. For enabling or disabling it, see cml commit-history (enable | disable).
show commit list
Use this command to display a record of commit operations stored in the commit history list.
Note: For commit records to be stored in the commit history list, enable cml commit-history (enable | disable). Otherwise, commit operations will not be stored.
Command Syntax
show commit list
Parameter
None
Command Mode
Exec mode
Applicability
This command is introduced in OcNOS 6.4.1.
Example
Example for show commit list:
#show commit list
S.No. ID User Client TimeStamp Commit Status Description
~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
1 1684542224876712 ocnos cmlsh 20-05-2023 00:23:44 Confirmed NA
commit-rollback
Use this command to revert configurations to a previously committed stable state. This action will remove configurations made after the provided commit ID (Word).
Note: To use commit-rollback, cml commit-history must be enabled.
Command Syntax
commit-rollback to WORD (description LINE|)
Parameter
Word
Commit ID associated with recorded commit operations stored within the commit- history list.
description LINE
[Optional] Short description about commit-rollback, maximum 65 characters.
Command Mode
Exec mode
Applicability
This command is introduced in OcNOS 6.4.1.
Example
Example output for commit-rollback WORD:
#show commit list
 
S.No. ID User Client TimeStamp Commit Status Description
~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
1 1684542445002144 ocnos cmlsh 20-05-2023 00:27:25 Confirmed NA
 
Example of a Commit Rollback to the Commit List ID 1684542445002144:
#commit-rollback to 1684542445002144 description commit-rollback Test
#show commit list
 
S.No. ID User Client TimeStamp Commit Status Description
~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
1 1684542445002144 ocnos cmlsh 20-05-2023 00:27:25 Confirmed NA
2 1684542402123428 ocnos cmlsh 20-05-2023 00:28:45 Rollback to 20-05-2023 00:27:25 commit-rollback Test
Example of an automatic Commit Rollback
#show commit list
 
S.No. ID User Client TimeStamp Commit Status Description
~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~
#show run router ospf
!
#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
(config)#router ospf 5
(config-router)#router ospf 6
(config-router)#commit confirmed timeout 20 description This is to test auto rollback of config
(config-router)#end
#show commit list
 
S.No. ID User Client TimeStamp Commit Status Description
~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~
1 1698242643599569 root cmlsh 25-10-2023 14:04:03 Remaining Time: 17 This is to test auto rollback of config
 
#show run router ospf
!
router ospf 5
!
router ospf 6
!
#
Warning!!! Confirmed-commit timed out for commitid: 1698242643599569
#show commit list
 
S.No. ID User Client TimeStamp Commit Status Description
~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~
1 1698242643599569 root cmlsh 25-10-2023 14:04:03 Timed-out (Reverted) This is to test auto rollback of config
 
#show run router ospf
!
#
clear cml commit-history (WORD|)
Use this command to delete any specific entry mentioned by commit ID or to delete entire list entries.
Note: To use the commit-rollback operation, the cml commit-history operation must be enabled, and note that commit-rollback cannot be used for deleted entries.
Command Syntax
clear cml commit-history (WORD|)
Parameter
Word
commit ID of the recorded commit operations into commit-history list
Default
When no parameter is provided, the commit history is deleted by default. If you specify the 'Word' parameter, it will delete the specific commit record.
Command Mode
Exec mode
Applicability
This command is introduced in OcNOS 6.4.1.
Example
Example for clear commit using Commit History ID:
#show commit list
 
S.No. ID User Client TimeStamp Commit Status Description
~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
1 1684486018411866 ocnos cmlsh 19-05-2023 08:46:58 Confirmed NA
2 1684486037040268 ocnos cmlsh 19-05-2023 08:47:17 Confirmed
 
#clear cml commit-history 1684486018411866
#show commit list
 
S.No. ID User Client TimeStamp Commit Status Description
~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
1 1684486037040268 ocnos cmlsh 19-05-2023 08:47:17 Confirmed NA
cml commit-history (enable | disable)
Use this command to enable or disable confirmed commit operation (commit-history operation). To verify the state of the operation, use the command show cml commit-history state.
Note:  
By default, cml commit-history operation is enabled.
After disabling the cml commit-history operation, confirmed commit CLIs cannot be used, rendering the commit confirmed, confirm-commit, and cancel-commit operations unavailable.
Command Syntax
cml commit-history (enable | disable)
Parameter
Enable
Enables commit confirmed and commit rollback operations
Disable
Disables commit confirmed and commit rollback operations
Default
By default, commit confirmed and commit rollback operations are enabled.
Command Mode
Exec mode
Applicability
This command is introduced in OcNOS 6.4.1.
Example
Example for enabling Commit History:
#cml commit-history enable
Warning!!! commit-history feature is enabled, confirmed commit and commit-rollback features are available for use.
 
Example for disabling Commit History:
#cml commit-history disable
Warning!!! commit-history feature is disabled, confirmed commit and commit-rollback features can not be used.
cml commit-id rollover (enable | disable)
Use this command to enable or disable commit entry rollover when the maximum count of 50 commit entries is reached. When enabled, older commit entries will be automatically deleted from the commit history list to record new entries.
To verify the state of the operation, use command show cml commit-id rollover state.
Note:  
By default, cml commit-id rollover operation is enabled.
The cml commit-history operation must be enabled to use this operation.
The commit-rollback operation can not be used for deleted entry.
When this operation is disabled and the number of commit entries reaches the maximum count, the addition of commit records to the commit history list will be stopped.
Command Syntax
cml commit-id rollover (enable | disable)
Parameter
Enable
Enables commit ID rollover
Disable
Disables commit ID rollover
Default
By default, commit ID rollover is enabled.
Command Mode
Exec mode
Applicability
This command is introduced in OcNOS 6.4.1.
Example
Example for verifying commit ID rollover state:
#show cml commit-id rollover state
cml commit-id rollover feature is enabled