About custom script

Using the Resiliency Platform console, you can add a custom script execution task in the resiliency plan. You can use the custom script execution task to perform customized operations before executing the next step of the resiliency plan such as repurposing capacity on the recovery site, orchestrate network changes, or any kind of post-processing.

Custom Script execution requires Resiliency Platform deployed on the Resiliency Manager, Infrastructure Management Server (IMS) and the hosts executing custom scripts. In addition, if you are using Resiliency Platform with Veritas InfoScale, the Veritas Resiliency Platform Enablement add-on has to be manually installed on applicable hosts.

The custom script can be in any format that can be directly executed on a shell on the target host. For the Linux hosts, it may be an executable or a script that specifies the interpreter on the shebang line such as a shell or a Perl script. For Windows hosts, it may be an executable or a script with known extension such as a bat file or a PowerShell script. The Script is executed as root user on a UNIX host or as Local System on a Windows host. You may use sudo or RunAs commands to execute some other scripts from these custom scripts.

Before you can execute the script as part of the resiliency plan, you need to manually copy the script to the VRTSsfmh InstallDir/vrp/scripts directory on the host.

Where, VRTSsfmh InstallDir is /opt/VRTSsfmh on the Unix/Linux hosts and SystemDrive/Program Files/VERITAS/VRTSsfmh on the Windows hosts. Copying the script to these specific folders enforces the security policy for running a custom script since these folders can be accessed only by a root user or a Local System.

Exit code from script execution determines the success or failure of the task in the resiliency plan workflow. An exit code of zero means the script execution was successful while a non-zero exit code means the script execution failed. If you select the option to ignore the exit code, the script task is always marked as successful after completion of the script. You can select this option, if your script does not return any exit code. You can view the output of the script in activity details for the resiliency plan in Resiliency Platform console.

If you uninstall the host package from the host where you have copied your custom script, the custom script is removed from the host as part of the uninstallation process.

Using custom scripts in resiliency plans

Using the Resiliency Platform console, you can add a custom script execution task in the resiliency plan.

To use a custom script execution task in a resiliency plan

  1. You can add a custom script execution task to a resiliency plan template or to a resiliency plan.

    See Creating a new resiliency plan template.

    See Creating a new resiliency plan.

  2. Drag and drop Custom Script into the canvas. Click the pencil icon in the action box to add the task details.
  3. Enter a name for the custom script.
  4. Select the data center and the host where you want to execute the script. Click Next.
  5. Enter the following details:
    • The relative path of the script on the specified host. The script path that you enter is taken as relative to the VRTSsfmh InstallDir/vrp/scripts/ directory path.

      For example, if you enter the path of the script as myscripts/backup_scripts/script_name, then the complete path considered by the system will be VRTSsfmh InstallDir/vrp/scripts/myscripts/backup_scripts/script_name.

    • Command-line arguments to the script. This is an optional input field.

    • Timeout for the script. By default, there is no timeout for the script execution. You can specify a timeout for the script execution. After the specified timeout expires, the script execution task in the resiliency plan is marked as failure but the script execution task is not stopped. The script execution may continue in the background. If you do not specify any timeout, the task will wait till the script is not completed.

  6. Click Save.