Project

General

Profile

Refactor #7456

Extract primary interface from host

Added by Marek Hulán over 4 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Category:
Network
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Extract MAC, IP, domain and subnet out of host object to the separate interface object. Related to this - properly detect primary interface among facts, never use ipaddress and macaddress facts. We should add primary and provisioning flags to interfaces.

Primary - this gives the host it's identity, and the DNS record for
this interface is how the host is referred to / displayed in the UI.
There must always be a primary, so that a host has a name (except for
unamanged, wher the host.name is the fqdn as usual)

Provisioning - the interface used for writing tftp files based it's
mac, and configured as the primary during kickstart so it can reach
Foreman. Defaults to the Primary interface above if not set.

Some more details:

This is because we often hear of people having separate provisioning
networks, with hosts moved to the correct vlans/subnets after build.
As such, you want to see "foo.example.com" in Foreman, not
"foo.provisioning.example.com".

Few ideas that we agreed on * primary interface should always be managed (flag added recently) * same applies to provisioning interface * we can easily support moving of provisioning flag between interfaces * we don't want to enable primary interface flag to be moved (at least for now - we do it for now for hosts, so depending on complexity) * while flags on interface seems as simple solution for now, we should think
about subnet roles so by assigning a subnet with role "provisioning", we'd
know the default value for provisioning flag, this brings several things to
consider, like multiple provisioning subnets


Related issues

Related to Foreman - Tracker #2409: NetworkingNew

Related to Foreman - Bug #7405: FreeBSD bond interfaces lead to constant switching of primary interfaceClosed2014-09-10
Related to Foreman - Feature #8556: Resolve interface.name when instantiating ProxyAPI::BMCNew2014-12-03
Related to Foreman - Bug #9138: Intermittent HostTest/NIC integration test failuresDuplicate2015-01-28
Related to Foreman - Bug #9170: Wrong nic order in libvirt domainClosed2015-01-29
Related to Foreman - Bug #9461: undefined method domain_selected() when selecting Host group domain/subnetClosed2015-02-19
Related to Foreman - Bug #9966: Add debug logging when host interfaces cannot be matched to VM interfacesClosed2015-03-31
Blocks Foreman - Feature #3695: Add a device name to additional host interfacesResolved2013-11-19
Blocked by Foreman - Refactor #7733: Remove Host FixturesClosed2014-09-29
Blocks Foreman - Feature #7458: Allow searching of hosts based on mac address (including all interfaces)Closed2014-09-16
Blocks Foreman - Feature #5458: Make setting static IP more user friendlyClosed2014-04-25

Associated revisions

Revision 43c4bd72 (diff)
Added by Marek Hulán about 4 years ago

Fixes #7456 - Extract primary interface from host

Contributions from:

All host must have at least one primary interface and one provision (can
be the same interface). Primary interface gives host a name so even
unamanaged host have primary interface (we skip validations of other
attributes for unamanged hosts though).

Host still have name attribute which is a cache of primary interface name.
Therefore we can use the host name in SQL queries, as a friendly_id etc.

- realm moved to the primary tab
- fqdn in nics table
- flags in nics table
- checkboxes for provision and primary flags
- modal resize fix
- original fields for primary NIC removed
- skipping validation for new resources
- warnings before switching flags and table update
- host name and primary interface name connected
- host domain name in the page title
- nics on host show page
- clearing modal window on cancel
- fixed domain validation in NIC::Base
- ip suggestion for all interfaces
- flags switchable from the overview table
- use icons instead of text for primary/provision on NICs overview tab
- attempt to fix sending NIC template
- fix fqdn algorithm
- ip addres in the overview table
- fix for class name collision
- better behavior of host name <-> primary name sync
- fix for subnet combobox values
- fix for modal poping up on form submission
- network partial for CRs moved from VM tab to modal
- fix ip suggestion race for ipam=db

History

#1 Updated by Marek Hulán over 4 years ago

#2 Updated by Marek Hulán over 4 years ago

  • Blocks Feature #3695: Add a device name to additional host interfaces added

#3 Updated by Greg Sutcliffe over 4 years ago

#4 Updated by Michael Moll over 4 years ago

  • Related to Bug #7405: FreeBSD bond interfaces lead to constant switching of primary interface added

#5 Updated by Marek Hulán over 4 years ago

  • Blocks Feature #7458: Allow searching of hosts based on mac address (including all interfaces) added

#6 Updated by Marek Hulán over 4 years ago

  • Blocks Feature #5458: Make setting static IP more user friendly added

#7 Updated by Marek Hulán over 4 years ago

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

#8 Updated by Greg Sutcliffe over 4 years ago

  • Related to Feature #8556: Resolve interface.name when instantiating ProxyAPI::BMC added

#9 Updated by Marek Hulán about 4 years ago

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

#10 Updated by Dominic Cleal about 4 years ago

  • Related to Bug #9138: Intermittent HostTest/NIC integration test failures added

#11 Updated by Dominic Cleal about 4 years ago

  • Legacy Backlogs Release (now unused) set to 28

#12 Updated by Dominic Cleal about 4 years ago

  • Related to Bug #9170: Wrong nic order in libvirt domain added

#13 Updated by Dominic Cleal about 4 years ago

  • Related to Bug #9461: undefined method domain_selected() when selecting Host group domain/subnet added

#14 Updated by Dominic Cleal about 4 years ago

  • Related to Bug #9966: Add debug logging when host interfaces cannot be matched to VM interfaces added

Also available in: Atom PDF