Project

General

Profile

Feature #20877

allow hosts to inherit lifecycle environment and content view

Added by Gerrit Schwerthelm almost 2 years ago. Updated 11 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Hosts
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Hey community,

I think I found an issue, which I saw on Katello 3.4.4 and earlier: A content view is not updated properly for hosts when a content view is changed on the host group.

Steps to reproduce:

  • Create a host group with a content view
  • Assign a host to this host group
  • Verify that the host has the correct content view from the foreman-rake console
  • Change the content view of the host group
  • Notice that, in the Foreman UI, the content view of the host shows the correct content view in the host edit panel
  • Go to foreman-rake console again and show the content view of the host in the database
  • Notice that the content view is still the previous one

Workaround:

  • Unassign the host from the host group, reassign the host to the host group.
ContentViewMismatch.mov ContentViewMismatch.mov 3.63 MB Short demonstration of host content view mismatch between UI and database. Gerrit Schwerthelm, 11/22/2017 10:15 AM

History

#1 Updated by Andrew Kofink almost 2 years ago

  • Legacy Backlogs Release (now unused) set to 166

This is currently working as designed. Hostgroups are used for provisioning hosts but are not intended to change host parameters when changed. You can, of course, change values on a host or multiple hosts manually (using bulk actions).

#2 Updated by Gerrit Schwerthelm almost 2 years ago

Hey Andrew, thanks a lot for your answer!

I am afraid, I do not fully understand why the design is working as described. So please let me ask two more questions to make me fully comprehend why the described behaviour is justified:

  1. Why is the UI allowed to show the wrong information of a host, making the user assume that there actually is a content view assigned that's not really assigned to this host?
  2. If a host group is not intended to change host parameters, why does the host inherit a content view when you assign the host (changes a host parameter)?
  3. Actually, I would expect properties to be inherited from a host group if they were not specified specifically for that host, why does this not make sense?

Thanks again and best wishes!

#3 Updated by Gerrit Schwerthelm almost 2 years ago

Actually, those were three more questions, sorry. :D

#4 Updated by Nagoor Shaik almost 2 years ago

This is not reproduce able on latest nightly builds, seems its already fixed.

~~~
irb(main):013:0> Host.find_by_name('server.example.com').hostgroup.name
=> "HG1"

irb(main):014:0> Host.find_by_name('server.example.com').hostgroup
=> #<Hostgroup id: 1, name: "HG1", created_at: "2017-09-11 10:27:29", updated_at: "2017-09-11 10:27:29", environment_id: 2, operatingsystem_id: nil, architecture_id: nil, medium_id: nil, ptable_id: nil, root_pass: "", puppet_ca_proxy_id: 1, use_image: nil, image_file: nil, ancestry: nil, vm_defaults: nil, subnet_id: nil, domain_id: nil, puppet_proxy_id: nil, title: "HG1", realm_id: nil, compute_profile_id: nil, content_source_id: 1, grub_pass: "", content_view_id: 1, lifecycle_environment_id: 1, lookup_value_matcher: "hostgroup=HG1", kickstart_repository_id: nil, subnet6_id: nil, pxe_loader: nil, description: "", openscap_proxy_id: nil>

irb(main):015:0> Host.find_by_name('server.example.com').hostgroup
=> #<Hostgroup id: 1, name: "HG1", created_at: "2017-09-11 10:27:29", updated_at: "2017-09-19 09:14:02", environment_id: 2, operatingsystem_id: nil, architecture_id: nil, medium_id: nil, ptable_id: nil, root_pass: "", puppet_ca_proxy_id: 1, use_image: nil, image_file: nil, ancestry: nil, vm_defaults: nil, subnet_id: nil, domain_id: nil, puppet_proxy_id: nil, title: "HG1", realm_id: nil, compute_profile_id: nil, content_source_id: 1, grub_pass: "", content_view_id: 2, lifecycle_environment_id: 1, lookup_value_matcher: "hostgroup=HG1", kickstart_repository_id: nil, subnet6_id: nil, pxe_loader: nil, description: "", openscap_proxy_id: nil>
~~~

See the `content_view_id` in the first response was `1` and in the second it was changed to `2` and its reflecting the correct change in rake console.

#5 Updated by Justin Sherrill over 1 year ago

  • Assignee set to Andrew Kofink
  • Legacy Backlogs Release (now unused) deleted (166)

#6 Updated by Gerrit Schwerthelm over 1 year ago

Hello Nagoor,

thanks for having a look! You are however looking at the host group record, but not at the host's record as it is described in the reproduction steps.

I will also try to find some time in the next couple of days to verify this bug against the latest Katello version.

Thanks and regards,

--Gerrit

#7 Updated by Andrew Kofink over 1 year ago

Gerrit,

1. If the console and UI mismatch, then that's definitely a bug. I am yet unable to reproduce this, however.
2. Hostgroups set parameters on the host only when the Host is first created. It is not supposed to change Host parameters of hosts that are already created when a Hostgroup parameter is changed.

If you want to propose this as a feature, you may.

#8 Updated by Justin Sherrill over 1 year ago

  • Status changed from New to Need more information

#9 Updated by Justin Sherrill over 1 year ago

  • Legacy Backlogs Release (now unused) set to 114
  • Assignee deleted (Andrew Kofink)
  • Status changed from Need more information to New
  • Category changed from Content Views to Hosts
  • Subject changed from Content view not updated for hosts properly when content view changed on host group to allow hosts to inherit lifecycle environment and content view
  • Tracker changed from Bug to Feature

It sounds like you would like for content view and lifecycle environments for a host to be inherited from their host group, such that if you change it on the host group all hosts in that host group will be updated as well. Is that correct?

I would agree that this is likely the expectation for new users. Most fields on a host group are not inherited in this way in foreman, however that doesn't really mean this is the correct way to behave. So this is behaving as expected but maybe not as desired. I will set this as a feature request. Please correct me if i was wrong about any of this.

#10 Updated by Gerrit Schwerthelm over 1 year ago

Sorry that it took a while until I had the time to verify this issue against a later Katello version.

First of all, I was not able to test against katello-3.5.0-1.rc2 because I was receiving routing errors whenever I wanted to create a content view. Thus, I gave it a shot with katello-3.4.5-1.

Actually, the behaviour changed slightly but there is still a mismatch between UI and database.

When you assign the host without a content view to a host group with a content view, it appears like the host would inherit the content view (which I definitely want to suggest as a feature), but it does not really do it.

I appended a small video, which I hope can demonstrate what's wrong in my opinion.

Thanks and regards

--Gerrit

Also available in: Atom PDF