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

118 views Asked by At

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

1

There are 1 answers

2
Emanuel On

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)