Restoring configuration data files to new versa-director upgrade:

=====================================================


This kb could help in following situations:


1> Customer upgrade failed and unable bring VD back online with exisiting configuration templates.

2> Unsuccessful rollback using snapshot and lost access to VD or unable to recover the configuration files.



Below procedure explains how to install versa director software from shell mode and then move the configuration database to new upgraded VD: This could be handy if you are unable to access VD cli due to issue vsh:


Each time when versa director is upgraded it creates a snapshot and save it under /var/lib/vs/.vs_snap    <<<<.vs_snap file is hidden and you can just type ./ and hit

tab. You can find all the snapshots created under this directory:


admin@versa-director:/var/lib/vs/.vs_snap$ ls -l

total 16

drwxr-xr-x 2 root root 4096 Aug 14 06:28 20180814T062846

drwxr-xr-x 2 root root 4096 Aug 20 11:20 20180820T112033

drwxr-xr-x 2 root root 4096 Aug 20 11:21 20180820T112135

drwxr-xr-x 2 root root 4096 Aug 27 15:59 20180827T155853



admin@versa-director:/var/lib/vs/.vs_snap/20180827T155853$ ls -l

total 36768

-rw-r--r-- 1 root root   320320 Aug 27 15:58 A.cdb

-rw-r--r-- 1 root root 36710931 Aug 27 15:58 C.cdb

-rw-r--r-- 1 root root      179 Aug 27 15:59 meta

-rw-r--r-- 1 root root   327428 Aug 27 15:58 O.cdb

-rw-r--r-- 1 root root   278558 Aug 27 15:59 vnms_pg.dump


you can see the available snapshots from VD cli using the command "show system snapshots"


Administrator@versa-director> show system snapshots


Snapshots (saved good-states)

=============================

------------------------------------------------------

Snapshot: 16.x

Package : versa-director-20171216-072750-43eed63-16.1R2

Taken at: 20180814T062846

------------------------------------------------------

Snapshot: unnamed-snapshot

Package : versa-director-20171216-072750-43eed63-16.1R2

Taken at: 20180820T112033

------------------------------------------------------

Snapshot: PRE-UPGRADE

Package : versa-director-20180505-094901-28a9977-16.1R2S2.2

Taken at: 20180827T155853

------------------------------------------------------

Snapshot: PRE-UPGRADE-OLD

Package : versa-director-20171216-072750-43eed63-16.1R2

Taken at: 20180820T112135




1> Once you have installed the VD software you can follow below procedure to bring all the configuration to VD.


2> Stop vsh services


3> Copy all CDB files to to /var/versa/vnms/ncs/data/ncs/cdb/


admin@versa-director:/var/lib/vs/.vs_snap/20180827T155853$ scp *.cdb /var/versa/vnms/ncs/data/ncs/cdb/


once copied run the following script:


cd /var/lib/vs/.vs_snap/201809749574$ sudo /opt/versa/vnms/scripts/pg-utils.sh  --restore vnms_pg.dump


ALTER ROLE

ALTER ROLE


admin@versa-director:/var/lib/vs/.vs_snap/201809749574$ vsh start                             <<<<<<<<<<start the vsh services



4> You can see the start logs at below location and verify there is no error/exceptions logged.



admin@versa-director:/var/log/vnms/upstart$ tail -f ncs.log                                               <<<<<<<<<<<<logs



5> You can login to vnms database in order to verify your template configuration:


admin@versa-director:/var/log/vnms/upstart$ sudo -u postgres psql   <<<logging with user postgres


postgres=# \c vnms

You are now connected to database "vnms" as user postgres

vnms=# select * from template_metadata;




{You can view below output in notepad++ or use font Courier new}


id |       name        | description |   template_type    | device_type | provider_tenant |      solution_tier       | bandwidth | is_analytics_enabled | is_primary | composite_or_partial |          override          | min_image_version

----+-------------------+-------------+--------------------+-------------+-----------------+--------------------------+-----------+----------------------+------------+----------------------+----------------------------+-------------------

  6 | Tenant1-DataStore |             |                    |             |                 |                          |           | t                    | t          | partial              | override-referred-template |

  7 | Madhu-DataStore   |             |                    |             |                 |                          |           | t                    | t          | partial              | override-referred-template |

  4 | cpe1              |             | sdwan-post-staging | full-mesh   | Tenant1         | advanced-sdwan-plus-ngfw |      1000 | t                    | t          | composite            | override-referred-template |

 10 | Tenant2-DataStore |             |                    |             | Tenant2         | standard-routing         |        10 | t                    | t          | partial              | override-referred-template |

 11 | cpe2              |             | sdwan-post-staging | full-mesh   | Tenant1         | advanced-sdwan-plus-ngfw |      1000 | t                    | t          | composite            | override-referred-template |

(5 rows)




Hope this helps:-)




Regards,

Madhu Uniyal