vmware / vsphere-automation-sdk-python

Python samples, language bindings, and API reference documentation for vSphere, VMC, and NSX-T using the VMware REST API
MIT License
748 stars 312 forks source link

Unable to get DatastoreCluster #245

Closed Akasurde closed 5 months ago

Akasurde commented 3 years ago

Environment

Steps or code snippet to reproduce

(Pdb) datastore_summaries = client.vcenter.Datastore.list(filter_spec)
/Volumes/data/venv3/lib/python3.7/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
(Pdb) datastore_summaries
[Summary(datastore='datastore-17', name='ds_171_1', type=Type(string='VMFS'), free_space=12486443008, capacity=13421772800), Summary(datastore='datastore-18', name='ds_171_2', type=Type(string='VMFS'), free_space=158336024576, capacity=214479929344), Summary(datastore='datastore-19', name='ds_200', type=Type(string='VMFS'), free_space=194861072384, capacity=214479929344)]

Actual behavior

No API for getting information about datastore cluster

Expected behavior

some API like get, list for getting information about datastore cluster.

jdotsmith commented 3 years ago

This would be very useful

MalfuncEddie commented 3 years ago

Hey

Is this something that could help?

https://vdc-repo.vmware.com/vmwb-repository/dcr-public/1cd28284-3b72-4885-9e31-d1c6d9e26686/71ef7304-a6c9-43b3-a3cd-868b2c236c81/doc/structures/com/vmware/vcenter/inventory/datastore/svc.info-structure.html

I think you should look for datastore clusters (StoragePod) in inventory/datastore

anusha94 commented 3 years ago

@Akasurde

Does the above link help?

Akasurde commented 3 years ago

@anusha94 Nope. I tried -

(Pdb) client.vcenter.inventory.Datastore.Info(type='StoragePod')
Info(type='StoragePod')

Even if I pass None it does not do anything

(Pdb) client.vcenter.inventory.Datastore.Info(type='')
Info(type='')
(Pdb) client.vcenter.inventory.Datastore.Info(type=None)
Info(type=None)
fetsko commented 2 years ago

Can someone confirm there is no capability to get DatastoreCluster? Or at the very least, determine if a datastore is part of a cluster?

Another nice feature would be the ability to pull the "Related Objects" for a VM via the REST API. 🙏

jobingeo commented 2 years ago

I believe you are looking this for Storage DRS Cluster (SDRS POD). If yes, this capability is not with this SDK. You may need to use pyVmomi libs for this capability.