Quantcast
Channel: VMware Communities : Discussion List - Site Recovery Manager
Viewing all articles
Browse latest Browse all 3691

Integrating SRM using API facing issues to get Mapping info of resource pools between sites

$
0
0

Hi,

 

we are integrating SRM in to our product using SRM API.

 

Here in the below example i am getting Resource Pool Info of Protected Site similarly we can get Resource Pool info of recovery Site.

 

Here unable to find mapping between resource 1 of site A to resource 2 of Site B

 

Missing resource pool mapping between sites through SRM API.

 

Please help us how to get this mapping info, on any alternative solution for this Through SRM API

privatestaticvoid getResourcePool() throws Exception {

 

try

{

ServiceInstance si = new ServiceInstance(new URL("https://IP-Addrees/sdk"), "Userid", "password", true);

 

 

//SrmPortType service = SrmJaxwsSession.srmPort;

serviceContent = srmPort.retrieveContent(SVC_INST_REF);

  com.vmware.vim25.srm.ManagedObjectReference serviceContentMor = serviceContent.getProtection();

 

SrmProtectionInventoryMappingInfo mappingInfo = srmPort.listInventoryMappings(serviceContentMor);

  List<com.vmware.vim25.srm.ManagedObjectReference> resourcePools = mappingInfo.getPools();

 

 

if(resourcePools != null&& resourcePools.size() > 0)

{

  for(int i = 0; i < resourcePools.size() ; i++)

  {

  com.vmware.vim25.srm.ManagedObjectReference resourcePoolMor = resourcePools.get(i);

  

  com.vmware.vim25.ManagedObjectReference mor = new com.vmware.vim25.ManagedObjectReference();

  mor.set_value(resourcePoolMor.getValue());

  mor.setType(resourcePoolMor.getType());

  ManagedEntity me = MorUtil.createExactManagedEntity(si.getServerConnection(), mor);

  

  if(me instanceof ResourcePool)

  {

  ResourcePool ds = (ResourcePool) me;

  System.out.println("RS: " + ds.getName());

   //System.out.println("DataStore: " + ds.get);

  

  String ds1 = me.getName();

  

  while(me.getParent() != null)

  {

  me = (ManagedEntity) me.getParent();

  ds1 = me.getName() + "/" + ds1;

  }

  

  System.out.println("RS Path: " + ds1);

 

  }

      

  

 

  }

  

 

 

  }

 

 

 

 

}catch(SOAPFaultException sfe)

{

printSoapFaultException(sfe);

}catch(Exception e)

{

e.printStackTrace();

}

              }

 

Thanks,

Ramji


Viewing all articles
Browse latest Browse all 3691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>