Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finder.HostSystem doesn't seem to be returning the correct host #192

Closed
bitwisekaizen opened this issue Dec 23, 2014 · 3 comments
Closed

Comments

@bitwisekaizen
Copy link

I first noticed this when I was using the finder.HostSystem function for my project that's consuming govmomi. I thought it was me, but now I'm not so sure about that given the following output.

$ govc host.info -dc=858c7e1d-89f7-11e4-934e-80e6500a64dc -host.ip=192.168.238.139
Name:            192.168.238.139
Manufacturer:    VMware, Inc.
Logical CPUs:    4 CPUs @ 2793MHz
Processor type:  Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Memory:          4095MB
Boot time:       2014-12-21 19:20:50.556233 +0000 UTC
$ govc host.info -dc=858c7e1d-89f7-11e4-934e-80e6500a64dc -host=192.168.238.139
Error: no such host

finder.HostSystem is actually not used all that much in the code. In fact, after grepping a bit, the only place I found it was in flags/host_system.go. I'll have to dig in a little more, but I suspect this is something I'll have to fix to address the AddStandaloneHost and Destroy host issue I filed yesterday. In the event that I'm off base on this I'm happy to be corrected in order to save myself the time and trouble. :-D

@bitwisekaizen
Copy link
Author

Interestingly enough host.bats pass for me. Looking at the tests, it seem that -host is actually expecting an inventory path, which is why host.bats passes without issues.

$ govc host.info -dc=858c7e1d-89f7-11e4-934e-80e6500a64dc -host=/e854bc16-8a48-11e4-a75e-80e6500a64dc/host/192.168.238.139/192.168.238.139
Name:            192.168.238.139
Manufacturer:    VMware, Inc.
Logical CPUs:    4 CPUs @ 2793MHz
Processor type:  Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Memory:          4095MB
Boot time:       2014-12-21 19:45:09.969722 +0000 UTC

This seems counterintuitive that we have to supply finder with a path in order to find the thing we're looking for. Perhaps I'm wrong on this, but this doesn't seem to behave the same way as it did for finder.Datacenter.

bitwisekaizen pushed a commit to bitwisekaizen/govmomi that referenced this issue Jan 3, 2015
bitwisekaizen pushed a commit to bitwisekaizen/govmomi that referenced this issue Jan 4, 2015
bitwisekaizen pushed a commit to bitwisekaizen/govmomi that referenced this issue Jan 4, 2015
@bitwisekaizen
Copy link
Author

PR submitted. recurser.Recurse was matching the ComputeResource in the hostFolder, not the HostSystem child of the ComputeResource.

Jan 5, 2015
Issue #192: HostSystem doesn't seem to be returning the correct host.
Copy link
Member

Fixed in PR #195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants