knife-vsphere
knife-vsphere copied to clipboard
knife vsphere vm migrate did not work
Versions:
- Version of knife-vsphere: 2.0.0
- Version of chef: 12.16.42
Scenario:
Command:
knife vsphere vm migrate -VV "8.0.4.0-1.0.7-3.1.2" --dest-datastore vnx01_data6 --folder '_Templates/wcs_templates' --resource-pool 'VMCluster_Dev/Product Center - Infrastructure Service and Testing'
INFO: Using configuration from ~/.chef/knife.rb
DEBUG: value for config item vsphere_host: xxxx
DEBUG: value for config item vsphere_path: /sdk
DEBUG: value for config item vsphere_port: 443
DEBUG: value for config item vsphere_nossl:
DEBUG: value for config item vsphere_user: xxxx
DEBUG: value for config item vsphere_pass: xxxx
DEBUG: value for config item vsphere_pass: xxxx
DEBUG: value for config item vsphere_pass: xxxx
DEBUG: value for config item vsphere_insecure: true
DEBUG: value for config item proxy_host:
DEBUG: value for config item proxy_port:
DEBUG: value for config item vsphere_dc: CMDataCenterHH
DEBUG: value for config item folder: _Templates/wcs_templates
DEBUG: value for config item vsphere_dc: CMDataCenterHH
DEBUG: value for config item vsphere_dc: CMDataCenterHH
DEBUG: value for config item vsphere_dc: CMDataCenterHH
/Users/dzabel/.chefdk/gem/ruby/2.3.0/gems/knife-vsphere-2.0.0/lib/chef/knife/vsphere_vm_migrate.rb:67:in run': undefined local variable or method
poolname' for #Chef::Knife::VsphereVmMigrate:0x007fb4802b1a60 (NameError)
from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/knife.rb:443:in block in run_with_pretty_exceptions' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/local_mode.rb:44:in
with_server_connectivity'
from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/knife.rb:442:in run_with_pretty_exceptions' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/knife.rb:219:in
run'
from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/application/knife.rb:156:in run' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/bin/knife:25:in
<top (required)>'
from /opt/chefdk/bin/knife:58:in load' from /opt/chefdk/bin/knife:58:in
Output knife vpshere pool list
:
Pool: VMCluster_Core/Solution Center - Training und Website Pool: VMCluster_Dev/Product Center - Infrastructure Service and Testing Pool: VMCluster_Dev/Solution Center - Demos und POCs
using knife vsphere vm migrate "8.0.4.0-1.0.7-3.1.2" --dest-datastore vnx01_data6 --folder '_Templates/wcs_templates' --resource-pool 'Product Center - Infrastructure Service and Testing' did exit with
no such pool```
That error on line 67 is a scoping error (poolname
should be config[:resource_pool]
) but I have a feeling this command doesn't work well with pools with /
in the name. I'm not sure why the code looks for the pool twice, in two different ways. Will need to do some more sleuthing.
If you feel like playing around you could drop line 67 and then use npool
in the later lines instead of pool
.