Project

General

Profile

Actions

Bug #33771

open

Virtual NIC naming conventions expected by fact_parser.rb cause registrations to fail

Added by Pablo Hess about 3 years ago. Updated about 3 years ago.

Status:
Ready For Testing
Priority:
Normal
Assignee:
Category:
Host registration
Target version:
-
Difficulty:
easy
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Description of problem:
When registering a host with virtual NICs that do not follow the most common NIC naming patterns, host registration with `subscription-manager` fails to parse NIC facts and results in 422 Unprocesable Entity error by foreman.

Version-Release number of selected component (if applicable):
foreman-2.3.1.24-1.el7sat.noarch

How reproducible:
Every time given the "right" conditions i.e. the "right" NIC names on a host.

Steps to Reproduce:
1. Have a host with a bridge named something other than br0, br1, etc. E.g. my-br.
2. Add a VLAN-tagged vNIC to this host, e.g. my-br.42.
3. Try to register this host to Satellite with `subscription-manager register`.

Actual results:
Registration fails and the client receives an error message:
"HTTP error (422 - Unknown): Validation failed: Attached to can't be blank"

Expected results:
Registration would succeed.

Additional info:

Satellite logs this to production.log while processing the NIC::Managed events:

2021-10-15T10:18:44 [E|kat|a0a5a5bf] <Class> ActiveRecord::RecordInvalid
2021-10-15T10:18:44 [E|kat|a0a5a5bf] attached_to: ["can't be blank"]
2021-10-15T10:18:44 [I|app|a0a5a5bf] Completed 422 Unprocessable Entity in 13967ms (Views: 0.2ms | ActiveRecord: 3529.9ms | Allocations: 2509109)

If I rename the bridge from `my-br` to e.g. `br2` and the respective VLAN-tagged vNIC from `my-br.42` to `br2.42` then the registration succeeds.

I've investigated the issue and the problem is in the regexes used to identify virtual interfaces while foreman tries to locate the physical interface to mark as primary for the newly-registered host. PR is linked.

Actions

Also available in: Atom PDF