System Snapshot

A system snapshot is a {<package>, <config>} pair[1], that depicts the state of the system.  An administrator is allowed to save the state of the system to which it is restored at a later stage. For example, before upgrade, before reset etc. A snapshot state is saved on the host file system, and is immune to CDB erase/clear.

Disk space is the only limitation to save number of snapshots.

NOTE: [1] Config refers to the saved binary CDB files, also the config in text form (J-style).


Saving a Snapshot

Command to save snapshot, with an optional description to identify the state:

Command
Example
system create-snapshot description sd-wan-good1 
admin@sys7-vm23-cli> request system create-snapshot description sd-wan-good1
Will remove previous snapshot (if any). Are you sure? [no,yes] y
status System state saved (sd-wan-good1)


Clearing a Snapshot

Command to clear 20151111T123548 snapshot, and to remove it from the disk:

Command
Example
request clear system snapshot name 20151111T123548 
admin@sys7-vm23-cli> request clear system snapshot name 20151111T123548
Will remove the snapshot (this action is irreversible). Are you sure? [no,yes] y
status Snapshot 20151111T123548 removed


Rolling Back to a Snapshot

Rolling back to a snapshot has these two cases:

Case 1: If the snapshot package is the one that is currently running, then replace the CDB.           

Case 2: If the snapshot package is not the one that is currently running, then the snapshotted package has to be installed and the config has to be                       restored. To do this, run request system rollback to 20151111T123832 CLI command:

Example:

admin@sys7-vm23-cli> request system rollback to 20151111T123832
Will revert to a previously saved state (restarts service). Are you sure? [no,yes] y
status  Initiating rollback to: 20151111T123832 (sd-wan-good1)


In both the cases service restart is involved, and notifications are generated for success and failure cases.


Showing Snapshot State

Command to show the details of all snapshots:

Command
Example
show system snapshots
admin@sys7-vm23-cli> show system snapshots
Snapshots (saved good-states)
=============================
------------------------------------------------------
Snapshot: sd-wan-good1
Package : versa-flexvnf-20170614-104452-c36f0a8-17.1R1
Taken at: 20170614T224956
By : User
------------------------------------------------------
Snapshot: FACTORY-DEFAULT
Package : versa-flexvnf-20170614-104452-c36f0a8-17.1R1
Taken at: 20170614T104918
By : System
------------------------------------------------------
Snapshot: PRE-UPGRADE-1
Package : versa-flexvnf-20170524-084400-59e600b-15.2R4
Taken at: 20170524T012559
By : System
[ok][2017-06-14 22:50:03]


The | tab filter is used to display details in tabular form, and | sort-by timestamp filter is used to display details in chronological order.


Deleting a Snapshot

Running a command to remove a package that belongs to the snapshotted state, results in the following error:

admin@sys7-vm23-cli> request system package delete versa-flexvnf-20151101-044617-a82988e-15.2R1.deb
Error: This package is part of snapshot - cannot remove
[error][2015-11-01 05:00:05]


Run request clear system snapshot name 20151111T123832 CLI command to clear the snapshot.


Example:

admin@sys7-vm23-cli> request clear system snapshot name 20151111T123832


After clearing, the snapshot gets removed from the disk.