VMware Cloud Community
admin
Immortal
Immortal

Running an 'Action' (day-2) on a Multi Machine item on vRA 7

Hi

I see in vRA 7 the items now appears as 'Deployment' (for single machine item and for multi machine)

Any idea how to create a vRO workflow that will get this deployment and get the members of the deployment ? what is the object type and what action retrives the children ?

I couldn't find any documentation or blogs on that

Thanks a lot!

Reply
0 Kudos
3 Replies
ssarav
Contributor
Contributor

Looks like a old post but anyone has any answer or direction?
Reply
0 Kudos
kumar6384
Enthusiast
Enthusiast

Hi

For single machine blueprint if you read properties build machine state if you see the property’s value is below.

Single machine

VirtualMachine.Cafe.Blueprint.Component.Cluster.Index = 0

Multi machine

Machine1:  VirtualMachine.Cafe.Blueprint.Component.Cluster.Index = 0

Machine2:  VirtualMachine.Cafe.Blueprint.Component.Cluster.Index = 1

Machine3:  VirtualMachine.Cafe.Blueprint.Component.Cluster.Index = 3

Reply
0 Kudos
CalicoJack
Enthusiast
Enthusiast

Here is the code to collect VM's name associated with particular deployment. Every deployment has ID, so in Day-2 operations you just need to pass Deployment ID to your Workflow/Action/whatever. At least you got an idea how to work with vCAFE Filter.

var filter = new Array();

var vCACCAFEHost_host = vCACCAFEEntitiesFinder.getHost("vcafe_host_id_bla-bla");

var catalogClient = vCACCAFEHost_host.createCatalogClient();

var catalogConsumerResourceService = catalogClient.getCatalogConsumerResourceService();

filter[0] = vCACCAFEFilterParam.equal("parentResource", vCACCAFEFilterParam.string(Deployment_id)); //here Deployment_id came from Day-2 action form

var query = vCACCAFEOdataQuery.query().addFilter(filter);

var resources = catalogConsumerResourceService.getResourcesList(new vCACCAFEPageOdataRequest(query)); //here you get array of your VM's

var vm_list = new Array();

//code below will create a new array of strings, each element of which - VM'm name and Description

if (resources != null )

{

for (var i = 0; i < resources.length; i++ )

{

  vm_list[i] = resources[i].name + "\t" + resources[i].description;

}

return vm_list;

}

VMware dev team, why the heck is this stuff so complicated??? 

Reply
0 Kudos