VMware {code} Community
Samadhan
Contributor
Contributor

how to Get Datastore Cluster using vijava api.

Hi,

Please suggest me any entity or class or function in vijava api to get Datastore Cluster's.

Thanks in advance.

samadhan Patekar

0 Kudos
8 Replies
vThinkBeyondVM
VMware Employee
VMware Employee

Hi Samadhan,

  Its great to meet here on forum.

You may want to explore:below managed object

Managed Object - StoragePod

Inside Storage Pod, there is below data object

Data Object - StoragePodSummary

StoragePOD is another name of datastore cluster

Let me know if you face any issues retrieving the same


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

0 Kudos
Samadhan
Contributor
Contributor

Hi vikas,

Really Happy to se you and feel comfortable to discuss with you.

Actually I tried StoragePod to get datastore Cluster details. But I get null managed entity object even we have one test datastore cluster in my setup...

Please go though below code and snapshot of vcenter client and suggest me,...

ServiceInstance si = new ServiceInstance(url, username, password, true);

Folder rootFolder=si.getRootFolder();

ManagedEntity me = new InventoryNavigator(rootFolder).searchManagedEntity("StoragePod", "test");

StoragePod sp = (StoragePod) me;

System.out.println("DS Cluster Name :: "+sp.getSummary().getName());

 

Thanks,

Samadhan Patekar

ServiceInstance si = new ServiceInstance(url, username, password, true);
Folder rootFolder=si.getRootFolder();
ManagedEntity me = new InventoryNavigator(rootFolder).searchManagedEntity("StoragePod", "test");
StoragePod sp = (StoragePod) me;
System.out.println("DS Cluster Name :: "+sp.getSummary().getName());
0 Kudos
vThinkBeyondVM
VMware Employee
VMware Employee

This may not work this way. I will come back once get time to work.


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

0 Kudos
Samadhan
Contributor
Contributor

ok and thanks for the quick reply.
0 Kudos
Samadhan
Contributor
Contributor

Hi Vikas,

I also tried using ManagedObjectRefarance object but still null object received...

ManagedObjectReference mor = new ManagedObjectReference();

mor.setType("StoragePod");

mor.set_value("nfv-cluster001");

StoragePod dsc = (StoragePod) MorUtil.createExactManagedEntity(si.getServerConnection(), mor);

System.out.println("Datastore Name :: "+dsc.getName());

Thanks & Regards,

Samadhan Patekar

ManagedObjectReference mor = new ManagedObjectReference();
            mor.setType("StoragePod");
            mor.set_value("nfv-cluster001");
            StoragePod dsc = (StoragePod) MorUtil.createExactManagedEntity(si.getServerConnection(), mor);
            System.out.println("Datastore Name :: "+dsc.getName());ManagedObjectReference mor = new ManagedObjectReference();
mor.setType("StoragePod");
mor.set_value("nfv-cluster001");
StoragePod dsc = (StoragePod) MorUtil.createExactManagedEntity(si.getServerConnection(), mor);
System.out.println("Datastore Name :: "+dsc.getName());
0 Kudos
Samadhan
Contributor
Contributor

Hi Vikas,

Any Update..

Thanks & Regards,

Samadhan Patekar

0 Kudos
Samadhan
Contributor
Contributor

Hi,

Problem solved by adding updated source code of StoragePod managed Entity into vim25.jar and disabling SSL certificate.

Thanks vikas for your support.

Thanks & Regards,

Samadhan Patekar

0 Kudos
balajiyelmar1
Contributor
Contributor

Hi ,

Is it possible to get Datastores from the datastore clusters using Java API. I am able to get StoragePod but i need to get Datastores based on the StoragePod. If possible can you pleasae share the code.

Thanks

0 Kudos