Project

General

Profile

Actions

Bug #5630

closed

VmWare clone from template fails if Network Adator has labels in VmWare

Added by Jean-Christophe Counio over 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Compute resources - VMware
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

In VmWare you can define labels for Network Adapters, and that's the list that is returned in the 'New Host' form 'Network interfaces' list.
In app/models/compute_resources/foreman/model/vmware.rb, in clone_vm, the network adapter is hardcoded as "Network adapter 1":
interface = interfaces.detect{|i| i[:name] == "Network adapter 1" }
Since it is not in the interfaces list, clone is failing with error :
Failed to save: Failed to create a compute [...] instance [...]: undefined method `[]' for nil:NilClass
/usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:292:in `clone_vm'
/usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:257:in `create_vm'

Solution would be to use the selected interface from args instead of having it hardcoded


Related issues 5 (0 open5 closed)

Related to Foreman - Bug #5483: Network label empty after cloning vware vm using image and distributed switch for networkClosedIvan Necas04/29/2014Actions
Related to Foreman - Bug #7740: Installing from VMware Image breaks distributed Port Group supportClosed09/29/2014Actions
Related to Foreman - Bug #9704: Network label is unchanged on additional network interfaces with VMware templatesClosedIvan Necas03/10/2015Actions
Related to Foreman - Bug #14874: Path incorrect when using vm_clone methodClosedTimo Goebel04/28/2016Actions
Has duplicate Foreman - Support #9956: Failed to create a compute <Datacenter> (VMWare) instance foo.sub.domain.tld: undefined method `[]' for nil:NilClassResolved03/31/2015Actions
Actions

Also available in: Atom PDF