vmware/pyvmomi-community-samples

How do I get the vminfo quicker.

Open

#13 建立於 2014年5月28日

在 GitHub 查看
 (2 留言) (0 反應) (1 負責人)Python (914 fork)batch import
help wantedlow hanging fruitquestion

倉庫指標

Star
 (972 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

We have around 1500 VM's perc vCenter and around 10vCenter's globally.

To get the particular VM info, I am doing this and it is taking really a long time.

container = content.viewManager.CreateContainerView(content.rootFolder, [vim.VirtualMachine], True) for c in container.view: if c.name == name: yourvm = c break return yourvm

....... Retrieving the info from the object like before print yourvm.runtime.powerState() .......and more info

Is there anyway to hit the vm directly and get the info without traversing exhaustively ?

貢獻者指南