Amruthapv
Amruthapv

Reputation: 3

Want to write a python module for VMware (ansible) to get the mapping from VM to Storage

How to exactly use the pyvmomi library to get the above mapping, I mean what data structures to use particularly. I suppose it should be done via data store.

def getdatastore(datastore):
try:
  summary = datastore.summary
  return summary.name
except Exception as error:
  print "Unable to access summary for datastore: ", datastore.name
  print error
  pass

tried with the above function but in vain

Upvotes: 0

Views: 109

Answers (1)

Emanuel
Emanuel

Reputation: 722

You said you want to map "from VM to Storage"

Do you mean vm.datastore ?

If not, can you explain your self better ? (I'm sorry I can't comment, dont have 50 rep)

Upvotes: 0

Related Questions