cancel
Showing results for 
Search instead for 
Did you mean: 

Can we put any time delay between Resources offline

Zahid_Haseeb
Moderator
Moderator
Partner    VIP    Accredited

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

7 REPLIES 7

mikebounds
Level 6
Partner Accredited

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

mikebounds
Level 6
Partner Accredited

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

 

Zahid_Haseeb
Moderator
Moderator
Partner    VIP    Accredited

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

          

Zahid_Haseeb
Moderator
Moderator
Partner    VIP    Accredited

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

mikebounds
Level 6
Partner Accredited

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

Zahid_Haseeb
Moderator
Moderator
Partner    VIP    Accredited

What is offline timeout ?

mikebounds
Level 6
Partner Accredited

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