Comments (9)
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.
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.
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.
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.
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.
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.
Agreed, I'll try to look into this over the weekend or early next week.
from govmomi.
Any update on this?
from govmomi.
Hey guys.. Any updates?
from govmomi.
Related Issues (20)
- How to migrate both vm and storage using govc commands. HOT 5
- [BUG] WaitEx omits updates when the server GUID is not set HOT 1
- [BUG] add optional SSLCertificate to TransferEndpoint in content library API HOT 1
- [BUG] Fail to create a new VM using PowerCLI integration HOT 2
- [BUG] vcsim: #2911 mandated to pass the new disk size in Bytes and KB. If either of value is 0, ReconfigVM_Task is throwing *types.InvalidDeviceOperation HOT 1
- Ability to create file-share volumes using vcsim HOT 2
- [BUG] govc import.ova not working if ESXI hostnames don't don't resolve HOT 2
- [BUG] Export to ovf makes a bad ovf file HOT 1
- [BUG] Invalid operation for device '0' in 0.37.2 HOT 2
- [BUG] Customize option failing for Windows VM due to missing Userdata HOT 1
- [BUG] DistributedVirtualSwitchManager:DVSManager does not implement: QueryDvsByUuid HOT 1
- vCenter : QueryPerf metrics support
- [BUG] ReadNextEvents method gets stuck HOT 9
- How to expand a block storage by methods.ExpandVmfsDatastore? HOT 1
- [BUG] VirtualAppList function can't handle nested Virtual Apps HOT 1
- [BUG] govc v0.37.2 command vm.disk.change always fail HOT 2
- [BUG] Permission Error with ContinueRetrievePropertiesEx in govc v0.37.0+ on vSphere 8.x HOT 5
- [BUG] govc.exe find . -type m -runtime.powerState poweredOn fails on Windows HOT 4
- Virtual Watchdog timer support HOT 2
- [BUG] Can't resize a VM's disk HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from govmomi.