chef / knife-vsphere

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

wrong DS network switch #397

Open gstag opened 7 years ago

gstag commented 7 years ago

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

swalberg commented 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?

gstag commented 7 years ago

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: DEBUG: value for config item vsphere_pass: DEBUG: value for config item vsphere_pass: DEBUG: value for config item vsphere_pass: 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: Datacenter DEBUG: value for config item folder: DEBUG: value for config item vsphere_dc: Datacenter DEBUG: value for config item linked_clone: DEBUG: value for config item host: DEBUG: value for config item resource_pool: DEBUG: value for config item vsphere_dc: Datacenter DEBUG: value for config item datastore: VMFS03 DEBUG: value for config item datastore: VMFS03 DEBUG: value for config item vsphere_dc: Datacenter DEBUG: value for config item datastorecluster: DEBUG: value for config item customization_vlan: vlan.2105 DEBUG: value for config item customization_vlan: vlan.2105 DEBUG: value for config item vsphere_dc: Datacenter DEBUG: value for config item linked_clone: DEBUG: value for config item datastore: VMFS03 DEBUG: value for config item datastore: VMFS03 DEBUG: value for config item vsphere_dc: Datacenter DEBUG: value for config item datastorecluster: DEBUG: value for config item thin_provision: DEBUG: value for config item mark_as_template: DEBUG: value for config item annotation: DEBUG: value for config item customization_cpucount: DEBUG: value for config item customization_corespersocket: DEBUG: value for config item customization_memory: DEBUG: value for config item customization_memory_reservation: DEBUG: value for config item customization_macs: auto DEBUG: value for config item customization_ips: DEBUG: value for config item customization_sw_uuid: 50:1d:d5:80:d3:82:b0:34-6b:ac:62:97:7e:1c:08:50 DEBUG: value for config item customization_vlan: vlan.2105 DEBUG: value for config item customization_sw_uuid: 50:1d:d5:80:d3:82:b0:34-6b:ac:62:97:7e:1c:08:50 DEBUG: value for config item customization_sw_uuid: 50:1d:d5:80:d3:82:b0:34-6b:ac:62:97:7e:1c:08:50 DEBUG: value for config item customization_vlan: vlan.2105 DEBUG: value for config item customization_vlan: vlan.2105 DEBUG: value for config item customization_sw_uuid: 50:1d:d5:80:d3:82:b0:34-6b:ac:62:97:7e:1c:08:50 DEBUG: value for config item vsphere_dc: Datacenter DEBUG: value for config item customization_sw_uuid: 50:1d:d5:80:d3:82:b0:34-6b:ac:62:97:7e:1c:08:50 /Users/gregory/.chefdk/gem/ruby/2.4.0/gems/knife-vsphere-2.0.1/lib/chef/knife/vsphere_vm_clone.rb:648:in rescue in block in generate_clone_spec': undefined methodname' 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:ineach' 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:ingenerate_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:inblock 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:inrun_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:inrun' 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:inload' from /usr/local/bin/knife:264:in `

'