You can add custom scripts to run on a dedicated VM during plan execution as a recovery step.
- . These recovery step types allow you to execute a script on the script VM once per-recovered VM. You can configure each recover step to be run on the script VM before and/or after failover or failback operations.
- . This recovery step executes a script on the script VM once, and can be placed before, in-between, or after other recovery steps. You can also add multiple other actions to run a script in a single recovery plan. For example, you can add one recover step action to launch a script before recovery is performed, in the middle of the VMs being recovered, and then another script launch after the VMs are recovered.
For more information on script VMs and recovery steps, see Recovery Steps.
Any script must be accessible to the script VM, since script execution is performed on the script VM.
Both Windows (Powershell) and Linux (Python) are supported for the script VM guest OS. You can use a script VM for testing and for real recovery operations.
Script VM restrictions:
- A recovery plan only executes on a single script VM.
- Scripts are executed on the VM that you designate as the Script VM. Scripts are not run on other recovered VMs.
- VMware Tools must be installed and running on the script VM.
- The script VM must be available in the environment before the first step requiring a script call. The Script VM can be recovered as the first steps of a plan, or it must already running on the target Recovery SDDC. For example, do one of the following:
Deploy the script VM on both the protected site and the Recovery SDDC. The script is called from both locations during failover and failback. Or,
Deploy the script VM on the protected site and add it to a protection group. Then, the script VM must be failed over as part of the recovery plan, and it needs a separate recovery step where the script VM is recovered before other VMs are recovered.
- From the page, select the Run script VM option.
- Enter the VM name on which the script is run and the vCenter where the VM is hosted. You can select to run the same script for both real and test failovers, or you can use different scripts for real failovers and test failovers.
- Click Next in the recovery plan Wizard.
- On the Recovery steps page, click Add step.
- In the Add step dialog box, you can choose either one of the Recover steps, or Other.
- Select to run a script on the script VM once, and can be placed before, in-between, or after other recovery steps. Or:
- Select execute a script on the script VM once per-recovered VM.
- When you are finished, click OK.