The Script VM page of the DR Plan wizard allows you to add custom scripts to run on a dedicated VM during plan execution as a recovery step.

In the Script VM > Recovery Steps page of the DR Plan wizard, you can configure either Recover steps in the following ways:
  • Recovery Steps > Step Type > Recover Protection Groups | Invidual VMs | All remaining VMs, files and groups > Pre/Post-recover actions for each VM > Run script in the Script VM. 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.
  • Recovery Steps > Step Type > Other Actions > Add Action > Run script in the Script VM. 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 DR 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 you plan to run on a script VM 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 DR plan will only execute 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. In other words, the Script VM can be recovered as the first steps of a plan, or already running at the target site.
Note: A script VM configured to run on multiple VMs is run sequentially on each target VM in the batch. Be aware that depending on the number of VMs targeted by the script VM, and can tale longer by slowing the recovery completion process.

Procedure

  1. From the DR Plan > Script VM page, select the Run script VM option.
  2. 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.
  3. Click Next in the DR Plan Wizard.
  4. On the Recovery steps page, click Add step.
  5. In the Add step dialog box, you can choose either one of the Recover steps, or Other.
    • Select Other Actions > Add Action > Run script in the Script VM to run a a script on the script VM once, and can be placed before, in-between, or after other recovery steps. Or:
    • Select Recover Steps > Step Type > Recover Protection Groups | Invidual VMs | All remaining VMs, files and groups > Pre/Post-recover actions for each VM > Run script in the Script VM execute a script on the script VM once per-recovered VM.
  6. When you are finished, click OK.