Project

General

Profile

Actions

Bug #29701

open

Overriding inherrited Compute Resource from Hostgroup with nil (Bare Metal) does not work properly

Added by Sebastian Bublitz almost 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Host creation
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

When using a hostgroup that has a compute resource defined, it is not properly possible to create a Bare Metal server in that HG anymore.

From the answers I got on the forum (https://community.theforeman.org/t/override-inherited-compute-resource-with-bare-metal/18509), this should be possible using the "Inherrit" Button on the host creation form.
In reality though, I ended up in different states, each of them undesirable.

1. Foreman still created a VM in the hostgroup defined compute resource
2. The creation aborted with an error about the VMWare VirtBridge beeing nil
3. The host was created and a VM was not, but Foreman still “assumed” it was a VMWare host, showing VM related fields and Compute Resource is also set in the DB. When trying to query/interact with the VM, I got the error "undefined method `inlude?` for nil:NilClass", e.g. on the hosts VM tab or when trying to clone the host.

I have only been able to get outcome 3 after 2 occured when I redid the override of the compute resource and saved again.
The difference between 1 and 2 seems to come from the internal state of the host creation form getting messed up.
Nr. 1 seems happen when the form still assumes a VM to be created and send info about virt-bridge and other VM related settings. Nr. 2 happens when that is not the case.
I have not been able to differenciate how to reproduce either of them reliably.

From the PR that introduced Compute Profiles in Hostgroups, it looks like this feature used to work on a per-host basis: https://github.com/theforeman/foreman/pull/4593#issuecomment-338998489

If there are any additional logs/info I should provide, let me know.
In production log I could only find the before mentioned errors that I would consider a symptom rather than the actual problem.

No data to display

Actions

Also available in: Atom PDF