12-14-2012 01:20 AM
Environment
OS = Solaris 10
HA/VCS = 6.0
Cluster Nodes = Two nodes
There are two resources in my Service Group. Application Resource is Parent and Mount Resource is chlid. I want when my Application Resource gets stop when offline, it takes a calculated time of delay before unmount the SAN Disk/LUN
example
Application Resource
|
| (After Application Resource Offline there is suppose 30 seconds delay before executing the unmount)
|
Mount Resource
12-14-2012 01:30 AM
Easiest way is to just put "sleep 30" in your "StopProgram". If the StopProgram is a binary or you don't want to change it, then use a wrapper script - example:
app_wrapper.sh ============= # call stop for app ret=$? sleep 30 exit $ret
And then use "app_wrapper.sh" as your StopProgram (you can pass arguments to app_wrapper.sh like the instance of the application if you have mulitple resources, so you only need one wrapper).
A better solution is to loop and check whatever you need to determine your app is completely down and then exit.
Mike
12-14-2012 01:55 AM
A ".sh" extension usually means this is a shell script, not a binary, so this being the case you could just edit Application.sh to add "sleep 30" to the end, else just use wrapper:
app_wrapper.sh ============= Application.sh stop ret=$? sleep 30 exit $ret
12-14-2012 01:55 AM
Yes my stop program is a binary.
like my start program is "Application.sh start"
stop program is "Application.sh stop"
=====================
( Is not any attribute which we can use to do this ? )
12-14-2012 01:58 AM
Thanks Mike for your kind input. But is not any attribute which can add a delay between Resources while offline ?
12-14-2012 02:25 AM
I don't believe so - there is the OfflineWaitLimit, but this calls the monitor during the wait so if the monitor reports offline, when the App actually needs more time to stop cleanly, then this will not work. But if the monitor reports the App is online during this 30 seconds after offline completes, you could use this.
Some agents have delay attributes built in like the GenericService agent on Windows which has a DelayAfterOffline attribute.
If you are writing your own agent from scratch, rather than using Application agent, then this functionality is built-in by using the return code as the delay after running offline (see VCS Agent Developer’s Guide) is defined as:
Integer specifying number of seconds to wait before monitor can check the state of the resource; typically 0, that is, check resource state immediately.
12-14-2012 05:28 AM
What is offline timeout ?
12-14-2012 06:30 AM
The amount of time you allow for the offline function to finish - see definition is VCS admin guide:
Maximum time (in seconds) within which the offline function must complete or elsebe terminated.
- Type and dimension: integer-scalar
- Default: 300 seconds
Mike