Project

General

Profile

Actions

Bug #10168

closed

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

Added by David Patterson almost 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Host creation
Target version:
Difficulty:
Triaged:
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

Actions #1

Updated by Dominic Cleal almost 9 years ago

  • translation missing: en.field_release 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.

Actions #2

Updated by Dominic Cleal almost 9 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
Actions #3

Updated by The Foreman Bot almost 9 years ago

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

Updated by Dominic Cleal almost 9 years ago

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

Also available in: Atom PDF