Giter Club home page Giter Club logo

Comments (9)

dougm avatar dougm commented on August 18, 2024

Finder is probably just looking in RootFolder.VmFolder and not its child folders.
We can take a look at this after the holiday.

from govmomi.

mkuzmin avatar mkuzmin commented on August 18, 2024

any progress on this?

Or can you suggest any other method to find a VM by name without knowing its full path? In Java SDK I used InventoryNavigator object. Is there anything similar here?

from govmomi.

dougm avatar dougm commented on August 18, 2024

The path given to finder.VirtualMachine is relative to the datacenter vmFolder. You can use "folderName/vmName" or "*/vmName". But we should probably add an option to recurse folders so we can find by name without a folder path.

from govmomi.

hickeng avatar hickeng commented on August 18, 2024

I've just been using FindChildByName in the interim. Not quite as concise and you need to process the reference returned, but viable.
Please excuse me if I've got the function name slightly wrong, phone isn't good at browsing source.

George Hicken - mobile
[email protected]

-------- Original message --------
From: Doug MacEachern
Date:20/01/2015 09:37 (GMT-08:00)
To: vmware/govmomi
Cc: George Hicken
Subject: Re: [govmomi] finder.VirtualMachine and VC (#190)

The path given to finder.VirtualMachine is relative to the datacenter vmFolder. You can use "folderName/vmName" or "*/vmName". But we should probably add an option to recurse folders so we can find by name without a folder path.

Reply to this email directly or view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_vmware_govmomi_issues_190-23issuecomment-2D70696710&d=AwMCaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=L-LyLb1unlxXapNcjXSnKTCKMcG8Cri5xCWWbQc0kEA&m=qplbLogxxQWw7qAr9GAksFTUH3NKdVYPx9Xptst_PHU&s=GMg8TH5FS-uFnsryZf8ssKsAt3J79uMJ6x0X1fxEVT0&e=.

from govmomi.

dougm avatar dougm commented on August 18, 2024

I had looked into that and tested it out, but doesn't look like it recurses into sub folders:

http://pubs.vmware.com/vsphere-55/topic/com.vmware.wssdk.apiref.doc/vim.SearchIndex.html#findChild

"This only searches the immediate children of a managed entity"

from govmomi.

mkuzmin avatar mkuzmin commented on August 18, 2024

VM name is an unique property, and enumerating all the folders on the a client side doesn't look as effective solution. SearchIndex doesn't provide such lookup methods, but there is alternate API. Here is how I currently do that in Groovy:
def vm = new InventoryNavigator(client.getRootFolder()).searchManagedEntity("VirtualMachine", "name")
It would be great to have the same API here.

from govmomi.

dougm avatar dougm commented on August 18, 2024

Agreed, I'll try to look into this over the weekend or early next week.

from govmomi.

mkuzmin avatar mkuzmin commented on August 18, 2024

Any update on this?

from govmomi.

aashishparikh avatar aashishparikh commented on August 18, 2024

Hey guys.. Any updates?

from govmomi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.