Bug 1257607

Summary: Discovered hosts UI does not allow setting Organization/Location when provisioning
Product: Red Hat Satellite Reporter: Barak Korren <bkorren>
Component: Discovery PluginAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: orabin
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: bbuckingham, bkearney, cwelton, lzap, orabin, wpinheir
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/4426
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:51:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1338516    
Attachments:
Description Flags
Unable to change org/loc via mass action none

Description Barak Korren 2015-08-27 12:42:45 UTC
Description of problem:
The discovered hosts UI includes "Assign Location" and "Assign Organization" actions but there is no way to preform those actions from the API. 

Version-Release number of selected component (if applicable):
6.1.1

How reproducible:
Easy

Steps to Reproduce:
1. Setup Satellite with multiple organizations and locations 
2. Setup the discovery plugin
3. Let some hosts be discovered
4. Try to assign organizations and locations from the API

Actual results:
There is no API for assigning organizations and locations

Expected results:
There should be API for this...

Comment 1 Bryan Kearney 2015-08-28 17:36:44 UTC
Created redmine issue http://projects.theforeman.org/issues/11605 from this bug

Comment 2 Lukas Zapletal 2015-08-31 10:01:45 UTC
WORKAROUND: It is possible to change org/loc of existing discovered hosts using mass assignement action. Select one or more hosts, click on Select action and use Assign org/loc button to do this.

Comment 3 Barak Korren 2015-08-31 10:59:27 UTC
Created attachment 1068596 [details]
Unable to change org/loc via mass action

There is a problem with this - the mass action window shows the list of hosts again instead of allowing to select the org/loc. (See attached screenshot)

Comment 4 Lukas Zapletal 2015-08-31 14:31:16 UTC
Thanks, reported and fixed as in https://bugzilla.redhat.com/show_bug.cgi?id=1258521

The patch is small, you can apply it onto your instance if you dont want to wait for z-stream update.

Or you can use "foreman-rake console" if API won't work.

Comment 6 Lukas Zapletal 2016-03-03 09:46:37 UTC
Unfortunately, this is a technical limitation of reusing Edit Host form in Discovery. This can't be easily fixed, my initial attempt stalled and we need to implement proper solution - brand new provisioning form for discovered hosts.

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

Comment 12 orabin 2017-08-10 06:30:58 UTC
Version Tested: Satellite-6.3 Snap 10

The selection of organization and location works with the wizard.
Choosing hostgroup, organization and location then clicking quick or create will work as expected.
However, I found a bug with one case:
1) Click provision on a discovered host
2) Choose organization and location that are not the default and leave the hostgroup empty
3) Click create host
4) fill in hostgroup and submit

Expected result: Success save or validation erro

Actual result: Host not found

Moved bug back to assigned but it's also possible to open a new bug and mark this one as verified.
Adding need more information so assignee will decide how to proceed.

Comment 13 Lukas Zapletal 2017-08-29 10:15:12 UTC
Ok I prefer separate bug for this, created upstream issue for that:

http://projects.theforeman.org/issues/20784

Comment 14 Bryan Kearney 2018-02-21 16:44:32 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

Comment 15 Satellite Program 2018-02-21 16:51:07 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