Description
Prior to Veritas Cluster Server (VCS) 6.0 release, VCS had different attributes at a Service Group and Resource level to enable different triggers.
ExamplesPreonline, TriggerResFault, etc. at a Service Group level.
TriggerResRestart, TriggerResStateChange, etc. at a Resource level.
With that approach, VCS would have continued introducing more attributes for every new trigger introduced.
With the VCS 6.0 release, to simplify enabling triggers, VCS introduced the
TriggersEnabled attribute at a Service Group and Resource level. Using this single
string-keylist attribute, users can enable all required triggers.
Legacy Method:group appsg (
SystemList = { barney = 0, fred = 1 }
AutoFailOver = 0
AutoStartList = { barney, fred }
PreOnline @barney = 1)
New Method:group appsg (
SystemList = { barney = 0, fred = 1 }
AutoFailOver = 0
AutoStartList = { barney, fred }
TriggersEnabled @barney = { PREONLINE })
Note: Do not enable a trigger using both legacy and new methods.
group appsg (
SystemList = { barney = 0, fred = 1 }
AutoFailOver = 0
AutoStartList = { barney, fred }
TriggersEnabled @barney = { PREONLINE }
PreOnline @barney = 1)
TriggersEnabled: Service Group Level The following triggers can be enabled on all nodes or only on selected nodes for a Service Group.
Valid values are: VIOLATION,NOFAILOVER, PREONLINE, POSTONLINE, POSTOFFLINE, RESFAULT, RESSTATECHANGE, and RESRESTART.
TriggersEnabled: Resource Level The following triggers can be enabled on all nodes or only on selected nodes at a Resouce Level.
Valid values are RESFAULT, RESNOTOFF, RESSTATECHANGE, RESRESTART, and RESADMINWAIT.
How to display enabled triggers for a Service Group
# hagrp -display parent_sg -attribute TriggersEnabled
#Group Attribute System Value
test_sg TriggersEnabled localclus PREONLINE POSTONLINE POSTOFFLINE
To enable backward compatibility with older VCS product releases, VCS 6.0 and higher still continues to support legacy (older) attributes used for enabling triggers.
Older attributes (like PreOnline, TriggerResFault, etc.) are deprecated and TriggersEnabled is now recommended with VCS version 6.0 and higher.
However, whether “TriggersEnabled = {PREONLINE, POSTONLINE}”, or “PreOnline = 1” is defined in the VCS /etc/VRTSvcs/conf/config/main.cf configuration file, the functionality is same regardless of the implementation.
We are recommending that users adopt the TriggersEnabled approach going forward.
Additional VCS 6.0 trigger based enhancements:VCS can execute trigger scripts specific to a Service Group and/or at a Resource level. Thus, triggers scripts for multiple objects no longer need to be merged into a single trigger script.
With the introduction of the
TriggersEnabled attribute, legacy triggers such as nofailover, preonline, postonline and postoffline etc should now be defined with the
TriggersEnabled attribute.
VCS provides smaple Perl scripts for each event trigger in
/opt/VRTSvcs/bin/sample_triggers/VRTSvcs.
The modified trigger scripts should then be moved to
/opt/VRTSvcs/bin/triggers.
You can execute multiple scripts for a trigger. The trigger scripts must be installed inside the trigger directory using the T
nomenclature. VCS executes the trigger scripts in T order.
For example:
To perform multiple actions for the preonline trigger, place the scripts in a directory name preonline under /opt/VRTSvcs/bin/triggers.
If the preonline directory contains the scripts T00preonline, T01preonline, T02preonline, then the script T00preonline is executed first, then T01preonline and finally , T02preonline is executed.
VCS executes the scripts in the asending oder of T.
Note: As a good practice, ensure that one script does not affect the functioning of another script. If script2 takes the output of script1 as an input, script2 must be capable of handling any exceptions that arise out of the behavior of script1.
The agent restarts a faulted resource if the RestartLimit is set. Whenever the agent restarts a resource, VCS invokes the resrestart trigger if the TriggerResRestart attribute is set to 1 or if RESRESTART is specified in the TriggersEnabled attribute. Otherwise, VCS invokes the resstatechange trigger.
CAUTION: Use of resstatechange to indicate restart is being deprecated. In later releases, you must use only the resrestart trigger to indicate restarting of resources.