System information
8 In the Content text box, enter the commands for the step to run.
n
If you selected Command on SRM Server or Command on Recovered VM, enter the command or
script to run.
n
If you selected Prompt, enter the text of the message to display during the recovery plan run.
9 (Optional) Modify the Timeout setting for the command to run on Site Recovery Manager Server.
This option is not available if you create a prompt step.
10 Click OK to add the step to the recovery plan.
11 Click OK to reconfigure the virtual machine to run the command before or after it powers on.
Guidelines for Writing Command Steps
All batch files or commands for custom recovery steps that you add to a recovery plan must meet certain
requirements.
When you create a command step to add to a recovery plan, make sure that it takes into account the
environment in which it must run. Errors in a command step affect the integrity of a recovery plan. Test the
command on Site Recovery Manager Server on the recovery site before you add it to the plan.
n
You must start the Windows command shell using its full path on the local host. For example, to run a
script located in c:\alarmscript.bat, use the following command line:
c:\windows\system32\cmd.exe /c c:\alarmscript.bat
n
You must install batch files and commands on the Site Recovery Manager Server at the recovery site.
n
Batch files and commands must finish within 300 seconds. Otherwise, the recovery plan terminates
with an error. To change this limit, see “Change Recovery Settings,” on page 105.
n
Batch files or commands that produce output that contains characters with ASCII values greater than
127 must use UTF-8 encoding. Site Recovery Manager records only the final 4KB of script output in log
files and in the recovery history. Scripts that produce more output should redirect the output to a file
rather than sending it to the standard output to be logged.
Environment Variables for Command Steps
Site Recovery Manager makes environment variables available that you can use in commands for custom
recovery steps.
Command steps run with the identity of the LocalSystem account on the Site Recovery Manager Server host
at the recovery site. When a command step runs, Site Recovery Manager makes environment variables
available for it to use.
Table 5‑1. Environment Variables Available to All Command Steps
Name Value Example
VMware_RecoveryName Name of the recovery plan that is
running.
Plan A
VMware_RecoveryMode Recovery mode. Test or recovery
VMware_VC_Host Host name of the vCenter Server at
the recovery site.
vc_hostname.example.com
VMware_VC_Port Network port used to contact
vCenter Server.
443
Site Recovery Manager makes additional environment variables available for per-virtual machine command
steps that run either on Site Recovery Manager Server or on the recovered virtual machine.
Site Recovery Manager Administration
60 VMware, Inc.










