How to backup VCS Configuration
The Veritas Cluster Server (VCS) stores it's configuration data and customer agents in a series of locations. As these fules are the backbone of the cluster environment it is very important to backup these fules ensuring that you can perform a cluster recovery in any case of disaster.
VCS utilises the hasnap
utility to manage cluster configuration backups and when used with various options a point in time snapshot of the cluster configuration is taken.
Configuration Locations
VCS stores the configuration under
- /etc
- /etc/VRTSvcs/conf/config
- /opt/VRTSvcs/bin
Taking a snapshot
Syntax:
hasnap -backup [-f <filename>] [-n] [-m comment]
Where:
- Use the
-n
option to run the command in the non-interactive mode - Use the
-m
to specify a description of the snapshot
For example:
# hasnap -backup -f /backups/sunlab1-20060825.zip -n -m "Backup 25/08/2996" Starting Configuration Backup for Cluster sunlab1 Dumping the configuration... Registering snapshot "sunlab1-2006.08.25-1156511358610" Contacting host labnode1... Error connecting to the remote host "labnode1" Starting backup of files on host labnode2 "/etc/VRTSvcs/conf/config/types.cf" ----> 1.0 "/etc/VRTSvcs/conf/config/main.cf" ----> 1.0 "/etc/VRTSvcs/conf/config/vcsApacheTypes.cf" ----> 1.0 "/etc/llthosts" ----> 1.0 "/etc/gabtab" ----> 1.0 "/etc/llttab" ----> 1.0 "/opt/VRTSvcs/bin/vcsenv" ----> 1.0 "/opt/VRTSvcs/bin/LVMVolumeGroup/monitor" ----> 1.0 "/opt/VRTSvcs/bin/LVMVolumeGroup/offline" ----> 1.0 "/opt/VRTSvcs/bin/LVMVolumeGroup/online" ----> 1.0 "/opt/VRTSvcs/bin/LVMVolumeGroup/clean" ----> 1.0 "/opt/VRTSvcs/bin/ScriptAgent" ----> 1.0 "/opt/VRTSvcs/bin/LVMVolumeGroup/LVMVolumeGroup.xml" ----> 1.0 "/opt/VRTSvcs/bin/RVGSnapshot/fdsched" ----> 1.0 "/opt/VRTSvcs/bin/RVGSnapshot/monitor" ----> 1.0 "/opt/VRTSvcs/bin/RVGSnapshot/fdsetup.vxg" ----> 1.0 "/opt/VRTSvcs/bin/RVGSnapshot/open" ----> 1.0 "/opt/VRTSvcs/bin/ScriptAgent" ----> 1.0 "/opt/VRTSvcs/bin/RVGSnapshot/RVGSnapshotAgent.pm" ----> 1.0 "/opt/VRTSvcs/bin/RVGSnapshot/RVGSnapshot.xml" ----> 1.0 "/opt/VRTSvcs/bin/RVGSnapshot/offline" ----> 1.0 "/opt/VRTSvcs/bin/RVGSnapshot/online" ----> 1.0 "/opt/VRTSvcs/bin/RVGSnapshot/attr_changed" ----> 1.0 "/opt/VRTSvcs/bin/RVGSnapshot/clean" ----> 1.0 "/opt/VRTSvcs/bin/RVGPrimary/monitor" ----> 1.0 "/opt/VRTSvcs/bin/RVGPrimary/open" ----> 1.0 "/opt/VRTSvcs/bin/RVGPrimary/RVGPrimary.xml" ----> 1.0 "/opt/VRTSvcs/bin/RVGPrimary/offline" ----> 1.0 "/opt/VRTSvcs/bin/RVGPrimary/online" ----> 1.0 "/opt/VRTSvcs/bin/RVGPrimary/clean" ----> 1.0 "/opt/VRTSvcs/bin/ScriptAgent" ----> 1.0 "/opt/VRTSvcs/bin/RVGPrimary/actions/fbsync" ----> 1.0 "/opt/VRTSvcs/bin/triggers/violation" ----> 1.0 "/opt/VRTSvcs/bin/CampusCluster/monitor" ----> 1.0 "/opt/VRTSvcs/bin/CampusCluster/close" ----> 1.0 "/opt/VRTSvcs/bin/ScriptAgent" ----> 1.0 "/opt/VRTSvcs/bin/CampusCluster/open" ----> 1.0 "/opt/VRTSvcs/bin/CampusCluster/CampusCluster.xml" ----> 1.0 "/opt/VRTSvcs/bin/RVG/monitor" ----> 1.0 "/opt/VRTSvcs/bin/RVG/info" ----> 1.0 "/opt/VRTSvcs/bin/ScriptAgent" ----> 1.0 "/opt/VRTSvcs/bin/RVG/RVG.xml" ----> 1.0 "/opt/VRTSvcs/bin/RVG/offline" ----> 1.0 "/opt/VRTSvcs/bin/RVG/online" ----> 1.0 "/opt/VRTSvcs/bin/RVG/clean" ----> 1.0 "/opt/VRTSvcs/bin/internal_triggers/cpuusage" ----> 1.0 Backup of files on host labnode2 complete Backup succeeded partially
Viewing snapshot files
Use the hasnap -display
command to view details of previously created snapshots.
Syntax:
hasnap -display [-f <filename>] [-list|-s snapid] [-m] [-l] [-t]
Where:
-list
displays the list of snapshots in the repository-s
specifies the snapshot ID-m
displays snapshot description-l
lists the files in the snapshot-t
displays the snapshot timestamp
If no options are specified the commands displays all information about the latest snapshot
Snapshot integrity
To check the contents of the snapshot, use the unzip
utility with the -t
flag to test compressed archive data:
Syntax:
unzip -t <filename>
For example:
# unzip -t /backups/sunlab1-20060825.zip Archive: sunlab1-20060825.zip Archive: sunlab1-20060825.zip testing: /cat_vcs.zip OK testing: /categorylist.xml.zip OK testing: _repository__data/vcs/sunlab1/labnode2/etc/VRTSvcs/conf/config/types.cf.zip OK testing: _repository__data/vcs/sunlab1/labnode2/etc/VRTSvcs/conf/config/main.cf.zip OK testing: _repository__data/vcs/sunlab1/labnode2/etc/VRTSvcs/conf/config/vcsApacheTypes.cf.zip OK testing: _repository__data/vcs/sunlab1/labnode2/etc/llthosts.zip OK testing: _repository__data/vcs/sunlab1/labnode2/etc/gabtab.zip OK testing: _repository__data/vcs/sunlab1/labnode2/etc/llttab.zip OK testing: _repository__data/vcs/sunlab1/labnode2/opt/VRTSvcs/bin/vcsenv.zip OK testing: _repository__data/vcs/sunlab1/labnode2/opt/VRTSvcs/bin/LVMVolumeGroup/monitor.zip OK testing: _repository__data/vcs/sunlab1/labnode2/opt/VRTSvcs/bin/LVMVolumeGroup/offline.zip OK testing: _repository__data/vcs/sunlab1/labnode2/opt/VRTSvcs/bin/LVMVolumeGroup/online.zip OK testing: _repository__data/vcs/sunlab1/labnode2/opt/VRTSvcs/bin/LVMVolumeGroup/clean.zip OK testing: _repository__data/vcs/sunlab1/labnode2/opt/VRTSvcs/bin/LVMVolumeGroup/LVMVolumeGroupAgent.zip OK testing: _repository__data/vcs/sunlab1/labnode2/opt/VRTSvcs/bin/LVMVolumeGroup/LVMVolumeGroup.xml.zip OK testing: _repository__data/vcs/sunlab1/labnode2/opt/VRTSvcs/bin/RVGSnapshot/fdsched.zip OK testing: _repository__data/vcs/sunlab1/labnode2/opt/VRTSvcs/bin/RVGSnapshot/monitor.zip OK : :
To restore VCS configuration
Use the hasnap -restore
command to recovery configuration files from a previously created snapshot
Syntax:
hasnap -restore [-f <filename> [-n] [-s snapid ]
Where:
-n
runs the command in non-interactive node-s
option specifies the ID of the snapshot to be restored. If you do not specify a snapshot ID, the command lists the snapshots that are avialble for restoration.
For example:
- To restore the snapshot stored in a file:
# hasnap -restore -f /backups/sunlab1-20060825.zip
- To restore a snapshot using snapshot ID, perform
# hasnap -restore -n -s vcs-20060825-10668
Additional notes
I should mention that since parts of VCS configuration reside in memory and not always on disk, I recommend that you run haconf -dump -makero
prior to running hasnap
. This will ensure that the current configuration is being backed up, and will allow hasnap -restore
to recover the correct configuration if disaster hits.