chef / knife-vsphere

Chef knife plug-in for VMware vSphere
Apache License 2.0
202 stars 125 forks source link

knife vsphere vm migrate did not work #385

Open dzabel opened 7 years ago

dzabel commented 7 years ago

Versions:

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 methodpoolname' for # (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:inwith_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:inrun' 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

'

dzabel commented 7 years ago

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

dzabel commented 7 years ago

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 withno such pool```

swalberg commented 7 years ago

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.