rubiojr/knife-esx — Issue #2: NoMethodError when running vm list
Author: bradmontgomery
Created: 2012-02-20 21:35:20+00:00
State: open

Hi,

I'm getting a NoMethodError when running `knife esx vm list`. I've got the appropriate settings in my knife.rb file (I can log into my vsphere client with these). Any idea why I'm getting the error below? Am I doing something wrong?

Thanks in advance!

My knife.rb contains:
```
knife[:esx_host] = "10.1.2.3"
knife[:esx_username] = "myusername"
knife[:esx_password] = "mypassword"
```

And now for the output:
```
$ knife esx vm list --esx-host 10.1.2.3 --esx-username myusername --esx-password mypassword
Connecting to ESX host 10.1.2.3...
ERROR: knife encountered an unexpected error
This may be a bug in the 'esx vm list' knife command or plugin
Please collect the output of this command with the `-VV` option before filing a bug report.
Exception: NoMethodError: undefined method `summary' for Folder("group-v85"):RbVmomi::VIM::Folder
```

Verbose output:
```
$ knife esx vm list -VV --esx-host 10.1.2.3 --esx-username myusername --esx-password mypassword
DEBUG: Using configuration from /Users/brad/coroutine/chef-coroutine/.chef/knife.rb
Connecting to ESX host 10.1.2.3...
/Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/esx-0.3.2/lib/esx.rb:320:in `wrap': undefined method `summary' for Folder("group-v85"):RbVmomi::VIM::Folder (NoMethodError)
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/esx-0.3.2/lib/esx.rb:210:in `block in virtual_machines'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/esx-0.3.2/lib/esx.rb:209:in `each'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/esx-0.3.2/lib/esx.rb:209:in `virtual_machines'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/knife-esx-0.1.4/lib/chef/knife/esx_vm_list.rb:33:in `block in run'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/terminal-table-1.4.4/lib/terminal-table/table.rb:211:in `yield_or_eval'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/terminal-table-1.4.4/lib/terminal-table/table.rb:17:in `initialize'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/terminal-table-1.4.4/lib/terminal-table/table_helper.rb:5:in `new'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/terminal-table-1.4.4/lib/terminal-table/table_helper.rb:5:in `table'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/knife-esx-0.1.4/lib/chef/knife/esx_vm_list.rb:31:in `run'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/chef-0.10.8/lib/chef/knife.rb:391:in `run_with_pretty_exceptions'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/chef-0.10.8/lib/chef/knife.rb:166:in `run'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/chef-0.10.8/lib/chef/application/knife.rb:128:in `run'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/gems/chef-0.10.8/bin/knife:25:in `'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/bin/knife:19:in `load'
from /Users/brad/.rvm/gems/ruby-1.9.3-p0@chef/bin/knife:19:in `

'
```