Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

selectedVnic method returns corrupted data? #43

Open
alexfear opened this issue Jun 3, 2014 · 4 comments
Open

selectedVnic method returns corrupted data? #43

alexfear opened this issue Jun 3, 2014 · 4 comments

Comments

@alexfear
Copy link

alexfear commented Jun 3, 2014

Hi,

My environment:
ESXi 5.1 + vCenter 5.1
CentOS 6.4 x64 + ruby 1.9.3p448 + RbVmomi 1.6.0

I've successfully tryed to execute following commands (rails console with rbvmomi library):

opt = {:host=>'myvcenterhost',:user=>'myuser',:password=>'mypassword',:insecure=>true}
vim = RbVmomi::VIM.connect opt
dc = vim.serviceInstance.find_datacenter("datacenter_name") or fail "datacenter not found"
cluster = dc.hostFolder.childEntity.find { |x| x.name == 'cluster_name' } or fail "cluster not found"
host = cluster.host.find { |x| x.name == 'host_name' } or fail 'host not found'
hostvnicmanager = host.config.virtualNicManagerInfo
hostnetconfig = hostvnicmanager.netConfig
hostmgmt = hostnetconfig.find { |x| x.nicType == 'management' } or fail 'not found'
hostmgmtvnics = hostmgmt.selectedVnic

But all I've got at the last step is array of data which doesn't tell me anything to identify management vmk-s:

irb(main):009:0> hostmgmtvnics = hostmgmt.selectedVnic
[2014-06-03 13:09:36 +0300] => [#<RbVmomi::VIM::HostVirtualNic:0x000000094c0168 @props={:dynamicProperty=>[]}>, #<RbVmomi::VIM::HostVirtualNic:0x000000094bf768 @props={:dynamicProperty=>[]}>]

irb(main):010:0> hostmgmtvnics = hostmgmt.selectedVnic[0]
[2014-06-03 13:16:01 +0300] => #<RbVmomi::VIM::HostVirtualNic:0x000000094c0168 @props={:dynamicProperty=>[]}>

irb(main):011:0> hostmgmtvnics = hostmgmt.selectedVnic[0].key
[2014-06-03 13:19:10 +0300] => nil

Although I can see management interfaces with the MOB browser:

selectedVnic string[]

"management.key-vim.host.VirtualNic-vmk0"
"management.key-vim.host.VirtualNic-vmk1"

It seems there's a bug in retrieving list of strings in selectedVnic.

@alexfear alexfear changed the title How to get ESXi management interface? v1.6 bug. How to get ESXi management interface? Jun 4, 2014
@alexfear alexfear changed the title v1.6 bug. How to get ESXi management interface? selectedVnic method returns corrupted data? Jun 4, 2014
@asaenz-vmware
Copy link

This is also an issue for me.

If nothing else, I would like to try and patch it for our own use, but I am having trouble figuring out where exactly in the code this would need to be fixed. Does anybody have any insight?

@MiloCheung
Copy link

hi @asaenz and @alexfear , do you have any idea for this problem? or any hints to patch the gem to solve this problem? thanks!

@MiloCheung
Copy link

hi @jrgarcia , do you have time take a look? I have no idea why the "selectedVnic" does not return a array of string. It only return a array of "HostVirtualNic" object, but this object doesn't include any info on it. Thanks!

@jrgarcia
Copy link
Contributor

@MiloCheung I'll do my best to take a look today, but it may have to wait until Monday. I'll keep you updated.

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

No branches or pull requests

4 participants