cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2242
Views
5
Helpful
2
Replies

How to Rollback specific commit

Fantolino
Level 1
Level 1

I understand that rollback nnn revert all the changes since the one referred by nnn.

How can I revert only the changes made by a specific commit?

For example in the following sequence I set the IP address on fastEthernet1/0 and then on FastEthernet 1/1. Then I would like to revert only the first configuration.

 

cisco@ncs% set devices device SDWAN_netsim config ios:interface FastEthernet 1/0 ip address primary address 1.1.1.1 mask 255.255.255.0

[ok][2020-08-28 12:45:20]

 

[edit]

cisco@ncs% commit label SetIf10                                                                                                     Commit complete.

[ok][2020-08-28 12:46:04]

 

[edit]

cisco@ncs% set devices device SDWAN_netsim config ios:interface FastEthernet 1/1 ip address primary address 2.2.2.2 mask 255.255.255.0

[ok][2020-08-28 12:46:13]

 

[edit]

cisco@ncs% commit label SetIf11                                                                                                     Commit complete.

[ok][2020-08-28 12:46:23]

 

[edit]

cisco@ncs% show commit list 5                                                                                                       2020-08-28 12:46:32

SNo. ID       User       Client      Time Stamp          Label       Comment

~~~~ ~~       ~~~~       ~~~~~~      ~~~~~~~~~~          ~~~~~       ~~~~~~~

1327 13274    cisco      cli         2020-08-28 12:46:18 SetIf11

1327 13273    cisco      cli         2020-08-28 12:45:59 SetIf10

1327 13272    cisco      cli         2020-08-28 12:44:34

1327 13271    cisco      cli         2020-08-28 12:42:57 SetIpFastEt

1327 13270    cisco      cli         2020-08-28 12:42:27 SetIpFastEt

[ok][2020-08-28 12:46:32]

 

[edit]

cisco@ncs% rollback 13273

[ok][2020-08-28 12:46:49]

 

[edit]

cisco@ncs% commit dry-run

cli {

    local-node {

        data  devices {

                  device SDWAN_netsim {

                      config {

                          ios:interface {

                              FastEthernet 1/0 {

                                  ip {

                                      no-address {

             +                            address false;

                                      }

                                      address {

                                          primary {

             -                                address 1.1.1.1;

             -                                mask 255.255.255.0;

                                          }

                                      }

                                  }

                              }

                              FastEthernet 1/1 {

                                  ip {

                                      no-address {

             +                            address false;

                                      }

                                      address {

                                          primary {

             -                                address 2.2.2.2;

             -                                mask 255.255.255.0;

                                          }

                                      }

                                  }

                              }

                          }

                      }

                  }

              }

    }

}

[ok][2020-08-28 12:46:54]

1 Accepted Solution

Accepted Solutions

vleijon
Cisco Employee
Cisco Employee

Use rollback selective 12345 for this use-case.

View solution in original post

2 Replies 2

vleijon
Cisco Employee
Cisco Employee

Use rollback selective 12345 for this use-case.

What about python maapi api, how to perform selective rollback in python ?