Support #9956
closed
Failed to create a compute <Datacenter> (VMWare) instance foo.sub.domain.tld: undefined method `[]' for nil:NilClass
Added by Christian Meißner over 9 years ago.
Updated over 7 years ago.
Description
If we try to create a virtual machine (compute resource vmware) with image based provisioning method we get the error message above. Log is attached but we can't find helpful information there.
The service user which is used to connect to vSphere-Server is attached to role Admin so it can't be a permission problem.
Image is defined as followed:
Name: test
OS: Ubuntu Trusty Thar
Arch: x86_64
User: *
Pass: *
Image path: aaa_Templates/foreman-trusty-image-01
Files
Environmentinformation:
Ubuntu 14.04
foreman 1.7.3-1
foreman-compute 1.7.3-1
foreman-proxy 1.7.3-1
foreman-sqlite3 1.7.3-1
foreman-vmware 1.7.3-1
Software installed from deb.theforman.org
- Is duplicate of Bug #5630: VmWare clone from template fails if Network Adator has labels in VmWare added
- Status changed from New to Feedback
This looks like bug #5630, which is unfortunately still open.
Same issue here in Foreman 1.8.1, joining my production log.
I've been able to patch the issue on my Foreman host by editing the file /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb and by replacing the line 359:
interface = interfaces.detect{|i| i[:name] == "Network adapter 1" }
With:
interface = interfaces.detect{|i| i[:name].end_with?('1') }
Works for me on a French vsphere installation (interface is named 'Adaptateur réseau 1').
The patch Anthony Lapenna suggested fixed this with a packer build template in German as well.
I could prepare a PR for this. What do you think?
Timo, yes, that'd be a help I think. Please use ticket #5630 if you do submit a patch.
The other element that hasn't been fixed and seems to affect some languages is http://projects.theforeman.org/issues/5630#note-4, which I'd expect you to hit with a German instance - the Datacenter name is different.
should be resolved by now.
- Status changed from Feedback to Resolved
Also available in: Atom
PDF