• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • Unexplored Territory Podcast
  • HA Deepdive
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

SRM: Running a script from a Recovery Plan

Duncan Epping · Mar 30, 2009 ·

I got a question today from one of my customers on how to run a script from an SRM Recovery Plan. They tried everything but never got it working. It’s fairly easy, although you would need to take a couple of things in consideration. And reading the SRM Admin Guide page 52 and 53 wouldn’t harm you as well. But then again we’re talking technical people here, who reads the manual? (Besides Mike Laverick aka Mr RTFM of course. Mike, btw, also recently released the third chapter of his SRM book for free, which is most definitely worth reading!!)

I guess the most important things to remember if you want to run commands/batch files from SRM are:

  • SRM can only execute .exe or .com files, if you need to run a batch file do the following:
    c:\windows\system32\cmd.exe /c c:\yellow-bricks.bat
  • Scripts must reside on the host where the SRM server is installed.
  • SRM callouts to batch files or commands run as the local administrator of the SRM server host, and not as the user logged into the VI Client.
  • A recovery terminates if a command or script exits with a non‐zero status.
  • If the script call out takes longer than 300 seconds to complete it will be terminated. You can increase this by changing/adding the following line in vmware-dr.xml with the desired value:
    <calloutCommandLineTimeout>600</calloutCommandLineTimeout>

Related

BC-DR BC-DR, Scripting, scripts, srm

Reader Interactions

Comments

  1. justme says

    31 March, 2009 at 06:14

    Wouldn’t %windir%\system32\cmd.exe /c “E:\path\name\to\batchfile.bat” be a better exammple to use.

    You know, for those non standard installs.

  2. Ivan says

    9 February, 2014 at 21:19

    I’m trying run a script to update DNS entry using SRM recovery step.
    If I run script manually from CMD , it works fine but It doesn’t works throught SRM custom step.

    It always finish with :
    Warning: the command ‘c:\windows\system32\cmd.exe’ returned a non-zero value: 1.

    What do I wrong?

    Any ideas?

    Best regards.

  3. Matt says

    21 April, 2014 at 21:03

    use the command exit 0

Primary Sidebar

About the Author

Duncan Epping is a Chief Technologist and Distinguished Engineering Architect at Broadcom. Besides writing on Yellow-Bricks, Duncan is the co-author of the vSAN Deep Dive and the vSphere Clustering Deep Dive book series. Duncan is also the host of the Unexplored Territory Podcast.

Follow Us

  • X
  • Spotify
  • RSS Feed
  • LinkedIn

Recommended Book(s)

Advertisements




Copyright Yellow-Bricks.com © 2025 · Log in