Page 1 of 1

vRA get multi-machine container vCACVm for a component vCACVm

Posted: Tue Dec 01, 2015 2:28 pm
by leefriend
Script to get the container vCAC VM from vRA for a component vCAC VM in multi-machine service

Input parameters:
- vCACVm
- vCACHost

Output parameters:
- vCACContainerVm


Code: Select all

var parentvCACVmID = vCACVm.getEntity().getProperty('ParentMachineID');

var props = new Properties();
props.put("VirtualMachineID", parentvCACVmID);

    var vCACVmEntity = vCACEntityManager.readModelEntity(, "MangementModelEntities.svc", "VirtualMachines", props, null);
    vCACContainerVm = vCACVmEntity.getInventoryObject();
} catch(err){
    // handle error here