【问题标题】:Want to write a python module for VMware (ansible) to get the mapping from VM to Storage想为VMware(ansible)编写一个python模块来获取从VM到Storage的映射
【发布时间】:2017-09-07 04:24:44
【问题描述】:

如何准确地使用pyvmomi库来得到上面的mapping,我的意思是具体使用什么数据结构。我想应该通过数据存储来完成。

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

用上面的功能试过了,但是没有用

【问题讨论】:

    标签: python ansible-2.x pyvmomi vmware-tools


    【解决方案1】:

    您说要映射“从 VM 到存储”

    你的意思是vm.datastore

    如果没有,你能更好地解释一下你自己吗? (对不起,我不能发表评论,没有 50 个代表)

    【讨论】:

    • 是的,我的意思是 vm.datastore
    • 所以你得到了答案?
    猜你喜欢
    • 1970-01-01
    • 2021-08-24
    • 2022-01-06
    • 2021-08-13
    • 1970-01-01
    • 1970-01-01
    • 2020-12-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多