Bug 1245642 - [RFE] Allow editing of taxonomy for discovered hosts
Summary: [RFE] Allow editing of taxonomy for discovered hosts
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Discovery Plugin
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact: Daniel Lobato Garcia
URL: http://projects.theforeman.org/issues...
Whiteboard:
: 1253025 (view as bug list)
Depends On:
Blocks: 1338516
TreeView+ depends on / blocked
 
Reported: 2015-07-22 12:54 UTC by Alexander Braverman
Modified: 2019-10-10 09:59 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 12:29:34 UTC
Target Upstream Version:


Attachments (Terms of Use)
Provision discovered hosts w/ taxonomies (579.14 KB, application/octet-stream)
2017-08-23 10:05 UTC, Daniel Lobato Garcia
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 4426 0 'Normal' 'Closed' 'Allow changing/setting of organisation and location in the "Provision Host" screen' 2019-11-15 12:08:05 UTC
Red Hat Product Errata RHSA-2018:0336 0 normal SHIPPED_LIVE Important: Satellite 6.3 security, bug fix, and enhancement update 2018-02-21 22:43:42 UTC

Description Alexander Braverman 2015-07-22 12:54:49 UTC
Description of problem:
1. Discovery rules don't have organization or location limit, and so the filter 'Discovery rule' doesn't have option to limit by org\loc. 
Users from different org\loc  will able to modify rules that don't belong  to them. The current option is to use 'search' in the filter but its power is limited (e.g. user can create a filter that he will not see).

2. All discovered hosts assigned to a default org\loc. User must belong to that org\loc to see the hosts. 

How reproducible:
Create\set default org\loc X for discovered hosts.
Create a user Y which doesn't belong to that org\loc.
Run the discovery process for a host Z.

Actual results:
The host Z will be listed in discovered hosts for org\loc Z.
User X can't see the host in the discovered hosts page.

Expected results:
Host Z assigned to the correct org\loc by a rule without auto-provision.
Uses X sees the host in discovered hosts page.

Additional info:
A better option is to have a 'pre-rule' to assign hosts to the correct org\loc.

Comment 1 RHEL Program Management 2015-07-22 12:55:24 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Lukas Zapletal 2015-08-17 11:45:20 UTC
Hello, in 6.1 we have actually introduced org/loc (we call a taxonomy) for discovery rules. Does this solve your requirement?

Comment 4 Alexander Braverman 2015-08-17 12:00:16 UTC
I don't see how to apply the taxonomy on discovery rules in Satellite 6.1.1 
Available fields for a new rule are:
 - Name
 - Search
 - Host Group
 - Hostname
 - Template
 - Hosts limit
 - Priority
 - Enabled

Taxonomy wasn't added to 'Discovery Rule' filter (roles).
Is this an API\GUI issue now? if not, then it doesn't solve the requirement.

P.s this satellite was upgraded from 6.0.4 to 6.1 and then to 6.1.1 .

Comment 5 Lukas Zapletal 2015-08-24 12:52:41 UTC
Sorry for the delay, currently the only supported way of setting taxonomy for discovered hosts are:

1) Global setting discovery_location/organization under Settings->Discovered (for all incoming hosts).

2) Providing custom facts named organization/location. This must be set via custom extension of the image and it can be only done programatically during the discovery phase.

Unfortunately, either via rules or when you do manual provisioning (Org/Loc on the Provision host screen is disabled) it is not possible to change taxonomy.

This is a valid RFE.

Comment 6 Lukas Zapletal 2015-08-24 13:16:51 UTC
One extra thing: When global setting is not set (empty value), discovery uses the org/location for the subnet of the host (if there are multiple values, it takes the first one).

Comment 7 Lukas Zapletal 2015-08-26 06:24:28 UTC
*** Bug 1253025 has been marked as a duplicate of this bug. ***

Comment 8 Lukas Zapletal 2015-08-26 06:37:01 UTC
WORKAROUND: Org/Loc of discovered hosts can be changed via mass actions - select one or more discovered hosts via checkboxes on the left, then click on Select Action -> Assign Organization.

Comment 9 Alexander Braverman 2015-08-26 07:22:25 UTC
"One extra thing: When global setting is not set (empty value), discovery uses the org/location for the subnet of the host (if there are multiple values, it takes the first one)."

This might actually work in my case, as typically the org's have different subnets.

"WORKAROUND: Org/Loc of discovered hosts can be changed via mass actions - select one or more discovered hosts via checkboxes on the left, then click on Select Action -> Assign Organization."
It still requires a user to belong to discovered hosts org/loc. And it might create problems when multiple users from different org/loc will have such role.

Comment 10 Alexander Braverman 2015-08-27 12:05:05 UTC
"One extra thing: When global setting is not set (empty value), discovery uses the org/location for the subnet of the host (if there are multiple values, it takes the first one)." this doesn't work

Comment 11 Lukas Zapletal 2015-10-19 12:59:26 UTC
Alexander, you are right and we've fixed that already. Will be part of upcoming errata of 6.1. Here is the relevant bug: https://bugzilla.redhat.com/show_bug.cgi?id=1258521

Comment 12 Bryan Kearney 2016-06-15 16:07:43 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/4426 has been closed

Comment 15 Lukas Zapletal 2017-02-23 09:55:20 UTC
Let me explain. Two issues were reported in this BZ:

1) Missing taxonomy for discovery rules. We have added these in upstream and Satellite NEXT will contain this.

2) Allow changing taxonomy on Provision host screen.

This is design limitation of how Discovery is implemented today, but we implemented a workaround or new screen called QUICK PROVISION which will be coming out as part of Satellite NEXT as well. It allows quick provisioning (assign hostgroup, taxonomy, submit).

This was fixed in http://projects.theforeman.org/issues/4426 (associated with this BZ).

Now the original issue that Provision host has taxonomy fields disabled that's part of bigger refactoring which is not yet planned. We are tracking this as:

http://projects.theforeman.org/issues/14035
https://bugzilla.redhat.com/show_bug.cgi?id=1324539

So I suggest to close this one, please associate customer cases with bug 1324539 if they want to track this RFE.

QA NOTES: Verify that taxonomy for discovery rules works. Verify that quick provision screen works and sets correct taxonomy.

Comment 16 Lukas Zapletal 2017-02-23 09:58:12 UTC
One more note, in Satellite 6.3 there will be possibility to set taxonomy also this way:

1) Find discovered host, click Provision
2) On the Quick provision modal screen select taxonomy
3) Click on Provision (not Quick provision)
4) Edit details, note the taxonomy was set correctly now (but it's disabled)
5) Submit

QA NOTES: Please verify this as well.

Comment 17 Daniel Lobato Garcia 2017-08-23 10:04:36 UTC
Verified.

Version tested: Satellite 6.3 Snap 12

See the attached video, it tests steps in Comment 16 https://bugzilla.redhat.com/show_bug.cgi?id=1245642#c16

Comment 18 Daniel Lobato Garcia 2017-08-23 10:05:16 UTC
Created attachment 1317036 [details]
Provision discovered hosts w/ taxonomies

Comment 21 errata-xmlrpc 2018-02-21 12:29:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336


Note You need to log in before you can comment on or make changes to this bug.