Open gstag opened 7 years ago
IIRC the UUID needs to be 50:1d:d5:80:d3:82:b0:34-6b:ac:62:97:7e:1c:08:50
, can you try that, please?
knife vsphere vm clone hostname --template CentOS-07-64-bit --datastore VMFS03 --cspec centOS7 --cips IP --sw-uuid "50:1d:d5:80:d3:82:b0:34-6b:ac:62:97:7e:1c:08:50" --cvlan vlan.2105
ERROR: knife encountered an unexpected error
This may be a bug in the 'vsphere vm clone' knife command or plugin
Please collect the output of this command with the -VV
option before filing a bug report.
Exception: NoMethodError: undefined method `name' for nil:NilClass
earth [~/temp/] > knife vsphere vm clone -VV cm-relay-02 --template CentOS-07-64-bit --datastore VMFS03 --cspec centOS7 --cips IP --sw-uuid "50:1d:d5:80:d3:82:b0:34-6b:ac:62:97:7e:1c:08:50" --cvlan vlan.2105
INFO: Using configuration from /Users/gregory/.chef/knife.rb
DEBUG: value for config item datastore: VMFS03
DEBUG: value for config item datastorecluster:
DEBUG: value for config item customization_macs: auto
DEBUG: value for config item chef_node_name:
DEBUG: value for config item vsphere_host: vcenter.host
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: rescue in block in generate_clone_spec': undefined method
name' for nil:NilClass (NoMethodError)
from /Users/gregory/.chefdk/gem/ruby/2.4.0/gems/knife-vsphere-2.0.1/lib/chef/knife/vsphere_vm_clone.rb:635:in block in generate_clone_spec' from /Users/gregory/.chefdk/gem/ruby/2.4.0/gems/knife-vsphere-2.0.1/lib/chef/knife/vsphere_vm_clone.rb:633:in
each'
from /Users/gregory/.chefdk/gem/ruby/2.4.0/gems/knife-vsphere-2.0.1/lib/chef/knife/vsphere_vm_clone.rb:633:in each_with_index' from /Users/gregory/.chefdk/gem/ruby/2.4.0/gems/knife-vsphere-2.0.1/lib/chef/knife/vsphere_vm_clone.rb:633:in
generate_clone_spec'
from /Users/gregory/.chefdk/gem/ruby/2.4.0/gems/knife-vsphere-2.0.1/lib/chef/knife/vsphere_vm_clone.rb:368:in run' from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42/lib/chef/knife.rb:442:in
block in run_with_pretty_exceptions'
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42/lib/chef/local_mode.rb:44:in with_server_connectivity' from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42/lib/chef/knife.rb:441:in
run_with_pretty_exceptions'
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42/lib/chef/knife.rb:219:in run' from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42/lib/chef/application/knife.rb:156:in
run'
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42/bin/knife:25:in <top (required)>' from /usr/local/bin/knife:264:in
load'
from /usr/local/bin/knife:264:in `
Versions:
Platform Details
Scenario:
I am using knife-vsphere-2.0.1.gem version and i try to deploy a vm with the following command
knife vsphere vm clone --template CentOS-07-64-bit --datastore VMFS07 --cspec centOS7.template --sw-uuid "50 1d d5 80 d3 82 b0 34-6b ac 62 97 7e 1c 08 50" --cips PRIVATE_IP/24 --cvlan "vlan.2105"
The VM was deployed right but the in wrong DS network switch. I find the --sw-uuid inside the folder .dvsData in the datastore VMFS07
Any help would be really appreciated. Thank you