SRM 5.8 Customizing Your Recovery Plan
January 8, 2015A customized recovery plan means the difference between hoursdays of reconfiguration of your environment in the event of a failure. VMware SRM allows for lots of opportunity to customize your recovery plans with scripts and modifications along the way to ease the management of your disaster recovery plans.
Run Scripts from SRM Server
If we open any given recovery plan we can click on a step we’d like to modify and then right-click to “Add Step…”
Once we’ve added a step, we’ll be given the option to run a script from the SRM Server at the recovery site. The name is just what will show up in the recovery plan so make it something descriptive. The content would need to be the command to run from the SRM server at the recovery site. Remember that this command is from windows and not a powershell command, so if you want to run powershell run the c:windowssystem32windowspowershellv1.0powershell.exe -file “path and name to script.ps1”. In my crude example below, I’ve called a powershell script that writes some output to a file.
Notice from the SRM server, I’ve got my “hollowOutput.ps1” script that is ready to be run.
Prompt
In addition to creating steps to call scripts, we can also pause the recovery plan if we need to perform some manual operations. Add another step and choose prompt. This will pause the recovery plan until the SRM admin clicks a button in SRM to continue the recovery plan.
Virtual Machine Options
If we click on an individual virtual machine in a recovery plan, we can also modify it’s recovery properties as well. We can modify the priority group, which is the group of machines that will start in order of priority 1 (first) to 5 (last). We can also set dependencies so that a VM will not start unless another VM has already been started. We can change Startup actions so we can failover a VM but leave it off, and we can run pre power-on scripts and post power-on scripts.
Note: We also have the ability to modify IP Settings for each individual VM but this is covered in another post.
Notice that if we run a post power-on script that it can be run on the SRM server as we showed before, but we can also run the command on the virtual machine. Perhaps some additional changes inside the guest OS need to be made to some VMs after they fail over. SRM allows us to do that from here as well.
Examples
In my test recovery plan, I’ve created a script to run on the SRM Server and it successfully create a file seen below.
Also, notice that when I ran my recovery plan, it paused at a prompt and waited for me to click the “Dismiss” hyperlink to continue the failover. These scripts will run during both test and failover scenarios.
Hi.
Is there any scripts for recovery plan that related to run ms cluster services after fail over run on cluster nodes?cluster consist of 2 vm’s
I’m not sure. I haven’t written any though.
Appreciate to update me if you found any related script.
Thanks
I am looking for a script to run against my VM’s to disable at Startup Action Wait for VMware tools. I want to be able to disable this when running a test SRM. We have 200 VM’s and i have not found an easy way to see how all the VM’s are set.
Thanks
can we just use the command ipconfig /registerdns in the post script functions on a vm for a recovered vm in SRM 6.1?
That might work to register the VM in DNS, but not necessarily change the IP Address.
Right, I tried just the command on the recovered vms post script and it didn’t work, it didn’t register the vms ip address in the dns
The issue you’re having with DNS not registering doesn’t seem to be because of SRM. Here is a thread that might be related to your DNS query. https://social.technet.microsoft.com/Forums/en-US/44ee363d-ad71-4569-b464-0b831860fc69/dns-staleness-and-quick-computer-moves-between-internal-networks?forum=winserverNIS