Since >99% of our managed hosts are VMWare VMs, we have set our hostgroups up to default to deploying on VMWare VCenter.
Now and then, we have the requirement to install directly to Bare Metal, though.
The hosts basically work when explicitly selecting “Deploy On: Bare Metal”, but there are still some probems. For example, Foreman will report the host as beeing deployed on VMWare, all VM related fields in the UI are still there but just error out. When trying to clone such a host, Foreman will error out with “undefined method inlude? for nil:NilClass”. Thos are just the examples I stumpled upon today.
Being able to set a host to be deployed on Bare Metal even if the hostgroup defaults to a compute resource.
Other relevant data:
I have not found anything related to this topic in the Release Notes of newer Foreman versions than ours. If I missed it, please point me to that
From what I remember, this problem has been there for quite some time. I also fiddled around with it a little bit, and from what I discovered, it looks like the root of this is the fact that “Bare Metal” is basically treated as compute_resource -> nil/undef/whatever. When trying to override an inherited value with nil, Foreman will just “pull” the inheritance since the host’s own value is undefined.
Is there any way around this problem? TBH, I don’t feel like duplication our comple hostgroup setup for physical machines just to work around this.
Thanks for your reply.
I’m not sure though if I understand correctly what you are suggesting.
The “Deploy On” field already has the “inherit” button. Without using that, I can not select another option than the one predefined in the hostgroup.
When selecting Bare Metal there, I seam to encounter some sort of undefined behaviour though (just tested around with that a little).
Outcomes I got:
Foreman still created a VM in the hostgroup defined compute resource
The creation aborted with an error about the VMWare VirtBridge beeing nil
The host was created and a VM was not, but Foreman still “assumed” it was a VMWare host and brought up the mentioned error from above when trying to interact with the non-existant VM
So from what I figured, your suggested solution is already there, but broken? Are was there additional logic implemented on other fields to explicitly allow for an override with nil?
Or, did I understand your suggestion wrong?