Project

General

Profile

Bug #10168

Foreman names VM's incorrectly when using multiple nics for provisioning

Added by David Patterson over 6 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Host creation
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Using Foreman 1.8rc3 and multiple nics:
eth0:
DNS Name = servername
Checked items = Primary
Network = Static

eth1:
DNS Name = servername-dhcp
Checked items = Manged, Provisioning
Network = DHCP

When 'submit' is clicked, VMware creates the vm with the name 'servername-dhcp'. I'd expect the VM name to be the the same as the "Primary" interface.

The host is created with the correct "Primary" interface name in Foreman, 'servername'. The yaml output from the provisioned host reflects the correct settings:

foreman_interfaces:
- mac: 00:50:56:93:02:6a
ip: 1.2.3.4
type: Interface
name: servername.domain.name
attrs: {}
virtual: false
link: true
identifier: eth0
managed: false
primary: true
provision: false
subnet:
network: 1.2.3.0
mask: 255.255.254.0
name: Scratch
vlanid: '141'
gateway: 1.2.3.1
dns_primary: 1.2.3.3
dns_secondary: 1.2.3.2
from: ''
to: ''
boot_mode: Static
ipam: None
- mac: 00:50:56:93:15:84
ip: 2.3.4.5
type: Interface
name: servername-dhcp.domain.name
attrs: {}
virtual: false
link: true
identifier: eth1
managed: true
primary: false
provision: true
subnet:
network: 2.3.4.0
mask: 255.255.254.0
name: Dev-DHCP
vlanid: '193'
gateway: ''
dns_primary: 1.2.3.3
dns_secondary: 1.2.3.2
from: 2.3.4.4
to: 2.3.4.240
boot_mode: DHCP
ipam: DHCP

Associated revisions

Revision 4d5b9795 (diff)
Added by Dominic Cleal over 6 years ago

fixes #10168 - delegate fqdn/shortname to primary interface

Revision 225cfa5b (diff)
Added by Dominic Cleal over 6 years ago

refs #10168 - fix test that created a duplicate primary interface

Subtle interaction between 4d5b979 and a5dc3e2, resulting in the test
that tried to add an interface to an unmanaged host duplicating the one
that was automatically added.

Revision 821e0f15 (diff)
Added by Dominic Cleal over 6 years ago

fixes #10168 - delegate fqdn/shortname to primary interface

(cherry picked from commit 4d5b979541902c2163d98ca8fd53d230445b60ac)

Revision 80ec5a04 (diff)
Added by Dominic Cleal over 6 years ago

refs #10168 - fix test that created a duplicate primary interface

Subtle interaction between 4d5b979 and a5dc3e2, resulting in the test
that tried to add an interface to an unmanaged host duplicating the one
that was automatically added.

(cherry picked from commit 225cfa5bd0024954f8d4e15efeb3938c11a50552)

History

#1 Updated by Dominic Cleal over 6 years ago

  • Legacy Backlogs Release (now unused) set to 28

This looks related to the "use_shortname_for_vms" setting. When it's enabled, the VM short name is delegated to the provisioning, not the primary interface. When it's disabled (default), the VM name is the primary hostname.

#2 Updated by Dominic Cleal over 6 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal

Related issues:

  1. the "name" field on the host edit form is getting its name from the provisioning interface, not the primary (it also uses shortname), which can even be blank
  2. when overriding a smart class parameter from the host edit page, it uses the FQDN of the provisioning interface, so validation fails and it isn't ever saved, so you can't override values if interfaces differ

#3 Updated by The Foreman Bot over 6 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2317 added
  • Pull request deleted ()

#4 Updated by Dominic Cleal over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF