{"action":"created","issue":{"url":"https://api.github.com/repos/ezrapagel/knife-vsphere/issues/148","labels_url":"https://api.github.com/repos/ezrapagel/knife-vsphere/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/ezrapagel/knife-vsphere/issues/148/comments","events_url":"https://api.github.com/repos/ezrapagel/knife-vsphere/issues/148/events","html_url":"https://github.com/ezrapagel/knife-vsphere/issues/148","id":68368977,"number":148,"title":"knife vpshere vm clone using cplugin option failing","user":{"login":"kamalim","id":1729108,"avatar_url":"https://avatars.githubusercontent.com/u/1729108?v=3","gravatar_id":"","url":"https://api.github.com/users/kamalim","html_url":"https://github.com/kamalim","followers_url":"https://api.github.com/users/kamalim/followers","following_url":"https://api.github.com/users/kamalim/following{/other_user}","gists_url":"https://api.github.com/users/kamalim/gists{/gist_id}","starred_url":"https://api.github.com/users/kamalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kamalim/subscriptions","organizations_url":"https://api.github.com/users/kamalim/orgs","repos_url":"https://api.github.com/users/kamalim/repos","events_url":"https://api.github.com/users/kamalim/events{/privacy}","received_events_url":"https://api.github.com/users/kamalim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-14T13:15:16Z","updated_at":"2015-04-14T13:21:52Z","closed_at":null,"body":"I am using the following command:\r\nknife vsphere vm clone test1 --template windows_server_2008_r2 --cplugin ./knife_windows_cplugin.rb --cplugin-data ./data.rb\r\n\r\nBut it fails with error FATAL: Please provide Windows Guest Customization\r\nSo I created a customization spec (though I would want to avoid it) and the used the below command\r\nknife vsphere vm clone test1 --template windows_server_2008_r2 --cplugin \"./knife_windows_cplugin.rb\" --cplugin-data \"data.rb\" --cspec \"windows_spec.xml\"\r\n\r\nbut it failed with below error \r\n\r\n/Users/kamalim/.rvm/gems/ruby-2.0.0-p598/gems/rbvmomi-1.8.2/lib/rbvmomi/connection.rb:61:in `parse_response': NotFound: The object or item referred to could not be found. (RbVmomi::Fault)\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/gems/rbvmomi-1.8.2/lib/rbvmomi/connection.rb:90:in `call'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/gems/rbvmomi-1.8.2/lib/rbvmomi/basic_types.rb:205:in `_call'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/gems/rbvmomi-1.8.2/lib/rbvmomi/basic_types.rb:74:in `block (2 levels) in init'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/gems/knife-vsphere-1.0.1/lib/chef/knife/vsphere_vm_clone.rb:499:in `find_customization'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/gems/knife-vsphere-1.0.1/lib/chef/knife/vsphere_vm_clone.rb:402:in `generate_clone_spec'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/gems/knife-vsphere-1.0.1/lib/chef/knife/vsphere_vm_clone.rb:265:in `run'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/gems/chef-12.2.1/lib/chef/knife.rb:419:in `block in run_with_pretty_exceptions'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/gems/chef-12.2.1/lib/chef/local_mode.rb:38:in `with_server_connectivity'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/gems/chef-12.2.1/lib/chef/knife.rb:418:in `run_with_pretty_exceptions'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/gems/chef-12.2.1/lib/chef/knife.rb:214:in `run'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/gems/chef-12.2.1/lib/chef/application/knife.rb:138:in `run'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/gems/chef-12.2.1/bin/knife:25:in `<top (required)>'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/bin/knife:23:in `load'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/bin/knife:23:in `<main>'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/bin/ruby_executable_hooks:15:in `eval'\r\n\tfrom /Users/kamalim/.rvm/gems/ruby-2.0.0-p598/bin/ruby_executable_hooks:15:in `<main>'\r\n\r\n\r\nSo I have how can I use my customized plugin without Windows Customization spec or is there any other option.I am using the custom plugin as specified in the readme."},"comment":{"url":"https://api.github.com/repos/ezrapagel/knife-vsphere/issues/comments/92827358","html_url":"https://github.com/ezrapagel/knife-vsphere/issues/148#issuecomment-92827358","issue_url":"https://api.github.com/repos/ezrapagel/knife-vsphere/issues/148","id":92827358,"user":{"login":"kamalim","id":1729108,"avatar_url":"https://avatars.githubusercontent.com/u/1729108?v=3","gravatar_id":"","url":"https://api.github.com/users/kamalim","html_url":"https://github.com/kamalim","followers_url":"https://api.github.com/users/kamalim/followers","following_url":"https://api.github.com/users/kamalim/following{/other_user}","gists_url":"https://api.github.com/users/kamalim/gists{/gist_id}","starred_url":"https://api.github.com/users/kamalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kamalim/subscriptions","organizations_url":"https://api.github.com/users/kamalim/orgs","repos_url":"https://api.github.com/users/kamalim/repos","events_url":"https://api.github.com/users/kamalim/events{/privacy}","received_events_url":"https://api.github.com/users/kamalim/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T13:21:52Z","updated_at":"2015-04-14T13:21:52Z","body":"here is my knife_windows_cplugin.rb\r\nrequire 'rbvmomi'\r\n\r\nclass KnifeVspherePlugin\r\n  attr_accessor :data\r\n\r\n  def customize_clone_spec(src_config, clone_spec)\r\n\r\n    if File.exists? data\r\n      customization_data = JSON.parse(IO.read(data))\r\n    else\r\n      abort \"Customization plugin data file #{data} not accessible\"\r\n    end\r\n\r\n    cust_guiUnattended = RbVmomi::VIM.CustomizationGuiUnattended(\r\n      :autoLogon => false,\r\n      :autoLogonCount => 1,\r\n      :password => nil,\r\n      :timeZone => customization_data['timeZone']\r\n    )\r\n    cust_identification = RbVmomi::VIM.CustomizationIdentification(\r\n      :domainAdmin => nil,\r\n      :domainAdminPassword => nil,\r\n      :joinDomain => nil\r\n    )\r\n    cust_name = RbVmomi::VIM.CustomizationFixedName(\r\n      :name => customization_data['host_name']\r\n    )\r\n    cust_user_data = RbVmomi::VIM.CustomizationUserData(\r\n      :computerName => cust_name,\r\n      :fullName => customization_data['fullName'],\r\n      :orgName => customization_data['orgName'],\r\n      :productId => customization_data['windows_key']\r\n    )\r\n    cust_sysprep = RbVmomi::VIM.CustomizationSysprep(\r\n      :guiUnattended => cust_guiUnattended,\r\n      :identification => cust_identification,\r\n      :userData => cust_user_data\r\n    )\r\n    dhcp_ip = RbVmomi::VIM.CustomizationDhcpIpGenerator\r\n    cust_ip = RbVmomi::VIM.CustomizationIPSettings(\r\n      :ip => dhcp_ip\r\n    )\r\n    cust_adapter_mapping = RbVmomi::VIM.CustomizationAdapterMapping(\r\n      :adapter => cust_ip\r\n    )\r\n    cust_adapter_mapping_list = [cust_adapter_mapping]\r\n    global_ip = RbVmomi::VIM.CustomizationGlobalIPSettings\r\n    customization_spec = RbVmomi::VIM.CustomizationSpec(\r\n      :identity => cust_sysprep,\r\n      :globalIPSettings => global_ip,\r\n      :nicSettingMap => cust_adapter_mapping_list\r\n    )\r\n    clone_spec.customization = customization_spec\r\n    puts \"New clone_spec object :\\n #{YAML::dump(clone_spec)}\"\r\n    clone_spec\r\n  end\r\n\r\n  def reconfig_vm (target_vm)\r\n    puts \"In reconfig_vm method.  No actions implemented..\"\r\n  end\r\nend"}}