Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `[]' for nil:NilClass (vSphere Provisioning) #523

Open
jsstormshak opened this issue Jun 9, 2016 · 0 comments
Open

undefined method `[]' for nil:NilClass (vSphere Provisioning) #523

jsstormshak opened this issue Jun 9, 2016 · 0 comments

Comments

@jsstormshak
Copy link

Undefined method when attempting to converge a cloned vCenter VM from Template. The cloning is fully successful within this same Cookbook, however, the start_up (Power On) fails and produces this error. See details below. Any and all help here is greatly appreciated. Thanks!

vCenter 6
Chef vSphere Provisioning Cookbook - 0.8.3
Chef Client 12.5.1

Actual Cookbook:
chef_gem 'chef-provisioning-vsphere' do
action :install
compile_time true
end
require 'chef/provisioning/vsphere_driver'
with_vsphere_driver host: 'vcenter-2.domain.com',
insecure: true,
user: 'domain\username,
password: 'password'
with_machine_options :bootstrap_options => {
use_linked_clone: true,
num_cpus: 1,
memory_mb: 2048,
datacenter: 'Marion',
host: 'Management/esxi-15b14.domain.com',
template_name: 'Service-Portal-Template-VM',
template_folder: 'Linux/Infrastructure/SelfServicePortal',
vm_folder: 'Linux/Infrastructure/SelfServicePortal',
chef_server: "https://ma-chefserver-p1.cccis.com:443",
chef_environment: "Chef Development",
customization_spec: {
ipsettings: {
ip: '10.88.65.xx',
subnetMask: '255.255.252.0',
gateway: ['10.88.xx.1'],
dnsServerList: ['10.88.196.xx','10.88.196.xx']
},
domain: 'domain.com'
}
},
:ssh => {
:user => 'chefboot',
:password => 'password',
:paranoid => false,
:port => 22
},
:sudo => true

machine 'ma-Service-Portal-p1' do
run_list ['recipe[Linux_Run_Once::Manage_Run_Once]']
action :converge
end

Output that includes details and error message:
establishing connection to ma-vcs-2.win.cccis.com
- creating machine ma-Service-Portal-p1 on vsphere://vcenter-2.domain.com/sdk?use_ssl=true&insecure=true
- use_linked_clone: true
- num_cpus: 1
- memory_mb: 2048
- datacenter: "Marion"
- template_name: "ma-vanilla-OL5U5-OSOnly-NoSANFS"
- template_folder: "Linux/Infrastructure/SelfServicePortal"
- vm_folder: "Linux/Infrastructure/SelfServicePortal"
- chef_server: "https://chefserver.domain.com:443"
- chef_environment: "Chef Development"
- customization_spec: {:ipsettings=>{:ip=>"10.88.65.XX", :subnetMask=>"255.255.252.0", :gateway=>["10.88.XX.1"], :dnsServerList=>["10.88.196.54", "10.88.196.55"]}, :domain=>"cccis.com"}
- customizing ma-Service-Portal-p1 with static IP 10.88.65.XX
- customizing ma-Service-Portal-p1 with /
dynamic IP and DNS: ["10.88.196.XX", "10.88.196.XX"]
- Machine - created - ma-Service-Portal-p1 (5016359f-e732-a9e2-ae59-f7917a3c28e3 on vsphere://vcenter-2.domain.com/sdk?use_ssl=true&insecure=true)[2016-06-08T18:58:58+00:00] INFO: Processing chef_node[ma-Service-Portal-p1] action create (basic_chef_client::block line 57)

- update node ma-Service-Portal-p1 at chefzero://localhost:8889
-   update normal.chef_provisioning.reference.server_id from "50162694-3ce0-c57d-0ed5-10bc6d9ba23f" to "5016359f-e732-a9e2-ae59-f7917a3c28e3"
-   update normal.chef_provisioning.reference.allocated_at from "2016-06-08 18:43:46 UTC" to "2016-06-08 18:58:58 UTC"
-   update run_list from ["recipe[Linux_Run_Once]"] to ["Linux_Run_Once"]
=============================================================================
Error executing action `converge` on resource 'machine[ma-Service-Portal-p1]'

    NoMethodError
-------------
undefined method `[]' for nil:NilClass
Resource Declaration:
---------------------
# In /home/jstormsh/.chef/local-mode-cache/cache/cookbooks/Linux_Adhoc_Deployments/recipes/Manage_Adhoc_Deploys.rb
---------------------
# In /home/jstormsh/.chef/local-mode-cache/cache/cookbooks/Linux_Adhoc_Deployments/recipes/Manage_Adhoc_Deploys.rb

 49: machine 'ma-Service-Portal-p1' do
 50:   run_list ['recipe[Linux_Run_Once::Manage_Run_Once]']
 51:   action :converge
 52:   converge true
 53: end

Stack Trace:
Generated at 2016-06-09 16:00:45 +0000
NoMethodError: machine[ma-Service-Portal-p1](Linux_Adhoc_Deployments::Manage_Adhoc_Deploys line 49) had an error: NoMethodError: undefined method []' for nil:NilClass /home/jstormsh/.chefdk/gem/ruby/2.1.0/gems/chef-provisioning-vsphere-0.8.3/lib/chef/provisioning/vsphere_driver/driver.rb:418:inblock in start_machine'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant