vmware/pyvmomi-community-samples

How do I get the vminfo quicker.

Open

#13 geöffnet am 28. Mai 2014

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (1 zugewiesene Person)Python (914 Forks)batch import
help wantedlow hanging fruitquestion

Repository-Metriken

Stars
 (972 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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 ?

Contributor Guide