Video Screencast Help

Can we put any time delay between Resources offline

Created: 14 Dec 2012 | 7 comments
Zahid.Haseeb's picture

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

Discussion Filed Under:

Comments 7 CommentsJump to latest comment

mikebounds's picture

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

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below

Zahid.Haseeb's picture

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 ?  )

          

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

mikebounds's picture

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

 

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below

Zahid.Haseeb's picture

Thanks Mike for your kind input. But is not any attribute which can add a delay between Resources while offline ?

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

mikebounds's picture

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.

 
But it is not that easy to write your own agent, so this is NOT a route I would recommend for you.
 
Mike

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below

Zahid.Haseeb's picture

What is offline timeout ?

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

mikebounds's picture

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 else
be terminated.
  • Type and dimension: integer-scalar
  • Default: 300 seconds

 

Mike

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below