VMware Cloud Community
Venkatanagesh
Contributor
Contributor

vra7 how to configure subscription for vm reconfigure action?

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.

0 Kudos
7 Replies
Venkatanagesh
Contributor
Contributor

Any help/Inputs on this query?

0 Kudos
JensVM
Enthusiast
Enthusiast

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

0 Kudos
GrantOrchardVMw
Commander
Commander

‌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 http://grantorchard.com
0 Kudos
pizzle85
Expert
Expert

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?

0 Kudos
pizzle85
Expert
Expert

Slight variations of these got me to where i needed to go:

vRealize Automation 7 External Approval Policy with vRealize Orchestrator Workflow | VMwarebits.com

vRealize Automation 7.0

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).

0 Kudos
Michael_Rudloff
Enthusiast
Enthusiast

I have done something similar

Screen Shot 2016-05-27 at 10.45.56.png

And then added it to the entitlement

Screen Shot 2016-05-27 at 10.46.44.png

(Preconfigure obviously should be Reconfigure :smileysilly:)

___ My own knowledge base made public: http://open902.com
0 Kudos
pizzle85
Expert
Expert

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;