Late update on this, but turns out the user we've been given to test didn't have the proper rights to query what we needed. My Python script is working great now, but just stuck with one last issue:
Is there perhaps some way I can print the Datacentres as well? My script currently looks as follows:
#!/usr/bin/env python
from pysphere import VIServer, VIProperty
def main():
server = VIServer()
server.connect("""HOST""", """USER""", """PASSWORD""")
for ds_mor, name in server.get_datastores().items():
props = VIProperty(server, ds_mor)
if hasattr(props.summary, "uncommitted"):
print "DATASTORE: "+str(name)+", Type: "+str(props.summary.type)+", Capacity: "+str(props.summary.capacity)+", Free space: "+str(props.summary.freeSpace)+", Uncommited: "+str(props.summary.uncommitted)
else:
print "DATASTORE: "+str(name)+", Type: "+str(props.summary.type)+", Capacity: "+str(props.summary.capacity)+", Free space: "+str(props.summary.freeSpace)+", Uncommited: N/A"
server.disconnect()
if __name__ == '__main__':
main()
The above produces something like this:
DATASTORE: itsimdhdat65-0257g5, Type: VMFS, Capacity: 573915004928, Free space: 142895742976, Uncommited: 0
DATASTORE: itsimdhdat67-0257g5, Type: VMFS, Capacity: 549487378432, Free space: 248160190464, Uncommited: 1073741824
DATASTORE: itsimdhdat68-0257g5, Type: VMFS, Capacity: 549487378432, Free space: 125776691200, Uncommited: 0
DATASTORE: itsimdhdat60-0257g5, Type: VMFS, Capacity: 573915004928, Free space: 433727733760, Uncommited: 0
What I'm hoping to get is something like this:
DATACENTRE: PlaceA, DATASTORE: itsimdhdat65-0257g5, Type: VMFS, Capacity: 573915004928, Free space: 142895742976, Uncommited: 0
DATACENTRE: PlaceA, DATASTORE: itsimdhdat67-0257g5, Type: VMFS, Capacity: 549487378432, Free space: 248160190464, Uncommited: 1073741824
DATACENTRE: PlaceB, DATASTORE: itsimdhdat68-0257g5, Type: VMFS, Capacity: 549487378432, Free space: 125776691200, Uncommited: 0
DATACENTRE: PlaceB, DATASTORE: itsimdhdat60-0257g5, Type: VMFS, Capacity: 573915004928, Free space: 433727733760, Uncommited: 0
Is there hopefully an easy-ish way to do this?
Cheers