Executing custom scripts before and/or after the storage pool starts or stops

Starting with FlexRAID 2.0 beta build 15, users can execute custom scripts before and after the pool is started or stopped.

Users will need to create one or more of the following 4 scripts in the FlexRAID install ROOT (create only the scripts you need):

  • pool-before-start(.cmd|.sh): called before the pool is started
  • pool-after-start(.cmd|.sh): called after the pool is started
  • pool-before-stop(.cmd|.sh): called before the pool is stopped
  • pool-after-stop(.cmd|.sh): called after the pool is stopped

The extension for the scripts need to be .cmd for Windows users and .sh for Linux users.

FlexRAID will pass in two parameters to the call of each script:

  • classX_Y
  • true|false

The first parameter is the class and instance of id of the pool (unique identifier for the pool – Ex: class1_0).
The second parameter is whether the execution prior to the callback was successful.
This parameter is only useful for the “pool-after” callbacks and tells you whether the pool started or stopped successfully.

Be Sociable, Share!

Revisions

2 Responses to “Executing custom scripts before and/or after the storage pool starts or stops”

  1. Darin Swenson June 22, 2012 at 9:57 AM #

    Is there a way to run a script (windows cmd file) before and after the update or verify operation in snapshot RAID?

    I have a VM running on my windows host whose virtual disk file is located on the storage pool. The VM holds a read lock on the virtual disk file. The update operation fails due to the read lock. Ideally I would like to run a script to stop the VM before the update and re-start the VM after the update finishes.

    Thanks!

Leave a Reply

eleven + 13 =