Recovery steps in a recovery plan dictate what actions the plan takes during a failover or failback, and the specific order in which those actions occur when the plan is running.

Recover steps in a plan consist largely of restoring individual VMs or VMs contained in protection group snapshots, and copying and restoring files and vSphere groups to the target recovery site.

With recovery steps, you specify scripts to run before and/or after a VM is powered on during a failover or failback. You can also configure how you want the running plan to handle errors it encounters during failover and failback operations. You can also require user input on some steps before the plan continues running.

Recovery step types:

Step type

Description

Recover protection groups

Allows you to recover any of the protection groups associated with the plan. This step recovers and promotes each protection group, registers all VMs in a protection group snapshot with vCenter, then customizes and powers-on the VMs. You can also choose to run a script VM before or after recovery of all VMs in the protection group.

Recover individual VMs

Allows you to recover individual VMs (you can select more than one) in the order that you specify.

This type of step recovers then promotes each VM, registers each VM with vCenter, then customizes them and powers them on. You can also choose to run a script VM before or after recovery of an individual VM.
Note: All VMs in the protection group referenced by the plan are recovered when the plan is run, in addition to any individual VMs you configure to restore here.

Recover all remaining VMs, files, and groups

Allows you to recover everything else referenced in plan mappings, in addition to any selected protection groups or individual VMs. This step recovers and promotes all remaining protection group and VMs and other files, registers the VMs with vCenter, then customizes and powers them on. You can also choose to run a script VM before or after recovery of all VMs.

Other actions

This step type allows you to define other steps while the plan is running:

  • Wait for a fixed amount of time. Pause the plan execution for a specified duration of time.
  • Wait for user input. Requires that a user enter text in the running Recovery Plan to confirm a step before the plan continues executing.
  • Run script. Run a script using the script VM configured for the plan.

Select Power Actions

For each recovery step in a plan, you must select a power action which determines if you want VMs to be powered-on or powered-off after recovery.

A recovery step for protection groups or VMs require one of these three power actions:

  • Power-on only VMs that were powered-on when the snapshot was taken.
  • Power-on all recovered VMs.
  • Do not power on VMs.

Protection Groups, Snapshots, and VM Power State

When a protection group takes a snapshot of its member VMs, it captures the power state of VMs in the group, either on or off. If the VM is powered-on when a snapshot is taken, the VM is powered-on when it is restored.

Conversely, If the VM is powered-off at the time the snapshot was taken, the VM is powered-off when it is restored.

VMs that are powered-off when the snapshot is taken are not able to be powered- on until after the Storage vMotion of that VM to the SDDC completes.

If your VMs must be powered-on and ready for use immediately after recovery, you can override that default behavior when you set the recovery power state in your recovery plan to be on.

Select Pre-recover and Post-recover Actions

In addition to configuring a power action for recovered VMs, you can also select actions that occur before and after a VM is powered on.
  • Pre-recover action:
    • Run a script in the script VM. This pre-recover action requires entering the script path and any custom parameters.
  • Post-recover actions:
    • Wait for VM IP address. Wait for the VM’s IP address to be assigned before moving to the next step in the plan.
    • Wait for VMware Tools. Wait for VMware Tools to launch before continuing to the next step in the plan.
    • Run script in the Script VM. This requires entering the script path and any custom parameters.

Script Configuration for Pre- or Post-Recover Actions

If you select to run a script as a pre-recover or post-recover action, you must configure script settings. This script VM is independent of the VMs that you recover as part of the plan.

To configure script execution, you must identify both the script and the script VM.

  • You can only specify one virtual machine for script execution. The name of this virtual machine must be unique in its vCenter context.
  • You must identify the script by its location on the script VM and by execution requirements. See Recovery steps.

There are two types of script execution:

  • A pre-recover action script runs before powering on a recovered virtual machine.
  • A post-recover action script runs after the recovered VM has been powered on. Post-action scripts can be paused for a certain amount of time to allow IP address configuration on recovered virtual machines, and can be paused to allow VMware Tools installation on recovered virtual machines.

Script Actions

Note: This action runs a script on a VM within the context of a plan execution recovery step. The script action takes an absolute path to the script on the script VM and a list of parameters that you can specify.

For Powershell scripts, only the absolute path to the 'powershell.exe' can be in the script path, and the Powershell script must be set in the parameters.

For example:

Configuring a script actions in a recovery Plan.

The timeout value (measured in seconds) is the amount of time to wait for this action before returning a failure on timeout. You can enter any value for the timeout. (The value of 300 shown in the image above is just an example.)

The script execution action returns an exit code for the script, where a non-zero exit code means failure, and an exit code of zero means success. At the time of recovery execution, you must supply the script VM credentials so that it is possible to run the script in the script VM remotely.

Failback and Rollback Script Actions

Script actions have both a forward (failback) and backward (rollback) execution:

  • If the script was run in the forward direction, a “ --failover” flag is added to the parameters list so the script can distinguish between directions.
  • If the script was run in the reverse direction, a “ --rollback” flag is added to the parameter list.