There are multiple entities in vRA data model that the business group (aka provisioning group) can be determined from, such as Owner, VirtualMachineTemplate, etc. But when I try to get a link to the Business Group I always get an empty array.
Can you see anything wrong with the code below?
var model = "ManagementModelEntities.svc";
var entitySetName = "VirtualMachines";
var virtualMachines = vCACEntityManager.readModelEntitiesByCustomFilter(vcacHost.id, model, entitySetName, null, null);
for each (var vm in virtualMachines) {
var owner = vm.getLink(vcacHost, "Owner");
var provisioningGroup = owner[0].getLink(vcacHost, "ProvisioningGroup");
System.log(provisioningGroup);
}
Nick, I just posted a bit of code that may help in your below quest - Return all of the VMs owned by a particular business group
I will work through your code a bit later today, and see what I can come up with.
Please refer to https://communities.vmware.com/message/2490714#2490714