Hi,
Can anyone help me with the correct condition under subscriptions with vRa-7 to enable a vRo workflow to run when VM reconfigure action is triggered?
Regards,
Venkat.
Any help/Inputs on this query?
Hello Venkatanagesh,
I'm also searching for the right conditions I need to use for a reconfigure workflow. Did you find out which conditions are needed?
Best Regards
JensVM
This isn't currently available (yes, annoyingly). The rough workaround is to associate an approval policy with the action and trigger off that.
Grant
Grant, would you mind sharing what level(s) you put in the approval policy and what Event Topic and Conditions you used to filter to the approval?
Slight variations of these got me to where i needed to go:
vRealize Automation 7 External Approval Policy with vRealize Orchestrator Workflow | VMwarebits.com
Essentially i just ignored everything in the vRO workflow and just added a single output boolean named "approved" and added a script that is:
approved = true;
The First link threw me off a bit on the step where they create the conditions for the subscription, however the second link set me straight. The value there should be the name of the level you created in your approval (which it's not in the first link).
I have done something similar
And then added it to the entitlement
(Preconfigure obviously should be Reconfigure :smileysilly:)
FWIW the approval event payload doesn't contain any information about the actual request that was submitted other than the request ID. In my case we wanted to populate our service database with the current values so we could provide real time billing based off allocated resources. Here's the code i used to fetch that info. This basically just grabs the name, cpu, memory, disks, and nics as they were submitted in the reconfigure request and builds a "VM" object which i output as a JSON string.
//System.log(JSON.stringify(payload));
var req = vCACCAFEEntitiesFinder.getResourceActionRequest(host, payload.sourceInfo.externalInstanceId);
var map = req.requestData;
//System.log(map.keySet());
var vm = new Object();
vm.name = map.get('provider-MachineName').value;
vm.cpu = map.get('provider-Cafe.Shim.VirtualMachine.Reconfigure.CpuCount').value;
vm.memory = map.get('provider-Cafe.Shim.VirtualMachine.Reconfigure.MemorySize').value / 1024;
vm.disks = new Array();
vm.nics = new Array();
var objs = map.get('provider-Cafe.Shim.VirtualMachine.Reconfigure.Storages').value
var count = -1;
json = JSON.parse(objs);
for each (obj in json) {
var thing = new Object();
count = count + 1;
thing.name = vm.name + " hard disk " + count;
thing.tier = obj.StoragePolicy;
thing.capacity = obj.CapacityInGB;
thing.date = System.getModule("edu.ufl.sql").getDateTime2Now(true, null);
vm.disks.push(thing);
}
var objs = map.get('provider-Cafe.Shim.VirtualMachine.Reconfigure.Networks').value
var count = -1;
json = JSON.parse(objs);
for each (obj in json) {
var thing = new Object();
count = count + 1;
thing.name = vm.name + " nic " + count;
thing.vlan = obj.NetworkName;
thing.date = System.getModule("edu.ufl.sql").getDateTime2Now(true, null)
vm.nics.push(thing);
}
vmProperties = JSON.stringify(vm);
resourceName = vm.name;