Architecting a vCloud Availability for vCloud Director Solution : vRealize Orchestrator Configuration : 7.4 Failover Orchestration
   
7.4 Failover Orchestration
Combining the vCloud Availability for vCloud Director vRealize Orchestrator plug-in with vCloud Director (and optionally other) plug-ins allows orchestration of complex workflows that require additional tasks during VM failover.
A simple example is the need to change the IP address of the recovered VM. This can be accomplished with the following workflow:
1. Run real/test failover to the cloud without powering on the VM.
2. Enable guest customization of the recovered VM.
3. Change recovered VM IP address and IP address allocation mode to manual.
4. Power on the VM.
The vCloud Director vRealize Orchestrator plug-in currently does not have native workflow that would accomplish steps 2 and 3. Therefore, a new workflow called Update VM IP Address can be created.
Figure 23. Run Real Recovery to Cloud with Re-IP
 
The Update VM IP Address Workflow consists of two scripted tasks with Wait for a task workflow in between.
Figure 24. Update VM Address Workflow
 
Enable Guest Customization script:
Input: (vCloud:VM) vm
Output: (vCloud:Task)
task
 
vm.updateInternalState();
 
var guestCustomizationSection = vm.getGuestCustomizationSection();
if (guestCustomizationSection.Enabled != "true") {
guestCustomizationSection.Enabled = "true";
System.log("Enabling guest customization");
}
 
task = vm.updateSection(guestCustomizationSection);
 
Update IP Address script:
Input: (vCloud:VM) vm, (Array/string) ipAddress
Output: (vCloud:Task)
task
vm.updateInternalState();
var networkConnectionSection = vm.getNetworkConnectionSection();
var networkConnections = networkConnectionSection.networkConnection.enumerate();

var poolAllocationModeNetworkConnectionIndexProp = new Properties();

var i = 0;
for each (var networkConnection in networkConnections) {
networkConnection.IpAddress = ipAddress[i];
if (networkConnection.ipAddressAllocationMode != "MANUAL") {
networkConnection.ipAddressAllocationMode = "MANUAL";
poolAllocationModeNetworkConnectionIndexProp.put(networkConnection.networkConnectionIndex,"");
}
i++;
}

task = vm.updateSection(networkConnectionSection);