Bug 1243649

Summary: Satellite 6.0.8 error when trying to un-associate hostgroup from an organization
Product: Red Hat Satellite Reporter: jnikolak
Component: Organizations and LocationsAssignee: Shimon Shtein <sshtein>
Status: CLOSED ERRATA QA Contact: Kedar Bidarkar <kbidarka>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.8CC: bbuckingham, bkearney, cwelton, ehelms, kbidarka, ohadlevy, sshtein
Target Milestone: UnspecifiedKeywords: ReleaseNotes, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/14226
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:36:21 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: 1190823    
Attachments:
Description Flags
screenshot2
none
host-group delete message assoc with org none

Description jnikolak 2015-07-16 02:54:44 UTC
Created attachment 1052533 [details]
screenshot2

To reproduce:

1. Ensure that you have 2 organizations (we'll call them A and B), and a host assigned to organization A with host group A
2. Go to Hosts / All Hosts, tick the host and then go to Select Action / Assign Organization
3. Attempt to move the host to the new organization with "Fix Organization on Mismatch"

This is while host is still in host group A and the host moves successfully without a problem, however, we now have even bigger problems:


Deleting a hostgroup that is refereed by another org (that is not visible to your account) does not error correctly. 
In addition to that, it won't actually delete and gives the error:
See Screenshot2

This issue was confirmed as per Bugzilla: 1243276, it was requested that I create a new bugzilla for this issue.

What are the steps to successfully associate(remote) this new hostgroup from the new organization. Without affecting the original organization.

Comment 1 RHEL Program Management 2015-07-16 03:15:26 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 David O'Brien 2015-07-31 05:07:09 UTC
Is there any workaround or recommendation that I can add to a release note for this?

thanks

Comment 4 David O'Brien 2015-08-19 02:50:01 UTC
Is there any workaround or recommendation that I can add to a release note for this?

thanks

Comment 7 Shimon Shtein 2016-03-16 09:29:16 UTC
Created redmine issue http://projects.theforeman.org/issues/14226 from this bug

Comment 8 Bryan Kearney 2016-03-16 10:01:51 UTC
Upstream bug component is Provisioning

Comment 10 David O'Brien 2016-04-18 00:48:38 UTC
Reset docs contact <> daobrien

Comment 11 Bryan Kearney 2016-05-03 16:10:19 UTC
Upstream bug component is Organizations and Locations

Comment 12 Shimon Shtein 2016-05-10 12:04:34 UTC
The main issue is fixed in upstream commit https://github.com/theforeman/foreman/commit/08d4fc31447487181f59e7be54121fc681f3a5b4

The commit will enable the user to see which hosts are preventing the hostgroup from being deleted.

Comment 13 Shimon Shtein 2016-05-10 12:13:32 UTC
Further warning to the user about using the same hostgroup in multiple taxonomies was rejected upstream. 
See http://projects.theforeman.org/issues/14226#note-4 for more details.

Comment 14 Shimon Shtein 2016-05-10 12:32:22 UTC
The message is already in the downstream, see https://bugzilla.redhat.com/show_bug.cgi?id=1207972 .

Comment 15 Kedar Bidarkar 2016-06-17 09:22:08 UTC
When we follow the procedure as mentioned in the initial bug description and try to delete the hostgroup in A Org, we get the below message.


2016-06-17 05:12:48 [app] [I] Started DELETE "/hostgroups/1-rhel72_hgrp" for 10.65.209.162 at 2016-06-17 05:12:48 -0400
2016-06-17 05:12:48 [app] [I] Processing by HostgroupsController#destroy as HTML
2016-06-17 05:12:48 [app] [I]   Parameters: {"authenticity_token"=>"jWaNg5Li/6HaiB27Fdn2OY7rcXYXTVLIemweu9Tikdk=", "id"=>"1-rhel72_hgrp"}
2016-06-17 05:12:49 [app] [E] You may not destroy rhel72_hgrp as it is in use!
2016-06-17 05:12:49 [app] [I] Failed to save: rhel72_hgrp is being used by a hidden Host::Managed resource
2016-06-17 05:12:49 [app] [I] Redirected to https://testsat6.redhat.com/hostgroups
2016-06-17 05:12:49 [app] [I] Completed 302 Found in 615ms (ActiveRecord: 67.5ms)

Also we get an appropriate message on the UI as below,
"Error: rhel72_hgrp is being used by a hidden Host::Managed resource".

Also to find and move all the hosts to move to another host-group we need to follow this procedure, https://bugzilla.redhat.com/show_bug.cgi?id=1243649#c5

VERIFIED with sat62-snap(GA)-14.1

Comment 16 Kedar Bidarkar 2016-06-17 09:25:12 UTC
Created attachment 1169004 [details]
host-group delete message assoc with org

Comment 17 Bryan Kearney 2016-07-27 11:36:21 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/RHBA-2016:1501