By: Massimo Re Ferrè

VMware vCloud® Air™ Disaster Recovery has been a very popular offering since it became available. Disaster recovery to the cloud is a killer use case because it’s ideal for:

  1. Customers that want to start using the cloud but want to start with low risk and low impact to production workloads.
  2. Customers that want or need to implement a disaster recovery solution but don’t have the high impact CAPEX budget for it.

vCloud Air Disaster Recovery leverages the latest VMware vSphere® Replication™ Appliance that you can download for free (provided you have vSphere Essentials Plus and above) and can be configured to replicate virtual machines from a vCenter Server to either another vCenter server or to vCloud Air. This is a good article that explains how the service works.

Once on-premises workloads are replicating to vCloud Air, the user has the option of either testing the failover of the virtual machines or actually failing them due to a real disaster in the production site. Typically, you would configure replication and initiate failover via the vSphere Web Client or, in the case of a disaster hitting your data center, through the vCloud Air web UI.

Testing failover or real failovers of a large number of virtual machines individually from said interfaces can be a very manual process, but there are ways to automate this process. For example, you can use this RaaSCLI.

Not many people realize that vCloud Air Disaster Recovery contains a set of REST APIs that allow you to do everything you can do in the vCloud Air portal (and more!). Note that while the above APIs are included in the vSphere Replication documentation, these are vCloud Air specific APIs and vCloud Air is the end-point.

RaaSCLI is nothing more than a Ruby program (RaaS) that exposes a command line (RaaSCLI) that you can use to interact with the service from, guess what, a Command Line.  Other than the geeky excitement of using a CLI Vs. a Web UI, a tool like RaaSCLI can provide the “runbook automation”. In addition to this, a tool like RaaSCLI can be embedded in a higher-level automation workflow governed by an overarching tool.

Here is a list of all the commands that are available when the RaaS is installed on my laptop:

Usage: /Users/mreferre/.rvm/gems/ruby-1.9.3-p484/bin/RaaSCLI operation [option1] [option2]

       operations: peers|replications|testfailover[or test]|testcleanup[or cleanuptest]|failover[or recovery] 

       e.g. /Users/mreferre/.rvm/gems/ruby-1.9.3-p484/bin/RaaSCLI peers

       e.g. /Users/mreferre/.rvm/gems/ruby-1.9.3-p484/bin/RaaSCLI replications ALL

       e.g. /Users/mreferre/.rvm/gems/ruby-1.9.3-p484/bin/RaaSCLI replications <VM name>

       e.g. /Users/mreferre/.rvm/gems/ruby-1.9.3-p484/bin/RaaSCLI testfailover [or test] <VM name>

       e.g. /Users/mreferre/.rvm/gems/ruby-1.9.3-p484/bin/RaaSCLI testfailover [or test] ALL

       e.g. /Users/mreferre/.rvm/gems/ruby-1.9.3-p484/bin/RaaSCLI testcleanup [or cleanuptest] <VM name>

       e.g. /Users/mreferre/.rvm/gems/ruby-1.9.3-p484/bin/RaaSCLI testcleanup [or cleanuptest] cleanuptest ALL

       e.g. /Users/mreferre/.rvm/gems/ruby-1.9.3-p484/bin/RaaSCLI failover [or recovery] <VM name>

       e.g. /Users/mreferre/.rvm/gems/ruby-1.9.3-p484/bin/RaaSCLI failover [or recovery] recovery ALL

Let’s take a closer look at a basic use case. A tool like RaaSCLI can be used to failover ALL replicated virtual machines with a single shell command. By running “RaaSCLI failover ALL” from a prompt of an operating system where the tool is installed, the tool will enumerate all virtual machines replicated in vCloud Air and will fail them over.

As you can see the tool accepts other parameters such as “RaaSCLI replication” which allows you to scroll through either all replicated VMs in vCloud Air or a specific virtual machine.

The second use case is even more intriguing, in my opinion. One of the questions we often get asked is, “Does vCenter Site Recovery Manager (SRM) integrate with vCloud Air?” Unfortunately (today) SRM does not integrate natively and out-of-the-box with vCloud Air, but it can be integrated with a tool like RaaS.

DR Automation

Consider the following scenario:

vSphere Replication is replicating virtual machines #1 and #2 from a vSphere production site to a secondary DR site. In addition, the same vSphere Replication appliance is replicating virtual machine #3 from the primary site to the vCloud Air Disaster Recovery service. This is available today and fully supported out-of-the-box with no customizations.

Now imagine the primary production site encounters a real disaster and requires failover. That is where a tool like SRM, for example, could be used to automate the recovery procedure.

DR Automation

In this case SRM would initiate failovers to the secondary vSphere site natively, but the recovery plan can be augmented by calling out a script. In this case “RaaSCLI failover ALL” is the script being called so that SRM can initiate the failover of the virtual machines in vCloud Air. At that point, the control gets passed to the tool calling the APIs, and SRM is out of the picture. So the logic and controls of what, how, and when things are failed over is as good as the logic and controls of the script being used. This scenario is only provided as an example of how you could leverage RaaSCLI in an orchestrated failover.

In closing, I want to stress that this tool (RaaS) is available as an example of how vCloud Air Disaster Recovery REST APIs can be used to automate disaster recovery. You are free to use the tool as-is to implement what we have discussed in this post, but please note that this is a community-provided tool and VMware does not provide any support for it.

The tool and instructions on how to install and use it are available here. Feel free to contribute your own additions to this tool and share ideas for enhancement via Github.

For more information about vCloud Air, visit

Be sure to subscribe to the the vCloud blog with your favorite RSS reader, or follow our social channels at @vCloud and for the latest updates.