Support #9956
closedFailed to create a compute <Datacenter> (VMWare) instance foo.sub.domain.tld: undefined method `[]' for nil:NilClass
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
Updated by Christian Meißner over 9 years ago
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
Updated by Dominic Cleal over 9 years ago
- Is duplicate of Bug #5630: VmWare clone from template fails if Network Adator has labels in VmWare added
Updated by Dominic Cleal over 9 years ago
- Status changed from New to Feedback
This looks like bug #5630, which is unfortunately still open.
Updated by Anthony Lapenna over 9 years ago
- File production_1.8.1.log production_1.8.1.log added
Same issue here in Foreman 1.8.1, joining my production log.
Updated by Anthony Lapenna over 9 years ago
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').
Updated by Timo Goebel over 9 years ago
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?
Updated by Dominic Cleal over 9 years ago
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.