Automating vSphere Replication and SRM with vRealize Orchestrator

With the release of the vSphere Replication plugin for vRealize Orchestrator there are a whole set of new automation capabilities when it comes to Disaster Recovery for your VMware environment. The new plugin enables you to configure vSphere Replication:

  • to vCloud Air Disaster Recovery Service
  • to another vCenter deployment
  • or even within the same vCenter deployment

I’d recommend reading the release notes for more details on what capabilities are on offer. In this blog post I want to demonstrate how you can easily combine the vSphere Replication plugin with the SRM plugin to automate the end to end replication and DR protection of your Virtual Machines. Without further ado here’s where we want to end up:

In this short video you saw that the administrator selected a handful of Virtual Machines they wanted to protect, invoked a VRO workflow from the context menu, and was able to completely configure the replication and protection of the VMs in just a few seconds! In fact most of the video was me driving the UI to show you all the items (replication schedules, protected VMs, protection groups, recovery plans, etc.) that were created by the workflow.

So What do We Need to Make It Work?

The demonstration used the following products:

How Did You Build The Workflow?

The workflow was built by linking together various out of the box workflows provided by the VR and SRM plugins. I actually built two workflows so I could separate out the workflow that linked together the two plugins capabilities, and another workflow that wrapped the more complex workflow with some predefined attributes and a little scripting to simplify the presentation and make it easy to call from the vSphere Web Client.

As you can see the workflow assigned to the context menu provides is basically a wrapper with a little scripting to allow me to use predefined RPO tiers when presenting the workflow and some predefined attributes to allow me to simplify the what I choose to present to the user.


The workflow that ties the VR and SRM workflows together looks more complex, but most of it is simply chaining together out of the box workflows.


The green and blue highlighted sections are the workflows provided by the VR and SRM plugins for vRO. The red highlighted section was custom built to handle a simple lookup from an instance of VC:VirtualMachine to an instance of SRM:UnassignedReplicatedVm. The script to do this is a one liner:

replVm = Server.findForType("SRM:UnassignedReplicatedVm",;


Hopefully this has given you a glimpse into what you can achieve with these new automation capabilities. While there is a learning curve to vRealize Orchestrator there is also a lot of potential to streamline your operations. Being able to combine the automation capabilities of VR and SRM opens up a lot of new possibilities to explore.

Update: Presenting RPOs as a Dropdown list

One of my colleagues asked me how I was able to present the RPO values as a drop-down list. To do that required me to configure the presentation properties of the workflow. Within vRealize Orchestrator you are able to control how parameters are presented to the end user in the presentation tab. Here I simply added a set of Predefined answers to a field I called ReplicationTier (you can also order and group the parameters that you present to the customer as well in this tab).


The selected value is then passed to a short script that parses the value selected by the user and determines what the RPO value, in minutes, should be set as:

RPO = 4 * 60; // set default to 240 minutes, i.e. 4 hours.
if (ReplicationTier.indexOf("Gold") > -1) {
    RPO = 15; // 15 minute RPO
} else if (ReplicationTier.indexOf("Silver") > -1) {
    RPO = 4 * 60; // 4 hour RPO
} else if (ReplicationTier.indexOf("Bronze") > -1) {
    RPO = 12 * 60; // 12 hour RPO

This is the Lookup RPO from tier script task in the first workflow schema image shared above. Of course this is not necessary, you can just ask for the RPO value as a number input (with min and max values) but I thought the dropdown selection was a nice option to demonstrate.