VMware Cloud Community
segadson
Contributor
Contributor

Find A vCAC Provisioning Group with vCAC VM


Hey,

I was wondering if it was possible to find the provisioning group by usining the vCAC VM entity?  When I check the properties it only gives me the custom ones and it doesnt show the provisioning group

Reply
0 Kudos
3 Replies
ChristianWehner
VMware Employee
VMware Employee

If you mean a vCACVirtualMachine than I thought it was this way, but it returns me null in my environment (vRA 6.2):

var vmEntity = vCACVm.getEntity();

var ownerEntity = vmEntity.getLink( vCACHost,"Owner" ).shift();

var provisioningGroupEntity = ownerEntity.getLink( vCACHost,"ProvisioningGroup" ).shift();

You can try if this is working.

Reply
0 Kudos
befreeman
Enthusiast
Enthusiast

Something like this should work:

var blueprints = vcacVM.getEntity().getLink(vcacHost, "VirtualMachineTemplate");

System.debug("blueprint: " + blueprints[0]);

var businessGroups = blueprints[0].getLink(vcacHost, "ProvisioningGroup");

System.debug("businessGroup: " + businessGroups[0].getInventoryObject());

Reply
0 Kudos
segadson
Contributor
Contributor

yup this works thanks!

Reply
0 Kudos